本文整理汇总了C#中UIPopupList类的典型用法代码示例。如果您正苦于以下问题:C# UIPopupList类的具体用法?C# UIPopupList怎么用?C# UIPopupList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UIPopupList类属于命名空间,在下文中一共展示了UIPopupList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnInit
public override void OnInit()
{
base.OnInit();
m_ObjOptionalRoot = FindChild("OptionalRoot");
m_ObjOptionalTemplate = FindChild("OptionalTextureTemplate");
m_OptionalMap = new Dictionary<string, RegularityOptionalElement>();
m_UICamera = WindowManager.Instance.GetUICamera();
m_ObjWinRoot = FindChild("Win");
m_ObjLoseRoot = FindChild("Lose");
m_PopList = FindChildComponent<UIPopupList>("PopupList");
m_ButtonRoot = FindChild("ButtonRoot");
m_Grid = m_ObjOptionalRoot.GetComponent<UIGrid>();
m_LabelLeftTime = FindChildComponent<UILabel>("Label_LeftTime");
m_LabelLeftCount = FindChildComponent<UILabel>("Label_LeftCount");
m_FlowerList = new List<GameObject>();
for (int i = 0; i < 3; ++i)
{
var obj = FindChild("Flower"+i);
m_FlowerList.Add(obj);
}
AddChildElementClickEvent(OnClickReset, "UIButton_ResetElem");
AddChildElementClickEvent(OnClickResetById, "UIButton_Reset");
AddChildElementClickEvent(OnClickBack, "UIButton_BackElem");
AddChildElementClickEvent(OnClickBack, "UIButton_Back");
AddChildElementClickEvent(OnClickBack, "Button_Exit");
m_ObjLoseRoot.SetActive(false);
m_ObjWinRoot.SetActive(false);
m_ButtonRoot.SetActive(false);
}
示例2: Start
void Start ()
{
mList = GetComponent<UIPopupList>();
UpdateList();
mList.eventReceiver = gameObject;
mList.functionName = "OnLanguageSelection";
}
示例3: Start
private void Start()
{
this.mList = base.GetComponent<UIPopupList>();
this.UpdateList();
this.mList.eventReceiver = base.gameObject;
this.mList.functionName = "OnLanguageSelection";
}
示例4: Awake
/// <summary>
/// Cache the components and register a listener callback.
/// </summary>
void Awake ()
{
mList = GetComponent<UIPopupList>();
mCheck = GetComponent<UICheckbox>();
if (mList != null) mList.onSelectionChange += SaveSelection;
if (mCheck != null) mCheck.onStateChange += SaveState;
}
示例5: InitializeValuesAndReferences
private void InitializeValuesAndReferences() {
var uSizePopup = gameObject.GetSafeFirstMonoBehaviourInChildren<GuiUniverseSizePopupList>();
_universeSizePopupList = uSizePopup.gameObject.GetSafeMonoBehaviour<UIPopupList>();
PopulateAIPlayerFolderLookup();
EventDelegate.Add(_universeSizePopupList.onChange, OnUniverseSizeSelectionChanged);
}
示例6: Start
void Start()
{
if (popupList == null)
popupList = GetComponent<UIPopupList>();
popupList.onChange.Add(new EventDelegate(this, "OnChange"));
Invoke("Refresh", 0.02f);
}
示例7: Awake
void Awake ()
{
Object.DontDestroyOnLoad (GameObject.Find ("PC Packet"));
PC = GameObject.Find ("PC Packet").GetComponent<Character> ();
UI = GetComponent<UIController> ();
ClassSelectList = GameObject.Find ("Class Select: List")
.GetComponent<UIPopupList> ();
NameInput = GameObject.Find ("Name: Input")
.GetComponent<UIInput> ();
}
示例8: Awake
protected override void Awake() {
base.Awake();
popupList = gameObject.GetSafeMonoBehaviourComponent<UIPopupList>();
ConfigurePopupList();
InitializeListValues();
InitializeSelection();
// don't receive events until initializing is complete
EventDelegate.Add(popupList.onChange, OnPopupListSelectionChange);
//popupList.onSelectionChange += OnPopupListSelectionChange;
}
示例9: Start
// Use this for initialization
void Start () {
popList = GetComponent<UIPopupList>();
if(popList == null)
return;
popList.Clear();
List<DataTable> tableList = ConstDataManager.Instance.ListTables();
foreach(DataTable table in tableList)
{
popList.AddItem(table.Name);
}
}
示例10: Start
private UISlider changVolume; //调解音量
void Start()
{
selectMusic = transform.FindChild("SelectMusic").GetComponent<UIPopupList>();
selectMusic.Clear();
AudioClip[] bgMusics = Resources.LoadAll<AudioClip>("BgMusic");
for (int i = 0; i < bgMusics.Length; i++)
{
selectMusic.AddItem(bgMusics[i].name);
}
EventDelegate.Add(selectMusic.onChange, OnMusicChange);
changVolume = transform.FindChild("VolumeSolider").GetComponent<UISlider>();
EventDelegate.Add(changVolume.onChange, OnChangeVolume);
}
示例11: Awake
public override void Awake()
{
base.Awake();
_uiPopupList = GetComponent<UIPopupList>();
if (_uiPopupList != null)
{
_nativeEventReceiver = _uiPopupList.eventReceiver;
_nativeFunctionName = _uiPopupList.functionName;
_uiPopupList.eventReceiver = gameObject;
_uiPopupList.functionName = "OnSelectionChange";
}
}
示例12: OnMapSelectionChange
/// <summary>
/// Raises the map selection change event.
/// </summary>
/// <param name='sender'>
/// Poplist that called this message.
/// </param>
///
void OnMapSelectionChange(UIPopupList sender)
{
// Finds map from list, with name, that equals to poplist selection
MapData selectedMap = MidSceneObject.Instance.mapSaveCollection.maps.Find (delegate(MapData map) {
return map.name == sender.selection;
});
// Remove all player labels and poplists
for (int i = 0; i < playerLabels.Count; i++) {
Destroy (playerLabels [i].gameObject);
Destroy (playerRacePopLists [i].gameObject);
}
playerLabels.Clear ();
playerRacePopLists.Clear ();
if (selectedMap != null) {
// Create label and poplist for each player in map
for (int i = 0; i < selectedMap.players + 1; i++) {
// Label
UILabel newLabel = (Instantiate (lbl_player) as GameObject).GetComponent<UILabel> ();
newLabel.name = "lbl_CPUPlayer " + i;
newLabel.transform.parent = pnl_NewGameMenu.transform;
newLabel.transform.localPosition = lbl_player.transform.position - new Vector3 (0, 30 * i, 0);
newLabel.transform.localRotation = Quaternion.identity;
newLabel.transform.localScale = lbl_player.transform.lossyScale;
newLabel.text = (i == 0) ? "Human Player" : "Opponent" + i;
playerLabels.Add (newLabel);
// PopList
UIPopupList newPopList = (Instantiate (poplst_PlayerRace) as GameObject).GetComponent<UIPopupList> ();
newPopList.name = "poplst_CPUPlayer " + i;
newPopList.transform.parent = pnl_NewGameMenu.transform;
newPopList.transform.localPosition = poplst_PlayerRace.transform.position - new Vector3 (0, 30 * i, 0);
newPopList.transform.localRotation = Quaternion.identity;
newPopList.transform.localScale = poplst_PlayerRace.transform.lossyScale;
newPopList.items = MidSceneObject.Instance.raceSaveCollection.GetRacesNames ();
newPopList.selection = newPopList.items [0];
newPopList.eventReceiver = gameObject;
playerRacePopLists.Add (newPopList);
}
// Human Player name/text correction
playerLabels [0].name = "lbl_HumanPlayer";
playerLabels [0].text = "Human Player";
playerRacePopLists [0].name = "poplst_HumanPlayer";
// Neutral Player name/text correction
playerLabels [1].name = "lbl_NeutralPlayer";
playerLabels [1].text = "Neutral Player";
playerRacePopLists [1].name = "poplst_NeutralPlayer";
}
}
示例13: Start
void Start ()
{
mList = GetComponent<UIPopupList>();
if (Localization.knownLanguages != null)
{
mList.items.Clear();
for (int i = 0, imax = Localization.knownLanguages.Length; i < imax; ++i)
mList.items.Add(Localization.knownLanguages[i]);
mList.value = Localization.language;
}
EventDelegate.Add(mList.onChange, OnChange);
}
示例14: Start
void Start()
{
if ( modeParent == null
|| modePrfs == null)
{
Debug.LogError("Missing component!");
return;
}
if (popupList == null)
popupList = GetComponent<UIPopupList>();
popupList.onChange.Add(new EventDelegate(this, "OnChange"));
Refresh();
}
示例15: Start
private void Start()
{
this.mList = base.GetComponent<UIPopupList>();
if (Localization.knownLanguages != null)
{
this.mList.items.Clear();
int i = 0;
int num = Localization.knownLanguages.Length;
while (i < num)
{
this.mList.items.Add(Localization.knownLanguages[i]);
i++;
}
this.mList.value = Localization.language;
}
EventDelegate.Add(this.mList.onChange, new EventDelegate.Callback(this.OnChange));
}