mirror of
https://github.com/RHeavenStudioPlus/HeavenStudioPlus.git
synced 2024-11-10 11:45:09 +00:00
923dd15597
I spent about 6 hours trying to fix this one specific bug involving the move undo. Turns out all I had to do was calm down and think logically instead of typing random bullshit for a few hours until it worked. I'm tired and I thank this for ruining my sleep schedule.
34 lines
669 B
C#
34 lines
669 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
using RhythmHeavenMania.Editor.Commands;
|
|
|
|
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);
|
|
}
|
|
}
|