Exemple #1
0
        public override void Initialize(FlowWindowBase.SerializeParamBase param)
        {
            base.Initialize(param);
            this.m_Param = param as UnitListFilterWindow.SerializeParam;
            if (this.m_Param == null)
            {
                throw new Exception(this.ToString() + " > Failed serializeParam null.");
            }
            SerializeValueBehaviour childComponent = this.GetChildComponent <SerializeValueBehaviour>("filter");

            this.m_ValueList = !UnityEngine.Object.op_Inequality((UnityEngine.Object)childComponent, (UnityEngine.Object)null) ? new SerializeValueList() : childComponent.list;
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_Window, (UnityEngine.Object)null) && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_Animator, (UnityEngine.Object)null))
            {
                this.CacheToggleParam(((Component)this.m_Animator).get_gameObject());
            }
            this.LoadSelectType();
            this.Close(true);
        }
        public override void Initialize(FlowWindowBase.SerializeParamBase param)
        {
            base.Initialize(param);
            this.m_Param = param as UnitListFilterWindow.SerializeParam;
            if (this.m_Param == null)
            {
                throw new Exception(this.ToString() + " > Failed serializeParam null.");
            }
            SerializeValueBehaviour childComponent = this.GetChildComponent <SerializeValueBehaviour>("filter");

            this.m_ValueList = !UnityEngine.Object.op_Inequality((UnityEngine.Object)childComponent, (UnityEngine.Object)null) ? new SerializeValueList() : childComponent.list;
            GameObject gameObject = this.m_ValueList.GetGameObject("list");

            if (UnityEngine.Object.op_Inequality((UnityEngine.Object)gameObject, (UnityEngine.Object)null))
            {
                Toggle[] componentsInChildren = (Toggle[])gameObject.GetComponentsInChildren <Toggle>();
                for (int index = 0; index < componentsInChildren.Length; ++index)
                {
                    try
                    {
                        UnitListFilterWindow.SelectType key = (UnitListFilterWindow.SelectType)Enum.Parse(typeof(UnitListFilterWindow.SelectType), ((UnityEngine.Object)componentsInChildren[index]).get_name());
                        ButtonEvent component = (ButtonEvent)((Component)componentsInChildren[index]).GetComponent <ButtonEvent>();
                        if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component, (UnityEngine.Object)null))
                        {
                            ButtonEvent.Event @event = component.GetEvent("UNITFILTER_TGL_CHANGE");
                            if (@event != null)
                            {
                                @event.valueList.SetField("select", (int)key);
                            }
                        }
                        this.m_Toggles.Add(key, componentsInChildren[index]);
                    }
                    catch (Exception ex)
                    {
                        Debug.LogError((object)("UnitSortWindow トグル名からSelectTypeを取得できない! > " + ((UnityEngine.Object)componentsInChildren[index]).get_name() + " ( Exception > " + ex.ToString() + " )"));
                    }
                }
            }
            this.LoadSelectType();
            this.Close(true);
        }