コード例 #1
0
    IEnumerator AttackCoroutine()
    {
        enemy.isSuperArmor = true;
        if (G20_GameManager.GetInstance().gameState != G20_GameState.INGAME)
        {
            //Debug.Log("インゲーム状態を抜けたのでAIを終了");
            yield break;
        }
        //Debug.Log("攻撃中");
        animPlayer.PlayAnimation(G20_AnimType.Attack);

        //なげるアニメーションの実行
        yield return(new WaitForSeconds(attacktime / enemy.Speed));

        //アニメーション終了と同時に爆弾の親変更と爆弾の動く処理実行

        if (!enemy.IsLife || !bomb)
        {
            yield break;
        }

        bomb.Bombthrow(attackRange, enemy.Attack);
        bomb.transform.parent = enemy.transform.parent;
        bomb = null;
    }