private IEnumerator Start()
        {
            yield return(new WaitForEndOfFrame());

            mUIDisplaySwipeEventRegion.SetOnSwipeListener(OnSwipeListener);
            Instance        = this;
            _isControllDone = false;
            KeyController   = new KeyControl();
            UpdateSupplyManager();
            _deckName.supportEncoding = false;
            SupplyManager.InitForOther();
            SingletonMonoBehaviour <UIPortFrame> .Instance.CircleUpdateInfo(SupplyManager);

            _decks = SupplyManager.MapArea.GetDecks();
            yield return(new WaitForEndOfFrame());

            _shipBannerContainer.Init();
            _otherListParent.Initialize(KeyController, SupplyManager.Ships);
            _rightPane.Init();
            _commonDeckSwitchManager.Init(SupplyManager, (from x in _decks
                                                          where !x.HasBling()
                                                          select x).ToArray(), this, KeyController, otherEnabled: true, SingletonMonoBehaviour <AppInformation> .Instance.CurrentDeck);
            yield return(StartCoroutine(Util.WaitEndOfFrames(3)));

            if (SingletonMonoBehaviour <PortObjectManager> .Instance != null)
            {
                SingletonMonoBehaviour <PortObjectManager> .Instance.PortTransition.EndTransition(delegate
                {
                    SoundUtils.PlaySceneBGM(BGMFileInfos.PortTools);
                });
            }
        }
Esempio n. 2
0
 public bool FirstInit()
 {
     if (!IsCreate)
     {
         KeyController = OrganizeTaskManager.GetKeyControl();
         GameObject gameObject = GameObject.Find("OrganizeRoot").gameObject;
         Util.FindParentToChild(ref _bgPanel, gameObject.transform, "BackGround");
         Util.FindParentToChild(ref _bannerPanel, gameObject.transform, "Banner");
         decks       = OrganizeTaskManager.Instance.GetLogicManager().MapArea.GetDecks();
         allShip     = OrganizeTaskManager.Instance.GetLogicManager().GetShipList();
         BannerIndex = 1;
         SystemIndex = 0;
         OrganizeTaskManager.Instance.GetTopTask().setControlState();
         _bannerManager = new OrganizeBannerManager[6];
         for (int i = 0; i < 6; i++)
         {
             Util.FindParentToChild(ref _bannerManager[i], _bannerPanel.transform, "ShipSlot" + (i + 1));
             _bannerManager[i].init(i + 1, OnCheckDragDropTarget, OnDragDropStart, OnDragDropRelease, OnDragDropEnd);
         }
         Transform parent = _bgPanel.transform.FindChild("SideButtons");
         Util.FindParentToChild(ref _allUnsetBtn, parent, "AllUnsetBtn");
         Util.FindParentToChild(ref _tenderBtn, parent, "TenderBtn");
         Util.FindParentToChild(ref _fleetNameBtn, parent, "DeckNameBtn");
         UIPanel component = ((Component)_bgPanel.transform.FindChild("MiscContainer")).GetComponent <UIPanel>();
         Util.FindParentToChild(ref _fleetNameLabel, component.transform, "DeckNameLabel");
         _fleetNameLabel.supportEncoding = false;
         Util.FindParentToChild(ref deckIcon, component.transform, "DeckIcon");
         DeckModel[] array = new DeckModel[decks.Length];
         decks.CopyTo(array, 0);
         DeckModel deckModel = SingletonMonoBehaviour <AppInformation> .Instance.CurrentDeck;
         if (deckModel == null)
         {
             deckModel = array[0];
         }
         deckSwitchManager.Init((OrganizeManager)OrganizeTaskManager.Instance.GetLogicManager(), array, this, KeyController, otherEnabled: false, deckModel);
         deckChangeArrows.UpdateView();
         _bannerManager.ForEach(delegate(OrganizeBannerManager e)
         {
             e.updateBannerWhenShipExist(openAnimation: true);
         });
         UpdateSystemButtons();
         UpdeteDeckIcon();
         IsCreate = true;
         CreateTender();
         _isDragDrop = false;
     }
     return(true);
 }