本文整理汇总了C#中UITable.Reposition方法的典型用法代码示例。如果您正苦于以下问题:C# UITable.Reposition方法的具体用法?C# UITable.Reposition怎么用?C# UITable.Reposition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UITable
的用法示例。
在下文中一共展示了UITable.Reposition方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: initialize
//.........这里部分代码省略.........
uiLabelUndo.width = uiSpriteUndo.width - 10;
uiLabelUndo.fontSize = 14;
uiLabelUndo.spacingX = 0;
uiLabelUndo.supportEncoding = true;
uiLabelUndo.text = "[111111]Undo";
UIButton uiButtonUndo = goUndo.GetComponent<UIButton>();
uiButtonUndo.defaultColor = new Color(1f, 1f, 1f, 0.8f);
EventDelegate.Set(uiButtonUndo.onClick, new EventDelegate.Callback(this.OnClickUndoButton));
FindChild(goUndo,"SelectCursor").GetComponent<UISprite>().SetDimensions(16,16);
FindChild(goUndo,"SelectCursor").SetActive(false);
NGUITools.UpdateWidgetCollider(goUndo);
goUndo.SetActive(true);
// Resetボタン
GameObject goReset = SetCloneChild(goModUnit, goProfileTabCopy, "Reset:" + key);
goReset.AddComponent<UIDragScrollView>().scrollView = uiScrollView;
goReset.transform.localPosition = new Vector3(conWidth*0.4f+2, -10.5f, 0f);
UISprite uiSpriteReset = goReset.GetComponent<UISprite>();
uiSpriteReset.SetDimensions((int)(conWidth*0.2f)-2, 19);
UILabel uiLabelReset = FindChild(goReset,"Name").GetComponent<UILabel>();
uiLabelReset.width = uiSpriteReset.width - 10;
uiLabelReset.fontSize = 14;
uiLabelReset.spacingX = 0;
uiLabelReset.supportEncoding = true;
uiLabelReset.text = "[111111]Reset";
UIButton uiButtonReset = goReset.GetComponent<UIButton>();
uiButtonReset.defaultColor = new Color(1f, 1f, 1f, 0.8f);
EventDelegate.Set(uiButtonReset.onClick, new EventDelegate.Callback(this.OnClickResetButton));
FindChild(goReset,"SelectCursor").GetComponent<UISprite>().SetDimensions(16,16);
FindChild(goReset,"SelectCursor").SetActive(false);
NGUITools.UpdateWidgetCollider(goReset);
goReset.SetActive(true);
for (int j=0; j<mp.ValCount(key); j++)
{
string prop = mp.sPropName[key][j];
if (!mp.bVVisible[key][prop]) continue;
float value = mp.fValue[key][prop];
float vmin = mp.fVmin[key][prop];
float vmax = mp.fVmax[key][prop];
string label = mp.sLabel[key][prop];
string vType = mp.sVType[key][prop];
// スライダーをModUnitに追加
GameObject goSliderUnit = SetCloneChild(goModUnit, goTestSliderUnit, "SliderUnit");
goSliderUnit.transform.localPosition = new Vector3(0f, j * - 70f - uiSpriteHeaderButton.height-20f, 0f);
goSliderUnit.AddComponent<UIDragScrollView>().scrollView = uiScrollView;
// フレームサイズ
goSliderUnit.GetComponent<UISprite>().SetDimensions(conWidth, 50);
// スライダー設定
UISlider uiModSlider = FindChild(goSliderUnit,"Slider").GetComponent<UISlider>();
uiModSlider.name = "Slider:"+ key +":"+ prop;
uiModSlider.value = codecSliderValue(key, prop);
if (vType == "int") uiModSlider.numberOfSteps = (int)(vmax - vmin + 1);
EventDelegate.Add(uiModSlider.onChange, new EventDelegate.Callback(this.OnChangeSlider));
// スライダーラベル設定
FindChild(goSliderUnit,"Label").GetComponent<UILabel>().text = label;
FindChild(goSliderUnit,"Label").AddComponent<UIDragScrollView>().scrollView = uiScrollView;
// スライダー値ラベル参照取得
GameObject goValueLabel = FindChild(goSliderUnit,"Value");
goValueLabel.name = "Value:"+ key +":"+ prop;
uiValueLable[key][prop] = goValueLabel.GetComponent<UILabel>();
uiValueLable[key][prop].multiLine = false;
EventDelegate.Set(goValueLabel.GetComponent<UIInput>().onSubmit, this.OnSubmitSliderValueInput);
// スライダー有効状態設定
//goSliderUnit.SetActive( !mp.IsToggle(key) || mp.bEnabled[key] && mp.CheckWS(key) );
goSliderUnit.SetActive(false);
}
}
// 金枠Sprite
uiSpriteHeaderCursor.type = UIBasicSprite.Type.Sliced;
uiSpriteHeaderCursor.SetDimensions(uiSpriteHeaderButton.width - 4, uiSpriteHeaderButton.height - 4);
}
#endregion
uiTable.Reposition();
goAMSPanel.SetActive(false);
//WriteTrans("UI Root");
} catch(Exception ex) { Debug.Log(LogLabel +"initialize()"+ ex); return false;}
return true;
}
示例2: IntilizationTables
public static void IntilizationTables(UITable table, int number, GameObject itemPre, List<GameObject> list)
{
for (int i = 0; i < number; i++)
{
GameObject gameO = (GameObject)GameObject.Instantiate(itemPre);
gameO.transform.parent = table.transform;
gameO.transform.localScale = Vector3.one;
gameO.transform.localPosition = Vector3.one;
gameO.SetActive(true);
gameO.name = i.ToString();
list.Add(gameO);
}
Utility.instance.WaitForSecs(0.02f, () => {
if(table != null)
table.Reposition();
});
}