示例#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);
            ArrayList  afts = InitAffectors(n);
            n.SetAffectorList(afts);
            if (RenderType == 0)
            {
                n.SetType(SpriteWidth, SpriteHeight, (STYPE)SpriteType, (ORIPOINT)OriPoint, SpriteUVStretch, MaxFps);
            }
            else if (RenderType == 1)
            {
                float rwidth = RibbonWidth;
                float rlen   = RibbonLen;
                if (UseRandomRibbon)
                {
                    rwidth = Random.Range(RibbonWidthMin, RibbonWidthMax);
                    rlen   = Random.Range(RibbonLenMin, RibbonLenMax);
                }
                n.SetType(FaceToObject, FaceObject, rwidth, MaxRibbonElements, rlen, ClientTransform.position + EmitPoint, StretchType, MaxFps);
            }
            else if (RenderType == 2)
            {
                n.SetType(ConeSize, ConeSegment, ConeAngle, transform.rotation * OriVelocityAxis, 0, MaxFps, UseConeAngleChange, ConeDeltaAngle);
            }
            AvailableENodes[i] = n;
        }
        AvailableNodeCount = MaxENodes;
        emitter            = new Emitter(this);
    }
示例#2
0
 protected void Init()
 {
     this.AvailableENodes = new EffectNode[this.MaxENodes];
     this.ActiveENodes    = new EffectNode[this.MaxENodes];
     for (int i = 0; i < this.MaxENodes; i++)
     {
         EffectNode node = new EffectNode(i, this.ClientTransform, this.SyncClient, this);
         ArrayList  afts = this.InitAffectors(node);
         node.SetAffectorList(afts);
         if (this.RenderType == 0)
         {
             node.SetType(this.SpriteWidth, this.SpriteHeight, (STYPE)this.SpriteType, (ORIPOINT)this.OriPoint, this.SpriteUVStretch, this.MaxFps);
         }
         else
         {
             node.SetType(this.RibbonWidth, this.MaxRibbonElements, this.RibbonLen, this.ClientTransform.position, this.StretchType, this.MaxFps);
         }
         this.AvailableENodes[i] = node;
     }
     this.AvailableNodeCount = this.MaxENodes;
     this.emitter            = new Emitter(this);
 }
示例#3
0
 protected void Init()
 {
     AvailableENodes = new EffectNode[MaxENodes];
     ActiveENodes    = new EffectNode[MaxENodes];
     for (int i = 0; i < MaxENodes; i++)
     {
         EffectNode effectNode   = new EffectNode(i, ClientTransform, SyncClient, this);
         ArrayList  affectorList = InitAffectors(effectNode);
         effectNode.SetAffectorList(affectorList);
         if (RenderType == 0)
         {
             effectNode.SetType(SpriteWidth, SpriteHeight, (STYPE)SpriteType, (ORIPOINT)OriPoint, SpriteUVStretch, MaxFps);
         }
         else
         {
             effectNode.SetType(RibbonWidth, MaxRibbonElements, RibbonLen, ClientTransform.position, StretchType, MaxFps);
         }
         AvailableENodes[i] = effectNode;
     }
     AvailableNodeCount = MaxENodes;
     emitter            = new Emitter(this);
 }
示例#4
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);
            if (RenderType == 0)
                n.SetType(SpriteWidth, SpriteHeight, (STYPE)SpriteType, (ORIPOINT)OriPoint, SpriteUVStretch, 60f);
            else if (RenderType == 1)
            {
                float rwidth = RibbonWidth;
                float rlen = RibbonLen;
                if (UseRandomRibbon)
                {
                    rwidth = Random.Range(RibbonWidthMin, RibbonWidthMax);
                    rlen = Random.Range(RibbonLenMin, RibbonLenMax);
                }
                n.SetType(FaceToObject, FaceObject, rwidth, MaxRibbonElements, rlen, ClientTransform.position + EmitPoint, StretchType, 60f);
            }
            else if (RenderType == 2)
            {
                n.SetType(ConeSize,ConeSegment,ConeAngle, transform.rotation * OriVelocityAxis,0,60f,UseConeAngleChange,ConeDeltaAngle);
            }
            else if (RenderType == 3)
            {
                Vector3 dir = Vector3.zero;
                if (OriVelocityAxis == Vector3.zero)
                {
                    OriVelocityAxis = Vector3.up;
                }

                dir = transform.rotation * OriVelocityAxis;

                n.SetType(CMesh,dir,60f);
            }

            AvailableENodes[i] = n;
        }
        AvailableNodeCount = MaxENodes;
        emitter = new Emitter(this);
    }
示例#5
0
    protected void Init()
    {
        //added 2012.6.24
        InitCollision();

        //fixed 2012.6.2. ignoring the red errors.
        if (ClientTransform == null)
        {
            Debug.LogWarning("effect layer: "+ gameObject.name + " didn'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);
            ArrayList afts = InitAffectors(n);
            n.SetAffectorList(afts);
            if (RenderType == 0)
                n.SetType(SpriteWidth, SpriteHeight, (STYPE)SpriteType, (ORIPOINT)OriPoint, SpriteUVStretch, MaxFps);
            else if (RenderType == 1)
            {
                float rwidth = RibbonWidth;
                float rlen = RibbonLen;
                if (UseRandomRibbon)
                {
                    rwidth = Random.Range(RibbonWidthMin, RibbonWidthMax);
                    rlen = Random.Range(RibbonLenMin, RibbonLenMax);
                }
                n.SetType(FaceToObject, FaceObject, rwidth, MaxRibbonElements, rlen, ClientTransform.position + EmitPoint, StretchType, MaxFps);
            }
            else if (RenderType == 2)
                n.SetType(ConeSize,ConeSegment,ConeAngle, transform.rotation * OriVelocityAxis,0,MaxFps,UseConeAngleChange,ConeDeltaAngle);
            AvailableENodes[i] = n;
        }
        AvailableNodeCount = MaxENodes;
        emitter = new Emitter(this);
    }
示例#6
0
 protected void Init()
 {
     AvailableENodes = new EffectNode[MaxENodes];
     ActiveENodes = new EffectNode[MaxENodes];
     for (int i = 0; i < MaxENodes; i++)
     {
         EffectNode n = new EffectNode(i, ClientTransform, SyncClient, this);
         ArrayList afts = InitAffectors(n);
         n.SetAffectorList(afts);
         if (RenderType == 0)
             n.SetType(SpriteWidth, SpriteHeight, (STYPE)SpriteType, (ORIPOINT)OriPoint, SpriteUVStretch, MaxFps);
         else
             n.SetType(RibbonWidth, MaxRibbonElements, RibbonLen, ClientTransform.position, StretchType, MaxFps);
         AvailableENodes[i] = n;
     }
     AvailableNodeCount = MaxENodes;
     emitter = new Emitter(this);
 }