Ejemplo n.º 1
0
        protected void Awake()
        {
            Game.OnGameStartedEvent += OnGameStarted;
            Game.OnGameOverEvent    += OnGameOver;

            animatorComponent = GetComponent <Animator>();
            body    = GetComponent <Rigidbody2D>();
            rotator = GetComponent <RotateByVelocity>();

            gravityScale = body.gravityScale;

            ResetBat();
        }
Ejemplo n.º 2
0
        protected void Awake()
        {
            body             = GetComponent <Rigidbody2D>();
            animator         = GetComponent <Animator>();
            velocityRotation = GetComponent <RotateByVelocity>();

            flyUpBoolAnimParamId   = Animator.StringToHash(flyUpBoolAnimParamName);
            isAliveBoolAnimParamId = Animator.StringToHash(isAliveBoolAnimParamName);

            GameInputCapture.OnTouchDown += OnTouchDown;
            GameInputCapture.OnTouchUp   += OnTouchUp;

            GameManager.OnGameStarted += OnGameStarted;
            GameManager.OnGameReset   += OnGameReset;

            initialPosition = body.position;
            OnGameReset();
        }