mirror of
https://github.com/FriendshipIsEpic/FiE-Game.git
synced 2024-11-27 07:47:59 +01:00
26 lines
469 B
C#
26 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);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|