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); } }
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); } } }
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); }
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(); }
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); }