Files
WhiteMan_Unity2D/Assets/Hovl Studio/HSFiles/Scripts/HS_CallBackParent.cs

22 lines
585 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class HS_CallBackParent : MonoBehaviour
{
[SerializeField]protected Transform parentObject;
//Particle system must have "Stop action - Callback" enabled for normal work.
protected virtual void OnParticleSystemStopped()
{
if (parentObject != null)
{
transform.parent = parentObject;
transform.localPosition = Vector3.zero;
transform.localEulerAngles = Vector3.zero;
}
else
Destroy(gameObject);
}
}