public void Init(DeckModel[] decks, CommonDeckSwitchHandler handler, KeyControl keyController, bool otherEnabled)
 {
     decks = (from x in decks
              where !x.HasBling()
              select x).ToArray();
     base.Init(UserInterfaceRemodelManager.instance.mRemodelManager, decks, handler, keyController, otherEnabled, SingletonMonoBehaviour <AppInformation> .Instance.CurrentDeck, 25);
 }
示例#2
0
 private void OnDestroy()
 {
     this.OnCallDestroy();
     this.handler               = null;
     this.templateSprite        = null;
     this.switchableIconSprites = null;
     this.keyController         = null;
     this.decks = null;
 }
 private void OnDestroy()
 {
     OnCallDestroy();
     handler               = null;
     templateSprite        = null;
     switchableIconSprites = null;
     keyController         = null;
     decks = null;
 }
示例#4
0
        protected void Init(ManagerBase manager, DeckModel[] srcDecks, CommonDeckSwitchHandler handler, KeyControl keyController, bool otherEnabled, int currentIdx, int horizontalIconMargin)
        {
            this.decks                = srcDecks;
            this.handler              = handler;
            this.keyController        = keyController;
            this.currentIdx           = currentIdx;
            this.otherEnabled         = otherEnabled;
            this.horizontalIconMargin = horizontalIconMargin;
            int deckCount = manager.UserInfo.DeckCount;

            this.keyControlEnable = true;
            int           num          = deckCount + ((!otherEnabled) ? 0 : 1);
            int           num2         = -(num - 1) * horizontalIconMargin / 2;
            HashSet <int> validIndices = new HashSet <int>();

            this.decks.ForEach(delegate(DeckModel e)
            {
                validIndices.Add(e.Id - 1);
            });
            if (otherEnabled)
            {
                validIndices.Add(num - 1);
            }
            for (int i = 0; i < num; i++)
            {
                GameObject gameObject = Util.Instantiate(this.templateSprite.get_gameObject(), base.get_gameObject(), false, false);
                gameObject.get_transform().localPosition(new Vector3((float)(num2 + horizontalIconMargin * i), 0f, 0f));
                UISprite component = gameObject.GetComponent <UISprite>();
                if (validIndices.Contains(i))
                {
                    this.switchableIconSprites.Add(component);
                }
                else
                {
                    component.spriteName = "pin_none";
                }
            }
            this.templateSprite.SetActive(false);
            if (!handler.IsDeckSelectable(currentIdx, this.currentDeck))
            {
                this.ProcessNext(0);
            }
            handler.OnDeckChange(this.currentDeck);
            this.RefleshIcons();
        }
示例#5
0
        public virtual void Init(ManagerBase manager, DeckModel[] decks, CommonDeckSwitchHandler handler, KeyControl keyController, bool otherEnabled, DeckModel currentDeck, int horizontalIconMargin = 50)
        {
            DeckModel[] array = Enumerable.ToArray <DeckModel>(Enumerable.Where <DeckModel>(decks, (DeckModel e) => e.MissionState == MissionStates.NONE));
            int         num   = 0;
            int         num2  = 0;

            DeckModel[] array2 = array;
            for (int i = 0; i < array2.Length; i++)
            {
                DeckModel deckModel = array2[i];
                if (deckModel.Id == currentDeck.Id)
                {
                    num2 = num;
                    break;
                }
                num++;
            }
            this.Init(manager, array, handler, keyController, otherEnabled, num2, horizontalIconMargin);
        }
        public virtual void Init(ManagerBase manager, DeckModel[] decks, CommonDeckSwitchHandler handler, KeyControl keyController, bool otherEnabled, DeckModel currentDeck, int horizontalIconMargin = 50)
        {
            DeckModel[] array = (from e in decks
                                 where e.MissionState == MissionStates.NONE
                                 select e).ToArray();
            int num  = 0;
            int num2 = 0;

            DeckModel[] array2 = array;
            foreach (DeckModel deckModel in array2)
            {
                if (deckModel.Id == currentDeck.Id)
                {
                    num2 = num;
                    break;
                }
                num++;
            }
            Init(manager, array, handler, keyController, otherEnabled, num2, horizontalIconMargin);
        }
示例#7
0
 public virtual void Init(ManagerBase manager, DeckModel[] decks, CommonDeckSwitchHandler handler, KeyControl keyController, bool otherEnabled)
 {
     this.Init(manager, decks, handler, keyController, otherEnabled, 0, 50);
 }
示例#8
0
 public void Init(DeckModel[] decks, CommonDeckSwitchHandler handler, KeyControl keyController, bool otherEnabled)
 {
     decks = Enumerable.ToArray <DeckModel>(Enumerable.Where <DeckModel>(decks, (DeckModel x) => !x.HasBling()));
     base.Init(UserInterfaceRemodelManager.instance.mRemodelManager, decks, handler, keyController, otherEnabled, SingletonMonoBehaviour <AppInformation> .Instance.CurrentDeck, 25);
 }