Beispiel #1
0
        void Awake()
        {
            instance    = this;
            thisObj     = gameObject;
            rectT       = thisObj.GetComponent <RectTransform>();
            canvasGroup = thisObj.GetComponent <CanvasGroup>();
            if (canvasGroup == null)
            {
                canvasGroup = thisObj.AddComponent <CanvasGroup>();
            }

            butAutoNCom.Init();

            for (int i = 0; i < 6; i++)
            {
                if (i == 0)
                {
                    buttonList[0].Init();
                }
                else if (i > 0)
                {
                    buttonList.Add(UIButton.Clone(buttonList[0].rootObj, "Button" + (i + 1)));
                }

                buttonList[i].SetCallback(this.OnHoverButton, this.OnExitButton, this.OnButton, null);

                buttonList[i].rootObj.SetActive(false);
            }

            rectT.localPosition = new Vector3(0, 0, 0);

            thisObj.SetActive(false);
        }
Beispiel #2
0
 void OnUnitDeployment(bool flag)
 {
     if (flag)
     {
         UIUnitDeployment.Show();
         UIHUD.HideInstant();
         UISelectedUnitInfo.HideInstant();
     }
     else
     {
         //UIUnitDeployment.Hide();
         UIHUD.Show();
         UISelectedUnitInfo.Show();
     }
 }