using UnityEngine;
namespace MacGruber
{
public class PlayEditModeTrigger : MVRScript
{
public override void Init()
{
SetupAction("PlayMode", OnPlayMode);
SetupAction("EditMode", OnEditMode);
}
private void OnPlayMode()
{
SuperController.singleton.gameMode = SuperController.GameMode.Play;
}
private void OnEditMode()
{
SuperController.singleton.gameMode = SuperController.GameMode.Edit;
}
public void SetupAction(string name, JSONStorableAction.ActionCallback callback)
{
JSONStorableAction action = new JSONStorableAction(name, callback);
RegisterAction(action);
}
}
}