2022-01-22 10:44:19 +00:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
|
|
|
2022-03-14 14:21:05 +00:00
|
|
|
using HeavenStudio.Editor.Commands;
|
2022-01-22 10:44:19 +00:00
|
|
|
|
|
|
|
public class TestCommand : IAction
|
|
|
|
{
|
|
|
|
private GameObject prefab;
|
|
|
|
private Vector3 pos;
|
|
|
|
|
|
|
|
private GameObject spawnedgameObj;
|
|
|
|
|
|
|
|
public TestCommand(GameObject prefab, Vector3 pos)
|
|
|
|
{
|
|
|
|
this.prefab = prefab;
|
|
|
|
this.pos = pos;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void Execute()
|
|
|
|
{
|
|
|
|
spawnedgameObj = GameObject.Instantiate(prefab, pos, Quaternion.identity);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void Redo()
|
|
|
|
{
|
|
|
|
throw new System.NotImplementedException();
|
|
|
|
}
|
|
|
|
|
|
|
|
public void Undo()
|
|
|
|
{
|
|
|
|
GameObject.Destroy(spawnedgameObj);
|
|
|
|
}
|
|
|
|
}
|