Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions Packages/Xft/XWeaponTrail.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@

public class XWeaponTrail : MonoBehaviour
{
public float Fps = 60f;
private float fps = 60f;
private float deltaTime;
public int Granularity = 60;
public int MaxFrame = 14;
public int MaxFrame;
protected float mElapsedTime;
protected float mFadeElapsedime;
protected float mFadeT = 1f;
Expand All @@ -30,7 +31,6 @@ public class XWeaponTrail : MonoBehaviour

public void Activate()
{
this.MaxFrame = 14;
this.Init();
if (this.mMeshObj == null)
{
Expand Down Expand Up @@ -73,6 +73,7 @@ public void Init()
{
if (!this.mInited)
{
this.MaxFrame = 60;
Vector3 vector = this.PointStart.position - this.PointEnd.position;
this.mTrailWidth = vector.magnitude;
this.InitMeshObj();
Expand Down Expand Up @@ -178,6 +179,9 @@ public void update()
{
if (this.mInited)
{
deltaTime += (Time.deltaTime - deltaTime) * 0.1f;
this.fps = 1.0f / deltaTime;

if (this.mMeshObj == null)
{
this.InitMeshObj();
Expand Down Expand Up @@ -296,7 +300,7 @@ public float UpdateInterval
{
get
{
return (1f / this.Fps);
return (1f / this.fps);
}
}

Expand Down