public bool Init(List <DeckModel> models, int initIndex, DelDecideRebellionOrganizeFleetSelector decideDelegate)
        {
            DebugUtils.Log("UIRebellionFleetSelector", string.Empty);
            this._listDeckModels = models;
            this._nSelectedIndex = initIndex;
            this._delDecideRebellionOrganizeFleetSelector = decideDelegate;
            this.SetFleetInfos(initIndex);
            using (IEnumerator enumerator = this._clsRouletteSelector.GetContainer().get_transform().GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    Transform transform = (Transform)enumerator.get_Current();
                    Object.Destroy(transform.get_gameObject());
                }
            }
            int num = 0;

            using (List <DeckModel> .Enumerator enumerator2 = models.GetEnumerator())
            {
                while (enumerator2.MoveNext())
                {
                    DeckModel current = enumerator2.get_Current();
                    this._listSelectorShips.Add(UIRebellionSelectorShip.Instantiate(this._prefabSelectorShip.GetComponent <UIRebellionSelectorShip>(), this._clsRouletteSelector.get_transform(), Vector3.get_zero(), current.GetFlagShip()));
                    this._listSelectorShips.get_Item(num).get_transform().set_name("SelectorShips" + num);
                    num++;
                }
            }
            this._clsRouletteSelector.Init(this);
            this._clsRouletteSelector.SetKeyController(StrategyTaskManager.GetStrategyRebellion().keycontrol);
            this._clsRouletteSelector.ScaleForce(0.3f, 1f);
            return(true);
        }
Exemplo n.º 2
0
        public bool Init(List <DeckModel> models, int initIndex, DelDecideRebellionOrganizeFleetSelector decideDelegate)
        {
            DebugUtils.Log("UIRebellionFleetSelector", string.Empty);
            _listDeckModels = models;
            _nSelectedIndex = initIndex;
            _delDecideRebellionOrganizeFleetSelector = decideDelegate;
            SetFleetInfos(initIndex);
            foreach (Transform item in _clsRouletteSelector.GetContainer().transform)
            {
                UnityEngine.Object.Destroy(item.gameObject);
            }
            int num = 0;

            foreach (DeckModel model in models)
            {
                _listSelectorShips.Add(UIRebellionSelectorShip.Instantiate(((Component)_prefabSelectorShip).GetComponent <UIRebellionSelectorShip>(), _clsRouletteSelector.transform, Vector3.zero, model.GetFlagShip()));
                _listSelectorShips[num].transform.name = "SelectorShips" + num;
                num++;
            }
            _clsRouletteSelector.Init(this);
            _clsRouletteSelector.SetKeyController(StrategyTaskManager.GetStrategyRebellion().keycontrol);
            _clsRouletteSelector.ScaleForce(0.3f, 1f);
            return(true);
        }