Orb destroy itself after 15 seconds
This commit is contained in:
@@ -18,6 +18,8 @@ public class OrbStats : MonoBehaviour
|
||||
_sr = GetComponent<SpriteRenderer>();
|
||||
|
||||
transform.Translate(new Vector3(Random.Range(-0.5f, 0.5f), Random.Range(-0.5f, 0.5f)));
|
||||
|
||||
Invoke(nameof(DestroyAfterTime), 15f);
|
||||
}
|
||||
|
||||
private void Update()
|
||||
@@ -35,4 +37,9 @@ public class OrbStats : MonoBehaviour
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void DestroyAfterTime()
|
||||
{
|
||||
Destroy(gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user