Ejemplo n.º 1
0
    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");
        }
    }
Ejemplo n.º 2
0
    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>();
    }