Ejemplo n.º 1
0
    public void FireBall()
    {
        GameObject      fireBallAbility = poolManager.GetGameObject("FireBallAbility");
        FireBallAbility a = fireBallAbility.GetComponent <FireBallAbility>();

        a.SetThrower(gameObject);
        a.SetStartPosition(transform.position);

        flyingDirection.x = transform.localScale.x;
        a.SetDirection(flyingDirection);
        a.SetTargetLayerName("Player");
        a.SetDamage(2);

        movementComponent.enemyAnim.SetBool("firing", false);
        //rb.bodyType = RigidbodyType2D.Dynamic;
    }
Ejemplo n.º 2
0
    //疲劳状态
    //public void Tired()
    //{
    //    movementComponent.enemyAnim.SetInteger("skillType", 3);
    //}

    public void FireBall()
    {
        cameraTransform.DOShakeRotation(0.5f, new Vector3(1f, 2f, 0));

        for (int i = 0; i < 8; i++)
        {
            GameObject      fireBallAbility = poolManager.GetGameObject("FireBallAbility");
            FireBallAbility a = fireBallAbility.GetComponent <FireBallAbility>();
            a.SetThrower(gameObject);
            a.SetStartPosition(flyingFromDirection);
            flyingFromDirection.x += 2f;
            a.SetDirection(Vector3.down);
            a.SetTargetLayerName("Player");
            a.SetDamage(2);
        }
        flyingFromDirection.x = movementComponent.originx - 7f;
    }
Ejemplo n.º 3
0
    public override void ReleaseSpell()
    {
        GameObject      fireBallAbility = poolManager.GetGameObject("FireBallAbility");
        FireBallAbility a = fireBallAbility.GetComponent <FireBallAbility>();

        a.SetThrower(player);
        a.SetTargetLayerName("Enemy");
        a.SetStartPosition(player.transform.position);
        a.SetMaxExistTime(0.7f);

        if (movementComponent.IsFacingLeft())
        {
            flyingDirection.x = -1;
        }
        else
        {
            flyingDirection.x = 1;
        }

        a.SetDirection(flyingDirection);
    }