Example #1
0
 private void OnDestroy()
 {
     arsenalManager = null;
     for (int i = 0; i < dockMamager.Length; i++)
     {
         dockMamager[i] = null;
     }
     Mem.DelAry(ref _dock);
     commonDialog = null;
     Mem.DelAry(ref dockMamager);
     _hexMenu               = null;
     _speedDialogManager    = null;
     _dockOpenDialogManager = null;
     _tankerDialog          = null;
     _MainObj               = null;
     _bgObj                    = null;
     _ConstructObj             = null;
     _DismantleObj             = null;
     mLabel_ListHeaderCategory = null;
 }
Example #2
0
 private void OnDestroy()
 {
     TaskMainArsenalManager.arsenalManager = null;
     for (int i = 0; i < TaskMainArsenalManager.dockMamager.Length; i++)
     {
         TaskMainArsenalManager.dockMamager[i] = null;
     }
     Mem.DelAry <BuildDockModel>(ref this._dock);
     this.commonDialog = null;
     Mem.DelAry <UiArsenalDock>(ref TaskMainArsenalManager.dockMamager);
     this._hexMenu                   = null;
     this._speedDialogManager        = null;
     this._dockOpenDialogManager     = null;
     this._tankerDialog              = null;
     TaskMainArsenalManager._MainObj = null;
     this._bgObj                    = null;
     this._ConstructObj             = null;
     this._DismantleObj             = null;
     this.mLabel_ListHeaderCategory = null;
 }
Example #3
0
        protected override bool Init()
        {
            if (!_isCreate)
            {
                IsControl      = true;
                _isEnd         = false;
                isDockSelect   = false;
                CurrentMode    = Mode.MENU_FOCUS;
                KeyController  = ArsenalTaskManager.GetKeyControl();
                arsenalManager = ArsenalTaskManager.GetLogicManager();
                dockMamager    = new UiArsenalDock[4];
                _dock          = arsenalManager.GetDocks();
                _MainObj       = base.scenePrefab.gameObject;
                _bgObj         = base.transform.parent.parent.transform.FindChild("BackGroundPanel").gameObject;
                if (_hexMenu == null)
                {
                    _hexMenu = ((Component)_bgObj.transform.FindChild("HexMenu")).GetComponent <ArsenalHexMenu>();
                }
                if (_speedDialogManager == null)
                {
                    _speedDialogManager = GameObject.Find("TaskArsenalMain/HighSpeedPanel").GetComponent <UiArsenalSpeedDialog>();
                }
                if (_dockOpenDialogManager == null)
                {
                    _dockOpenDialogManager = GameObject.Find("TaskArsenalMain/DockOpenDialog").GetComponent <UiArsenalDockOpenDialog>();
                }
                if (_tankerDialog == null)
                {
                    _tankerDialog = commonDialog.dialogMessages[0].GetComponent <ArsenalTankerDialog>();
                }
                uiCamera = GameObject.Find("Arsenal Root/Camera").GetComponent <UICamera>();
                _hexMenu.Init();
                _speedDialogManager.init();
                _dockOpenDialogManager.init();
                int numOfKeyPossession = arsenalManager.NumOfKeyPossessions;
                for (int i = 0; i < 4; i++)
                {
                    dockMamager[i] = _bgObj.transform.FindChild("Dock" + (i + 1)).SafeGetComponent <UiArsenalDock>();
                    dockMamager[i].init(this, i);
                    dockMamager[i].EnableParticles();
                    if (_dock.Length > i)
                    {
                        dockMamager[i]._setShow();
                        dockMamager[i].HideKeyLock();
                    }
                }
                for (int j = 0; j < 4; j++)
                {
                    if (!dockMamager[j].SelectDockMode())
                    {
                        dockMamager[j].ShowKeyLock();
                        break;
                    }
                }
                Animation component = _bgObj.GetComponent <Animation>();
                component.Stop();
                component.Play();
                if (SingletonMonoBehaviour <PortObjectManager> .exist())
                {
                    SoundUtils.SwitchBGM(BGMFileInfos.PortTools);
                    SingletonMonoBehaviour <PortObjectManager> .Instance.PortTransition.EndTransition(delegate
                    {
                        isCreated();
                    });
                }
                else
                {
                    isCreated();
                }
            }
            else if (!isDockSelect)
            {
                _hexMenu.UpdateButtonForcus();
            }
            if (_dock.Any((BuildDockModel x) => x.Ship != null && x.CompleteTurn != 0))
            {
                SingletonMonoBehaviour <TutorialGuideManager> .Instance.CheckAndShowFirstTutorial(ArsenalTaskManager.GetLogicManager().UserInfo.Tutorial, TutorialGuideManager.TutorialID.SpeedBuild, null);
            }
            TutorialModel tutorial = arsenalManager.UserInfo.Tutorial;

            if (tutorial.GetStep() == 2 && !tutorial.GetStepTutorialFlg(3) && Tutorial == null)
            {
                Tutorial = Util.InstantiatePrefab("TutorialGuide/TutorialGuide3_3", base.gameObject);
                this.DelayActionFrame(2, delegate
                {
                    setTutorialCat();
                });
            }
            setTutorialVisible(isVisible: true);
            IsControl = true;
            return(true);
        }