示例#1
0
        protected void Init()
        {
            //added 2012.6.24
            InitCollision();

            Owner = transform.parent.gameObject.GetComponent<XffectComponent>();
            if (Owner == null)
                Debug.LogError("you must set EffectLayer to be XffectComponent's child.");

            //fixed 2012.6.2. ignoring the red errors.
            if (ClientTransform == null)
            {
                Debug.LogWarning("effect layer: " + gameObject.name + " haven't assign a client transform, automaticly set to itself.");
                ClientTransform = transform;
            }
            AvailableENodes = new EffectNode[MaxENodes];
            ActiveENodes = new EffectNode[MaxENodes];
            for (int i = 0; i < MaxENodes; i++)
            {
                EffectNode n = new EffectNode(i, ClientTransform, SyncClient, this);
                List<Affector> afts = InitAffectors(n);
                n.SetAffectorList(afts);

                n.SetRenderType(RenderType);

                AvailableENodes[i] = n;
            }


            if (RenderType == 4)
            {
                RopeDatas.Init(this);
            }

            AvailableNodeCount = MaxENodes;
            emitter = new Emitter(this);

            mStopped = false;
        }