Пример #1
0
        void Awake ()
        {
            actionForIdle = this.gameObject.AddComponent<ActionForIdle> ();
            actionForMoveUp = this.gameObject.AddComponent<ActionForMoveUp> ();
            actionForMoveDown = this.gameObject.AddComponent<ActionForMoveDown> ();
            actionForMoveLeft = this.gameObject.AddComponent<ActionForMoveLeft> ();
            actionForMoveRight = this.gameObject.AddComponent<ActionForMoveRight> ();

            actionForMoveUp.moveSpeed = this.moveSpeed;
            actionForMoveDown.moveSpeed = this.moveSpeed;
            actionForMoveRight.moveSpeed = this.moveSpeed;
            actionForMoveLeft.moveSpeed = this.moveSpeed;
        }
Пример #2
0
        void Awake()
        {
            actionForIdle      = this.gameObject.AddComponent <ActionForIdle> ();
            actionForMoveUp    = this.gameObject.AddComponent <ActionForMoveUp> ();
            actionForMoveDown  = this.gameObject.AddComponent <ActionForMoveDown> ();
            actionForMoveLeft  = this.gameObject.AddComponent <ActionForMoveLeft> ();
            actionForMoveRight = this.gameObject.AddComponent <ActionForMoveRight> ();

            actionForMoveUp.moveSpeed    = this.moveSpeed;
            actionForMoveDown.moveSpeed  = this.moveSpeed;
            actionForMoveRight.moveSpeed = this.moveSpeed;
            actionForMoveLeft.moveSpeed  = this.moveSpeed;
        }