Exemplo n.º 1
0
        private void SetActiveListItem(GameObject listItem, bool active)
        {
            UnitSkinListItem component = (UnitSkinListItem)listItem.GetComponent <UnitSkinListItem>();

            ((Selectable)component.Button).set_interactable(active);
            if (!UnityEngine.Object.op_Inequality((UnityEngine.Object)component.Lock, (UnityEngine.Object)null))
            {
                return;
            }
            component.Lock.SetActive(!active);
        }
Exemplo n.º 2
0
        protected override void Start()
        {
            base.Start();
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.ListItemTemplate, (UnityEngine.Object)null))
            {
                this.ListItemTemplate.SetActive(false);
            }
            this.mCurrentUnit = DataSource.FindDataOfClass <UnitData>(((Component)this).get_gameObject(), (UnitData)null);
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.SettingOverlay, (UnityEngine.Object)null))
            {
                this.mDecidedOverlay = this.SettingOverlay;
                this.mDecidedOverlay.get_transform().SetParent(this.SettingOverlay.get_transform().get_parent(), false);
                this.mDecidedOverlay.SetActive(false);
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.PointingOverlay, (UnityEngine.Object)null))
            {
                this.mPointingOverlay = this.PointingOverlay;
                this.mPointingOverlay.get_transform().SetParent(this.SettingOverlay.get_transform().get_parent(), false);
                this.mPointingOverlay.SetActive(false);
            }
            this.DecideButtonInteractive(false);
            ArtifactParam[] allSkins         = this.mCurrentUnit.GetAllSkins(-1);
            ArtifactParam[] selectableSkins  = this.mCurrentUnit.GetSelectableSkins(-1);
            ArtifactParam   selectedSkinData = this.mCurrentUnit.GetSelectedSkinData(-1);

            ArtifactParam[] conceptCardSkins = this.mCurrentUnit.GetEnableConceptCardSkins(-1);
            UnitData        data1            = new UnitData();

            data1.Setup(this.mCurrentUnit);
            data1.ResetJobSkinAll();
            DataSource.Bind <UnitData>(this.RemoveButton, data1);
            UnitSkinListItem component1 = (UnitSkinListItem)this.RemoveButton.GetComponent <UnitSkinListItem>();

            if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component1, (UnityEngine.Object)null))
            {
                component1.OnSelect    = new ListItemEvents.ListItemEvent(this.OnSelect);
                component1.OnSelectAll = new ListItemEvents.ListItemEvent(this.OnSelectAll);
            }
            if (selectedSkinData == null)
            {
                this.SetPointingOverLay(this.RemoveButton);
                this.SetDecidedOverlay(this.RemoveButton);
            }
            this.RemoveName.set_text(LocalizedText.Get("sys.UNITLIST_SKIN_DEFAULT_NAME", new object[1]
            {
                (object)this.mCurrentUnit.UnitParam.name
            }));
            Array.Reverse((Array)allSkins);
            ArtifactParam[] artifactParamArray = this.MergeSkinArray(allSkins, conceptCardSkins);
            ArtifactParam[] array = this.MergeSkinArray(selectableSkins, conceptCardSkins);
            for (int index = 0; index < artifactParamArray.Length; ++index)
            {
                ArtifactParam skin       = artifactParamArray[index];
                GameObject    gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.ListItemTemplate);
                gameObject.SetActive(true);
                gameObject.get_transform().SetParent(((Component)this).get_gameObject().get_transform(), false);
                DataSource.Bind <ArtifactParam>(gameObject, skin);
                bool active = true;
                if (array == null || Array.Find <ArtifactParam>(array, (Predicate <ArtifactParam>)(s => s.iname == skin.iname)) == null)
                {
                    active = false;
                }
                this.SetActiveListItem(gameObject, active);
                UnitData data2 = new UnitData();
                data2.Setup(this.mCurrentUnit);
                data2.SetJobSkin(skin.iname, this.mCurrentUnit.JobIndex, false);
                DataSource.Bind <UnitData>(gameObject, data2);
                UnitSkinListItem component2 = (UnitSkinListItem)gameObject.GetComponent <UnitSkinListItem>();
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component2, (UnityEngine.Object)null))
                {
                    component2.OnSelect    = new ListItemEvents.ListItemEvent(this.OnSelect);
                    component2.OnSelectAll = new ListItemEvents.ListItemEvent(this.OnSelectAll);
                    if (selectedSkinData != null && skin.iname == selectedSkinData.iname)
                    {
                        this.SetPointingOverLay(gameObject);
                        this.SetDecidedOverlay(gameObject);
                    }
                }
                this.mSkins.Add(gameObject);
            }
        }
