Esempio n. 1
0
        public void Init(Transform trans, TankMovement move, TurretController turret, FireController fire)
        {
            mTrans        = trans;
            mMoveScript   = move;
            mTurretScript = turret;
            mFireScript   = fire;

            // 1発目の弾を発射するまでの待機時間を決めておく
            RandomSetWaitFireTime();
        }
Esempio n. 2
0
        void Start()
        {
            mMovementScript = GetComponent <TankMovement>();
            mTurretScript   = GetComponent <TurretController>();
            mFireScript     = GetComponent <FireController>();
            mHealthScript   = GetComponent <TankHealth>();

            // 敵戦車はAIコンポーネントを取得し、初期化する
            if (!mIsPlayer)
            {
                mAi = GetComponent <EnemyAi>();
                mAi.Init(GetComponent <Transform>(), mMovementScript, mTurretScript, mFireScript);
            }
        }