Beispiel #1
0
        public Dragon(Battle battle, Renderer renderer, Sound sound, Player.Player player, Vector3 position, EnemyName enemyName)
            : base(battle, renderer, sound, player, position, enemyName)
        {
            hp             = 1f; //HP兼攻撃ゲージ
            basePosition   = position;
            this.position  = basePosition;
            this.enemyName = enemyName;
            StateSet(State.NORMAL);

            physics = new MovePhysics(0.015f, null, null);
            effect.Parameters["Value"].SetValue(1f);
            effect.Parameters["Red"].SetValue(1f);
        }
    public int makeAttack(AtkType a)
    {
        switch (a)
        {
        case AtkType.DownAir:
            currentAttack = Instantiate(DownAir, transform, false);
            source.PlayOneShot(DownAir.GetComponent <Attack>().attackSound, hitVolume);
            break;

        case AtkType.NeutralAir:
            currentAttack = Instantiate(NeutralAir, transform, false);
            source.PlayOneShot(NeutralAir.GetComponent <Attack>().attackSound, hitVolume);
            break;

        case AtkType.UpAir:
            currentAttack = Instantiate(UpAir, transform, false);
            source.PlayOneShot(UpAir.GetComponent <Attack>().attackSound, hitVolume);
            break;

        case AtkType.ForwardAir:
            currentAttack = Instantiate(ForwardAir, transform, false);
            source.PlayOneShot(ForwardAir.GetComponent <Attack>().attackSound, hitVolume);
            break;

        case AtkType.BackAir:
            currentAttack = Instantiate(BackAir, transform, false);
            source.PlayOneShot(BackAir.GetComponent <Attack>().attackSound, hitVolume);
            break;

        case AtkType.DownGround:
            currentAttack = Instantiate(DownGround, transform, false);
            source.PlayOneShot(DownGround.GetComponent <Attack>().attackSound, hitVolume);
            break;

        case AtkType.UpGround:
            currentAttack = Instantiate(UpGround, transform, false);
            source.PlayOneShot(UpGround.GetComponent <Attack>().attackSound, hitVolume);
            break;

        case AtkType.BackGround:
            currentAttack = Instantiate(BackGround, transform, false);
            source.PlayOneShot(BackGround.GetComponent <Attack>().attackSound, hitVolume);
            break;

        case AtkType.ForwardGround:
            currentAttack = Instantiate(ForwardGround, transform, false);
            source.PlayOneShot(ForwardGround.GetComponent <Attack>().attackSound, hitVolume);
            break;

        case AtkType.NeutralGround:
            currentAttack = Instantiate(NeutralGround, transform, false);
            source.PlayOneShot(NeutralGround.GetComponent <Attack>().attackSound, hitVolume);
            break;

        case AtkType.Finisher:
            currentAttack = Instantiate(Finisher, transform, false);
            source.PlayOneShot(Finisher.GetComponent <Attack>().attackSound, finisherVolume);
            ComboCounter c = GetComponent <ComboCounter>();
            currentAttack.GetComponent <AttackActive>().comboStrength = c.currentCombo;
            c.reset();
            break;

        default:
            print("Not implemented");
            currentAttack = Instantiate(NeutralAir, transform, false);
            break;
        }
        currentAttack.GetComponent <AttackActive>().setType(a);
        mf = currentAttack.GetComponent <MovePhysics>();
        return(currentAttack.GetComponent <AttackActive>().atkFrames);
    }