示例#1
0
        private void OnEvent_ToolTip()
        {
            if (Object.op_Inequality((Object)this.m_ToolTip, (Object)null))
            {
                return;
            }
            SerializeValueList currentValue = FlowNode_ButtonEvent.currentValue as SerializeValueList;

            if (currentValue == null)
            {
                return;
            }
            UnitData dataSource = currentValue.GetDataSource <UnitData>("_self");

            if (dataSource == null || string.IsNullOrEmpty(this.ToolTipPrefab))
            {
                return;
            }
            GameObject root = (GameObject)Object.Instantiate <GameObject>((M0)AssetManager.Load <GameObject>(this.ToolTipPrefab));

            DataSource.Bind <UnitData>(root, dataSource);
            UnitJobDropdown componentInChildren1 = (UnitJobDropdown)root.GetComponentInChildren <UnitJobDropdown>();

            if (Object.op_Inequality((Object)componentInChildren1, (Object)null))
            {
                ((Component)componentInChildren1).get_gameObject().SetActive(true);
                Selectable component1 = (Selectable)((Component)componentInChildren1).get_gameObject().GetComponent <Selectable>();
                if (Object.op_Inequality((Object)component1, (Object)null))
                {
                    component1.set_interactable(false);
                }
                Image component2 = (Image)((Component)componentInChildren1).get_gameObject().GetComponent <Image>();
                if (Object.op_Inequality((Object)component2, (Object)null))
                {
                    ((Graphic)component2).set_color(new Color(0.5f, 0.5f, 0.5f));
                }
            }
            ArtifactSlots componentInChildren2 = (ArtifactSlots)root.GetComponentInChildren <ArtifactSlots>();
            AbilitySlots  componentInChildren3 = (AbilitySlots)root.GetComponentInChildren <AbilitySlots>();

            if (Object.op_Inequality((Object)componentInChildren2, (Object)null) && Object.op_Inequality((Object)componentInChildren3, (Object)null))
            {
                componentInChildren2.Refresh(false);
                componentInChildren3.Refresh(false);
            }
            ConceptCardSlots componentInChildren4 = (ConceptCardSlots)root.GetComponentInChildren <ConceptCardSlots>();

            if (Object.op_Inequality((Object)componentInChildren4, (Object)null))
            {
                componentInChildren4.Refresh(false);
            }
            GameParameter.UpdateAll(root);
            this.m_ToolTip = root;
        }
示例#2
0
        private void BindData(GameObject go, UnitData unitData)
        {
            PlayerPartyTypes dataOfClass = DataSource.FindDataOfClass <PlayerPartyTypes>(go, PlayerPartyTypes.Max);

            DataSource.Bind <UnitData>(go, unitData);
            DataSource.Bind <PlayerPartyTypes>(go, dataOfClass);
            UnitJobDropdown componentInChildren1 = (UnitJobDropdown)go.GetComponentInChildren <UnitJobDropdown>();

            if (Object.op_Inequality((Object)componentInChildren1, (Object)null))
            {
                bool flag = (unitData.TempFlags & UnitData.TemporaryFlags.AllowJobChange) != (UnitData.TemporaryFlags) 0 && this.AllowJobChange && dataOfClass != PlayerPartyTypes.Max;
                ((Component)componentInChildren1).get_gameObject().SetActive(true);
                componentInChildren1.UpdateValue = (UnitJobDropdown.ParentObjectEvent)null;
                Selectable component1 = (Selectable)((Component)componentInChildren1).get_gameObject().GetComponent <Selectable>();
                if (Object.op_Inequality((Object)component1, (Object)null))
                {
                    component1.set_interactable(flag);
                }
                Image component2 = (Image)((Component)componentInChildren1).get_gameObject().GetComponent <Image>();
                if (Object.op_Inequality((Object)component2, (Object)null))
                {
                    ((Graphic)component2).set_color(!flag ? new Color(0.5f, 0.5f, 0.5f) : Color.get_white());
                }
            }
            ArtifactSlots componentInChildren2 = (ArtifactSlots)go.GetComponentInChildren <ArtifactSlots>();
            AbilitySlots  componentInChildren3 = (AbilitySlots)go.GetComponentInChildren <AbilitySlots>();

            if (Object.op_Inequality((Object)componentInChildren2, (Object)null) && Object.op_Inequality((Object)componentInChildren3, (Object)null))
            {
                bool enable = (unitData.TempFlags & UnitData.TemporaryFlags.AllowJobChange) != (UnitData.TemporaryFlags) 0 && this.AllowJobChange && dataOfClass != PlayerPartyTypes.Max;
                componentInChildren2.Refresh(enable);
                componentInChildren3.Refresh(enable);
            }
            ConceptCardSlots componentInChildren4 = (ConceptCardSlots)go.GetComponentInChildren <ConceptCardSlots>();

            if (!Object.op_Inequality((Object)componentInChildren4, (Object)null))
            {
                return;
            }
            bool enable1 = (unitData.TempFlags & UnitData.TemporaryFlags.AllowJobChange) != (UnitData.TemporaryFlags) 0 && this.AllowJobChange && dataOfClass != PlayerPartyTypes.Max;

            componentInChildren4.Refresh(enable1);
        }