public override void Execute(GameObject obj, bool log) { base.Execute(obj, log); CommandRewinder rewinder = GameManager.GM.rewinder; if (rewinder) { rewinder.Rewind(); } else { Debug.Log(MessageText.managerError + "Command Rewinder not found"); } }
void Awake() { // Singleton Pattern if (GM == null) { DontDestroyOnLoad(GM); GM = this; } else if (GM != this) { Destroy(gameObject); } // References keyBinds = GetComponent <KeyBindings>(); inputHandler = GetComponent <InputHandler>(); cmdLog = GetComponent <CommandLog>(); replayer = GetComponent <CommandReplayer>(); rewinder = GetComponent <CommandRewinder>(); }