Esempio n. 1
0
    public virtual void CastLocalAttack(Vector2 startPosition, Vector2 targetPosition)
    {
        AttackController attack = GetAttack();

        attack.Initialize(this, AttackController.MoveType.Target);
        attack.SetMovement(startPosition, targetPosition, attackSpeed);
    }
Esempio n. 2
0
    public virtual void CastLocalAttack()
    {
        isAttacking = true;

        AttackController attack = GetAttack();

        attack.Initialize(this);
        attack.SetMovement(directionX, attackSpeed, transform.position);

        StartCoroutine(WaitAttacking());
        AnimateAttack();
    }
Esempio n. 3
0
    public virtual void CastLocalAttack(Vector2 startPosition)
    {
        isAttacking = true;
        int yAxis = directionY;

        AttackController attack = GetAttack();

        attack.Initialize(this, AttackController.MoveType.Direction);
        attack.SetMovement(startPosition, directionX, yAxis, attackSpeed);

        StartCoroutine(WaitAttacking());
        AnimateAttack();
    }
Esempio n. 4
0
        public void Initialize()
        {
            rb                 = GetComponent <Rigidbody2D> ();
            animator           = GetComponentInChildren <Animator> ();
            AttackController   = GetComponentInChildren <PlayerAttackController> ();
            TentacleController = GetComponentInChildren <TentacleController> ();
            groundMask         = LayerMask.GetMask(GROUND_LAYER);

            inputManager           = SingletonManager.GetSingleton <InputManager> ();
            jumpKey                = inputManager.GetKey(OctoKey.JUMP);
            tentacleKey            = inputManager.GetKey(OctoKey.TENTACLE);
            jumpKey.OnKeyDown     += Jump;
            tentacleKey.OnKeyDown += () => TentacleController.ThrowTentacle();

            AttackController.Initialize(this, inputManager);
            TentacleController.Initialize(this, inputManager);
        }