Beispiel #1
0
    void Start()
    {
        audioC = GetComponent <AudioController>();
        audioC.BgmSoundPlay(AudioController.Bgm.Title_Bgm);

        xBox = GetComponent <XBox>();
        //選択可能なステージの設定
        choiceOkStage = (int)GameController.clearNumber;
    }
Beispiel #2
0
    void Awake()
    {
        audioC = GetComponent <AudioController>();
        bilder = GetComponent <Builder>();
        //ステージの取得
        stage = Resources.Load <GameObject>("StagePrefab/" + stageNumber.ToString());
        //プレイヤーの取得
        player       = GameObject.FindGameObjectWithTag("Player");
        playerScript = player.GetComponent <PlayerMove>();
        foreach (Transform child in player.transform)
        {
            if (child.gameObject.tag == "Cable")
            {
                cable = child.gameObject.GetComponent <Cable>();
                break;
            }
        }
        //ステージの生成
        instansStage = Instantiate(stage);

        //スカイボックスをステージに合わせる
        RenderSettings.skybox = Resources.Load <Material>(SKYBOX_PATH + stageNumber.ToString());

        foreach (Transform child in instansStage.transform)
        {
            if (child.gameObject.tag == "GimmickParent")
            {
                cable.gimmickParent = child.gameObject;
            }
        }

        //ビルダーにステージ情報を送る
        bilder.stage = instansStage;
        xBox         = GetComponent <XBox>();

        //プレイヤーの初期位置の設定
        foreach (Transform child in instansStage.transform)
        {
            if (child.gameObject.tag == "StartPosition")
            {
                startPosition                = child.transform.position;
                player.transform.position    = startPosition;
                player.transform.eulerAngles = child.transform.eulerAngles;
            }
        }

        //キャンバスの取得
        canvas = GameObject.FindGameObjectWithTag("Canvas");
        foreach (Transform child in canvas.transform)
        {
            if (child.gameObject.name == "Pause")
            {
                //ポーズ画面の取得
                pauseUi = child.gameObject.GetComponent <RawImage>();
            }
            //ブラックアウト用の画像の取得
            if (child.gameObject.name == "BlackOut")
            {
                blackBack = child.gameObject.GetComponent <Image>();
            }
        }

        //ポーズ画面の取得 +1はHelp画面を入れる
        images = new Texture[Enum.GetValues(typeof(PouseMode)).Length + 1];
        for (int i = 0; i < Enum.GetValues(typeof(PouseMode)).Length; i++)
        {
            PouseMode pm = (PouseMode)i;
            images[i] = Resources.Load <Texture>(POUSE_PATH + pm.ToString());
        }
        images[images.Length - 1] = Resources.Load <Texture>("Image/Help");

        //黒から透明に
        BlackOutAlpha(false, 1f, true, Color.black, BlackOutTime);

        //ステージにあったBGMの再生
        AudioController.Bgm bgm = (AudioController.Bgm)Enum.Parse(typeof(AudioController.Bgm), stageNumber.ToString() + "_Bgm");
        audioC.BgmSoundPlay(bgm);
    }
Beispiel #3
0
 public void BgmSoundLoad(AudioController.Bgm audioClip)
 {
     audioC.BgmSoundPlay(audioClip);
 }