Пример #1
0
    void Start()
    {
        // プレイヤーのインスタンスを取得.
        player = GameObject.FindGameObjectWithTag("Player");

        // プレイヤーステータスのインスタンスを取得.
        playerStatus = player.GetComponent <PlayerStatus>();

        // BOSSの各パーツを取得.
        bulletMakerLeft  = GameObject.Find("BossVulcanLeft").GetComponent <BulletMaker>();
        bulletMakerRight = GameObject.Find("BossVulcanRight").GetComponent <BulletMaker>();
        laserMakerLeft   = GameObject.Find("BossLaserLeft").GetComponent <LaserMaker>();
        laserMakerRight  = GameObject.Find("BossLaserRight").GetComponent <LaserMaker>();
        shotMaker        = GameObject.Find("BossCore").GetComponent <ShotMaker>();
        enemyStatusBoss  = GetComponent <EnemyStatusBoss>();

        // アニメーションを取得.
        bossAnimation = GetComponent <Animation>();

        // 戦闘空間を取得.
        battleSpaceContoller = GameObject.FindGameObjectWithTag("BattleSpace").GetComponent <BattleSpaceController>();

        // --------------------------------------------------------------------
        // 出現位置を指定.
        // --------------------------------------------------------------------

        // まずプレイヤーの位置に.
        transform.position = player.transform.position;
        transform.rotation = Quaternion.Euler(0, 180, 0);

        // 位置を調整.
        transform.Translate(new Vector3(0f, 0f, startPositionZ));
    }
    void Start()
    {
        // 取得玩家的实例
        player = GameObject.FindGameObjectWithTag("Player");

        // 取得玩家状态的实例
        playerStatus = player.GetComponent <PlayerStatus>();

        // 取得BOSS的各个部件
        bulletMakerLeft  = GameObject.Find("BossVulcanLeft").GetComponent <BulletMaker>();
        bulletMakerRight = GameObject.Find("BossVulcanRight").GetComponent <BulletMaker>();
        laserMakerLeft   = GameObject.Find("BossLaserLeft").GetComponent <LaserMaker>();
        laserMakerRight  = GameObject.Find("BossLaserRight").GetComponent <LaserMaker>();
        shotMaker        = GameObject.Find("BossCore").GetComponent <ShotMaker>();
        enemyStatusBoss  = GetComponent <EnemyStatusBoss>();

        // 取得动画对象
        bossAnimation = GetComponent <Animation>();

        // 取得战斗空间
        battleSpaceContoller = GameObject.FindGameObjectWithTag("BattleSpace").GetComponent <BattleSpaceController>();

        // --------------------------------------------------------------------
        // 指定出现的位置
        // --------------------------------------------------------------------

        // 首先设置到玩家的位置
        transform.position = player.transform.position;
        transform.rotation = Quaternion.Euler(0, 180, 0);

        // 调整位置
        transform.Translate(new Vector3(0f, 0f, startPositionZ));
    }