Organize custom scripts under Assets/Baba_yaga and merge Opsive folders to Assets root
This commit is contained in:
25
Assets/Demo/Scripts/Car/SkidTrail.cs
Normal file
25
Assets/Demo/Scripts/Car/SkidTrail.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
|
||||
namespace Opsive.UltimateCharacterController.Demo.UnityStandardAssets.Vehicles.Car
|
||||
{
|
||||
using System.Collections;
|
||||
using UnityEngine;
|
||||
|
||||
public class SkidTrail : MonoBehaviour
|
||||
{
|
||||
[SerializeField] protected float m_PersistTime;
|
||||
|
||||
private IEnumerator Start()
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
yield return null;
|
||||
|
||||
if (transform.parent.parent == null)
|
||||
{
|
||||
Destroy(gameObject, m_PersistTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user