27 lines
699 B
C#
27 lines
699 B
C#
using System;
|
|
using System.Collections;
|
|
using UnityEngine;
|
|
|
|
namespace RR.Common.Behaviour
|
|
{
|
|
/// <summary>
|
|
/// Действие удаления игрового объекта
|
|
/// </summary>
|
|
[Serializable]
|
|
public class DeleteGameObjectAction : SequenceAction
|
|
{
|
|
[SerializeField] public GameObject targetObject;
|
|
|
|
public override IEnumerator Execute(Sequencer context, GameObject target)
|
|
{
|
|
GameObject objectToDelete = targetObject != null ? targetObject : target;
|
|
if (objectToDelete != null)
|
|
{
|
|
UnityEngine.Object.Destroy(objectToDelete);
|
|
}
|
|
yield return null;
|
|
}
|
|
}
|
|
}
|
|
|