FiE-Game/Assets/Particle Playground/Extensions/Playground Trails/Playground Trail Assets/Scripts/PlaygroundTrailParent.cs

25 lines
469 B
C#

using UnityEngine;
using System.Collections;
using ParticlePlayground;
[ExecuteInEditMode()]
public class PlaygroundTrailParent : MonoBehaviour {
public PlaygroundTrails trailsReference;
private GameObject _gameObject;
void Awake () {
_gameObject = gameObject;
}
void Update () {
if (_gameObject != trailsReference.GetParentGameObject())
{
if (Application.isPlaying)
Destroy (_gameObject);
else
DestroyImmediate(_gameObject);
}
}
}