예제 #1
0
        //EnemyAnimationManagerに移植したソースコード。念のためコメントアウトにとどめる

        /*
         * void InitParam()
         * {
         *   for (int i = 0; i < epm.closeAttacks.Count; i++)
         *   {
         *       c_attacks[i].attackanim = null;
         *       c_attacks[i].attackpower = 0;
         *       c_attacks[i].attackstrength = 0;
         *       c_attacks[i].intervaltime = 0;
         *       //c_attacks[i].colliders = null;
         *       //ゲームオブジェクトのプレハブを取得すると、なぜかvector3.distanceで返したプレイヤーと敵との距離の値が不正に書き換えられる
         *   }
         *
         *
         *
         *   for (int j = 0; j < epm.behindAttacks.Count; j++)
         *   {
         *       b_attacks[j].attackanim = null;
         *       b_attacks[j].attackpower = 0;
         *       b_attacks[j].attackstrength = 0;
         *       b_attacks[j].intervaltime = 0;
         *       //b_attacks[j].colliders = null;
         *   }
         *
         *
         *
         *   for (int k = 0; k < epm.runtoAttacks.Count; k++)
         *   {
         *       r_attacks[k].attackanim = null;
         *       r_attacks[k].attackpower = 0;
         *       r_attacks[k].attackstrength = 0;
         *       r_attacks[k].intervaltime = 0;
         *       //r_attacks[k].colliders = null;
         *   }
         *
         *
         *   gp.parried = null;
         * }
         *
         * //参照されたEnemyAttackParamManagerの情報を、こちらに書き込む
         *
         * void InitAttackparams(EnemyParamTable param)
         * {
         *
         *   for (int i = 0; i < param.closeAttacks.Count; i++)
         *   {
         *       c_attacks[i].attackanim = param.closeAttacks[i].attackanim;
         *       c_attacks[i].attackpower = param.closeAttacks[i].attackpower;
         *       c_attacks[i].attackstrength = param.closeAttacks[i].attackstrength;
         *       c_attacks[i].intervaltime = param.closeAttacks[i].intervaltime;
         *
         *       //c_attacks[i].colliders = param.closeAttacks[i].colliders;
         *       //ゲームオブジェクトのプレハブを取得すると、なぜかvector3.distanceで返したプレイヤーと敵との距離の値が不正に書き換えられる
         *   }
         *
         *
         *
         *   for(int j =0;j<epm.behindAttacks.Count; j++)
         *   {
         *       b_attacks[j].attackanim = param.behindAttacks[j].attackanim;
         *       b_attacks[j].attackpower = param.behindAttacks[j].attackpower;
         *       b_attacks[j].attackstrength = param.behindAttacks[j].attackstrength;
         *       b_attacks[j].intervaltime = param.behindAttacks[j].intervaltime;
         *       //b_attacks[j].colliders = param.behindAttacks[j].colliders;
         *   }
         *
         *
         *
         *   for(int k = 0; k < epm.runtoAttacks.Count; k++)
         *   {
         *       r_attacks[k].attackanim = param.runtoAttacks[k].attackanim;
         *       r_attacks[k].attackpower = param.runtoAttacks[k].attackpower;
         *       r_attacks[k].attackstrength = param.runtoAttacks[k].attackstrength;
         *       r_attacks[k].intervaltime = param.runtoAttacks[k].intervaltime;
         *       //r_attacks[k].colliders = param.runtoAttack[k].colliders;
         *   }
         *
         *
         *   gp.parried = param.getParried.parried;
         *
         * }
         */

        /*
         * //攻撃モーションに応じて、コライダー、攻撃力、攻撃強度を各"WeaponHook"ゲームオブジェクトにアタッチされた"weaponhook"に格納する
         * GameObject[] cattacks = GameObject.FindGameObjectsWithTag("EnemyWeaponHook_Close");
         * GameObject[] battacks = GameObject.FindGameObjectsWithTag("EnemyWeaponHook_Behind");
         *
         * w_a_close = new WeaponHook[cattacks.Length];
         * w_a_behind = new WeaponHook[battacks.Length];
         *
         * for(int i = 0; i < cattacks.Length; i++)
         * {
         * w_a_close[i] = cattacks[i].GetComponent<WeaponHook>();
         * w_a_close[i].CopyCattackColliderandAttackPowerandAttackStrength(c_attacks);
         * w_a_close[i].CloseDamageColliders();
         * }
         *
         * for(int j = 0; j < battacks.Length; j++)
         * {
         * w_a_behind[j] = battacks[j].GetComponent<WeaponHook>();
         * w_a_behind[j].CopyBattackColliderandAttackPowerandAttackStrength(b_attacks);
         * w_a_behind[j].CloseDamageColliders();
         * }
         *
         * w_a_Run= new WeaponHook[r_attacks.Length];
         * GameObject[] rattacks = GameObject.FindGameObjectsWithTag("EnemyWeaponHook_RunToAttack");
         * w_a_Run[0] = rattacks[0].GetComponent<WeaponHook>();
         * w_a_Run[0].CopyRattackColliderandAttackPowerandAttackStrength(r_attacks);
         * w_a_Run[0].CloseDamageColliders();
         *
         */

        void Start()
        {
            time   = 5f;
            states = GetComponent <EnemyStateManager>();
            //states.Init();
            ea_hook = GetComponent <EnemyAnimationHook>();
            ea_hook.Init();

            /*
             * em = GetComponent<EnemyAnimationManager>();
             * em.Initalize1st();
             */


            float homingtime = 0f;

            homingurgency = (homingurgency == 0) ? 1 : homingurgency;
            homingtime    = -homingurgency;
        }
예제 #2
0
 // Use this for initialization
 void Start()
 {
     esm = transform.root.GetComponent <EnemyStateManager>();
 }
예제 #3
0
 public void Init()
 {
     ai  = GetComponent <AIManager>();
     est = GetComponent <EnemyStateManager>();
     ParriedCol.SetActive(false);
 }