public void Init(KeyControl key)
 {
     keyContoroller = key;
     keyContoroller.setMinMaxIndex(0, menuButton.Length - 1);
     keyContoroller.Index = 0;
     keyContoroller.setChangeValue(-1f, 0f, 1f, 0f);
     MenuButtonName = new string[menuButton.Length];
     menuObjects    = new MenuObject[menuButton.Length];
     for (int i = 0; i < menuButton.Length; i++)
     {
         menuObjects[i]        = new MenuObject();
         menuObjects[i].sprite = menuButton[i].GetComponentInChildren <UISprite>();
         MenuButtonName[i]     = menuObjects[i].sprite.spriteName;
         menuObjects[i].nowPos = i;
         menuObjects[i].tr     = menuButton[i].GetComponent <TweenRotation>();
         menuObjects[i].button = menuButton[i].GetComponent <UIButton>();
     }
     posSpriteName    = new string[5];
     posSpriteName[0] = MenuButtonName[0];
     posSpriteName[1] = MenuButtonName[1];
     posSpriteName[2] = MenuButtonName[2];
     posSpriteName[3] = MenuButtonName[5];
     posSpriteName[4] = MenuButtonName[6];
     nowRotateZ       = new float[menuButton.Length];
     upperNo          = menuButton.Length - 3;
     footerNo         = menuButton.Length - 4;
     posZeroNo        = 0;
     cursolPos        = 0;
 }
示例#2
0
 public void _init_repair()
 {
     _Now_State = false;
     _Ani       = base.gameObject.GetComponent <Animation>();
     _Ani.Play();
     KeyController = new KeyControl();
     KeyController.setChangeValue(0f, 0f, 0f, 0f);
 }
示例#3
0
 public void SetKeyController(KeyControl keyController)
 {
     if (keyController == null)
     {
         if (mKeyController != null)
         {
             mKeyController.reset();
         }
         mKeyController = null;
     }
     else
     {
         mKeyController = keyController;
         mKeyController.reset(0, 3);
         mKeyController.setChangeValue(-1f, 0f, 1f, 0f);
     }
 }
示例#4
0
        protected override void Awake()
        {
            _isFocus       = false;
            _isInputEnable = true;
            _isTweenPos    = false;
            _camERCamera   = new Generics.InnerCamera(base.transform, "ERCamera");
            _camPECamera   = new PECamera(base.transform, "PECamera");
            _uiBtnsPanel   = ((Component)base.transform.FindChild("ERCamera/SidePanel")).GetComponent <UIPanel>();
            Transform transform = base.transform.FindChild("ERCamera/SidePanel/Btns").transform;

            _dicBtns = new Dictionary <int, ButtonInfos>();
            _dicBtns.Add(0, new ButtonInfos(((Component)transform.FindChild("StrategyBtn")).GetComponent <UIButton>(), Generics.Scene.Strategy));
            _dicBtns.Add(1, new ButtonInfos(((Component)transform.FindChild("PortTopBtn")).GetComponent <UIButton>(), Generics.Scene.PortTop));
            _dicBtns.Add(2, new ButtonInfos(((Component)transform.FindChild("OrganizeBtn")).GetComponent <UIButton>(), Generics.Scene.Organize));
            _dicBtns.Add(3, new ButtonInfos(((Component)transform.FindChild("SupplyBtn")).GetComponent <UIButton>(), Generics.Scene.Supply));
            _dicBtns.Add(4, new ButtonInfos(((Component)transform.FindChild("RepairBtn")).GetComponent <UIButton>(), Generics.Scene.Repair));
            _dicBtns.Add(5, new ButtonInfos(((Component)transform.FindChild("RemodelBtn")).GetComponent <UIButton>(), Generics.Scene.Remodel));
            _dicBtns.Add(6, new ButtonInfos(((Component)transform.FindChild("ArsenalBtn")).GetComponent <UIButton>(), Generics.Scene.Arsenal));
            _dicBtns.Add(7, new ButtonInfos(((Component)transform.FindChild("RevampBtn")).GetComponent <UIButton>(), Generics.Scene.ImprovementArsenal));
            _dicBtns.Add(8, new ButtonInfos(((Component)transform.FindChild("MissionBtn")).GetComponent <UIButton>(), Generics.Scene.Duty));
            _dicBtns.Add(9, new ButtonInfos(((Component)transform.FindChild("ItemBtn")).GetComponent <UIButton>(), Generics.Scene.Item));
            _dicBtns.Add(10, new ButtonInfos(((Component)transform.FindChild("SaveBtn")).GetComponent <UIButton>(), Generics.Scene.SaveLoad));
            int num = 0;

            foreach (KeyValuePair <int, ButtonInfos> dicBtn in _dicBtns)
            {
                dicBtn.Value.Button.onClick = Util.CreateEventDelegateList(this, "_decideButton", num);
                num++;
            }
            Vector3 localPosition = _uiBtnsPanel.transform.localPosition;

            _fPanelPosXfmCenter = localPosition.x;
            _clsInput           = new KeyControl();
            _clsInput.setChangeValue(0f, 0f, 0f, 0f);
            disableButtonList = new List <int>();
        }