Exemplo n.º 1
0
        public void FixedUpdateCustom(float deltaTime)
        {
#if UNITY_EDITOR
            if (UseSubEmitters && !EditorApplication.isPlaying)
            {
                Debug.LogWarning("Effect Layer:" + gameObject.name + " has sub emitters, it can't be updated in editor mode, please play the game to see the result.");
                return;
            }
#endif

            int needToAdd = emitter.GetNodes(deltaTime);

            //if (needToAdd > 1)
            //needToAdd = 1;

            AddNodes(needToAdd);

            for (int i = 0; i < MaxENodes; i++)
            {
                EffectNode node = ActiveENodes[i];
                if (node == null)
                {
                    continue;
                }
                node.Update(deltaTime);
            }

            if (RenderType == 4)
            {
                RopeDatas.Update(deltaTime);
            }
        }
Exemplo n.º 2
0
        public override void Initialize(EffectNode node)
        {
            base.Initialize(node);

            SetUVCoord(node.LowerLeftUV, node.UVDimensions);
            SetColor(Node.Color);
            if (Simple)
            {
                //simple sprite only update once here!
                node.Update(0f);
                Transform();
            }



            if (node.Owner.SpriteType == 2)
            {
                SetRotationTo(node.Owner.SpriteXYDir);
            }
            else
            {
                //direction is synced to client rotation, except Sphere direction.
                if (node.Owner.DirType != DIRECTION_TYPE.Sphere)
                {
                    SetRotationTo(node.Owner.ClientTransform.rotation * node.OriDirection);
                }

                else
                {
                    SetRotationTo(node.OriDirection);
                }
            }
        }
Exemplo n.º 3
0
        public void Tick(float deltaTime)
        {
            mElapsedTime += deltaTime;

            if (TimeScaleEnabled)
            {
                deltaTime *= TimeScaleCurve.Evaluate(mElapsedTime);
            }

            int needToAdd = emitter.GetNodes(deltaTime);

            AddNodes(needToAdd);

            for (int i = 0; i < MaxENodes; i++)
            {
                EffectNode node = ActiveENodes[i];
                if (node == null)
                {
                    continue;
                }
                node.Update(deltaTime);
            }

//             if (RenderType == (int)ERenderType.Rope)
//                 RopeDatas.Update(deltaTime);
        }
Exemplo n.º 4
0
        public void Update(float deltaTime)
        {
            RefreshData();

            if (NodeList.Count < 2)
            {
                return;
            }
            //just use for calculating uv change.
            dummyNode.Update(deltaTime);

            //force first node to the start point
            //if (Owner.RopeFixStartPos)
            //{
            //    EffectNode firstNode = NodeList[NodeList.Count - 1];
            //    firstNode.CurWorldPos = Owner.ClientTransform.position + Owner.EmitPoint;
            //}


            ClearDeadVerts();
            UpdateVertices();
            UpdateIndices();
        }
Exemplo n.º 5
0
        public override void Initialize(EffectNode node)
        {
            base.Initialize(node);

            SetUVCoord(node.LowerLeftUV, node.UVDimensions);
            SetColor(Node.Color);
            if (Simple)
            {
                //simple sprite only update once here!
                node.Update(0f);
                Transform();
            }

            //direction is synced to client rotation, except Sphere direction.
            if (node.Owner.DirType != DIRECTION_TYPE.Sphere)
                SetRotationTo(node.Owner.ClientTransform.rotation * node.OriDirection);
            else
                SetRotationTo(node.OriDirection);
        }