Exemplo n.º 3
0
        protected override void Start()
        {
            base.Start();
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.ListItemTemplate, (UnityEngine.Object)null))
            {
                this.ListItemTemplate.SetActive(false);
            }
            this.mCurrentUnit = DataSource.FindDataOfClass <UnitData>(((Component)this).get_gameObject(), (UnitData)null);
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.SettingOverlay, (UnityEngine.Object)null))
            {
                this.mDecidedOverlay = this.SettingOverlay;
                this.mDecidedOverlay.get_transform().SetParent(this.SettingOverlay.get_transform().get_parent(), false);
                this.mDecidedOverlay.SetActive(false);
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.PointingOverlay, (UnityEngine.Object)null))
            {
                this.mPointingOverlay = this.PointingOverlay;
                this.mPointingOverlay.get_transform().SetParent(this.SettingOverlay.get_transform().get_parent(), false);
                this.mPointingOverlay.SetActive(false);
            }
            this.DecideButtonInteractive(false);
            ArtifactParam[] allSkins         = this.mCurrentUnit.GetAllSkins(-1);
            ArtifactParam[] selectableSkins  = this.mCurrentUnit.GetSelectableSkins(-1);
            ArtifactParam   selectedSkinData = this.mCurrentUnit.GetSelectedSkinData(-1);
            UnitData        data1            = new UnitData();

            data1.Setup(this.mCurrentUnit);
            data1.ResetJobSkinAll();
            DataSource.Bind <UnitData>(this.RemoveButton, data1);
            UnitSkinListItem component1 = (UnitSkinListItem)this.RemoveButton.GetComponent <UnitSkinListItem>();

            if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component1, (UnityEngine.Object)null))
            {
                component1.OnSelect    = new ListItemEvents.ListItemEvent(this.OnSelect);
                component1.OnSelectAll = new ListItemEvents.ListItemEvent(this.OnSelectAll);
            }
            if (selectedSkinData == null)
            {
                this.SetPointingOverLay(this.RemoveButton);
                this.SetDecidedOverlay(this.RemoveButton);
            }
            this.RemoveName.set_text(LocalizedText.Get("sys.UNITLIST_SKIN_DEFAULT_NAME", new object[1]
            {
                (object)this.mCurrentUnit.UnitParam.name
            }));
            Array.Reverse((Array)allSkins);
            for (int index = 0; index < allSkins.Length; ++index)
            {
                // ISSUE: object of a compiler-generated type is created
                // ISSUE: variable of a compiler-generated type
                UnitSkinSelectWindow.\u003CStart\u003Ec__AnonStorey3A0 startCAnonStorey3A0 = new UnitSkinSelectWindow.\u003CStart\u003Ec__AnonStorey3A0();
                // ISSUE: reference to a compiler-generated field
                startCAnonStorey3A0.skin = allSkins[index];
                GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.ListItemTemplate);
                gameObject.SetActive(true);
                gameObject.get_transform().SetParent(((Component)this).get_gameObject().get_transform(), false);
                // ISSUE: reference to a compiler-generated field
                DataSource.Bind <ArtifactParam>(gameObject, startCAnonStorey3A0.skin);
                bool active = true;
                // ISSUE: reference to a compiler-generated method
                if (selectableSkins == null || Array.Find <ArtifactParam>(selectableSkins, new Predicate <ArtifactParam>(startCAnonStorey3A0.\u003C\u003Em__46C)) == null)
                {
                    active = false;
                }
                this.SetActiveListItem(gameObject, active);
                UnitData data2 = new UnitData();
                data2.Setup(this.mCurrentUnit);
                // ISSUE: reference to a compiler-generated field
                data2.SetJobSkin(startCAnonStorey3A0.skin.iname, this.mCurrentUnit.JobIndex);
                DataSource.Bind <UnitData>(gameObject, data2);
                UnitSkinListItem component2 = (UnitSkinListItem)gameObject.GetComponent <UnitSkinListItem>();
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component2, (UnityEngine.Object)null))
                {
                    component2.OnSelect    = new ListItemEvents.ListItemEvent(this.OnSelect);
                    component2.OnSelectAll = new ListItemEvents.ListItemEvent(this.OnSelectAll);
                    // ISSUE: reference to a compiler-generated field
                    if (selectedSkinData != null && startCAnonStorey3A0.skin.iname == selectedSkinData.iname)
                    {
                        this.SetPointingOverLay(gameObject);
                        this.SetDecidedOverlay(gameObject);
                    }
                }
                this.mSkins.Add(gameObject);
            }
        }