Пример #1
0
        private void RenewElaryStopNode(ElaryStopNode nod)
        {
            int count = nod.ElaryStopObj.Count;

            for (int i = 0; i < count; i++)
            {
                SetObjEnabled(nod.ElaryStopObj[i], nod.ElaryStopObjType[i], true);
            }
        }
Пример #2
0
        private void DisabledElaryStopNode(ElaryStopNode nod)
        {
            int count = nod.ElaryStopObj.Count;

            for (int i = 0; i < count; i++)
            {
                SetObjEnabled(nod.ElaryStopObj[i], nod.ElaryStopObjType[i], false);
            }
        }
Пример #3
0
        private void Init()
        {
            if (bInit)
            {
                return;
            }

            //添加进去,不添加就不会起作用
            SupportTypes.Add(ParticleSystem_Type);
            SupportTypes.Add(Animator_Type);
            SupportTypes.Add(MeshRenderer_Type);
            //SupportTypes.Add(Effect_SmokePlume_Type);
            //SupportTypes.Add(Effect_SmokeTrail_Type);
            //SupportTypes.Add(Effect_Trail_Type);
            //SupportTypes.Add(Effect_WeaponTrail_Type);
            //SupportTypes.Add(Effect_WeaponTrail_Simplest_Type);

            foreach (Transform trans in DisableTransform)
            {
                if (!trans)
                {
                    continue;
                }
                List <ElaryStopNode> list      = new List <ElaryStopNode>();
                ElaryStopNode        elaryNode = default(ElaryStopNode);

                elaryNode.ElaryStopObj     = new List <UnityEngine.Object>();
                elaryNode.ElaryStopObjType = new List <Type>();

                bool bParentRoot = true;
                foreach (Type t in SupportTypes)
                {
                    Component c = trans.GetComponent(t);
                    if (c)//如果都没有这些组件,那么,直接设置Active!
                    {
                        elaryNode.ElaryStopObj.Add(c);
                        elaryNode.ElaryStopObjType.Add(t);
                        bParentRoot = false;
                    }
                }

                if (!bParentRoot)
                {
                    ElaryStopMap.Add(trans, elaryNode);
                    RenewElaryStopNode(elaryNode);
                }
                else
                {
                    trans.gameObject.SetActive(true);
                }
            }
            bInit = true;
        }