Esempio n. 1
0
 void Start()
 {
     // keyboard command functions
     W            = new MoveFront();
     S            = new MoveBack();
     A            = new MoveLeft();
     D            = new MoveRight();
     C            = new Undo();
     myObjInitPos = myObj.position;
 }
Esempio n. 2
0
        // Use this for initialization
        void Start()
        {
            buttonW = new MoveForward();
            buttonA = new MoveLeft();
            buttonS = new MoveReverse();
            buttonD = new MoveRight();
            buttonB = new DoNothing();
            buttonZ = new UndoCommand();
            buttonR = new ReplayCommand();

            boxStartPos = boxTrans.position;
        }
Esempio n. 3
0
        private void Start()
        {
            Toolbox       = Toolbox.Instance;
            status        = Toolbox.Status;
            BeginningTime = Utils.GetTimeinMilliseconds();


            //Initiate commands
            _cmdMoveForward  = new MoveForward();
            _cmdMoveBackward = new MoveBackward();
            _cmdMoveLeft     = new MoveLeft();
            _cmdMoveRight    = new MoveRight();
            //_cmdReplay = new Replay();
            _cmdJump     = new Jump();
            _cmdInteract = new Interact();

            if (!_replayOnly)
            {
                //Bind keys with commands
                _movementKeyBinds = new Dictionary <KeyCode, Command>
                {
                    { LeftKey, _cmdMoveLeft },
                    { RightKey, _cmdMoveRight },
                    { BackwardKey, _cmdMoveBackward },
                    { ForwardKey, _cmdMoveForward },
                    { JumpKey, _cmdJump }
                };

                _othersKeyBinds = new Dictionary <KeyCode, Command>
                {
                    { InteractKey, _cmdInteract }
                };
            }

            _goStartPos = gameObject.transform.position;
            _goStartDir = CurrDirection;

            myAnimator = GetComponent <Animator>();
        }