void setupScene(bool isRestart = false) { this.isGameStart = false; this.isAlreadyView = false; this.isAlreadyCanvas = false; //ゲーム画面用ビュー GameObject view = Instantiate((GameObject)Resources.Load("Prefabs/GameSceneView")); view.transform.SetParent(this.transform); this.sceneView = view; this.sceneViewController = view.GetComponent <GameSceneViewController>(); //ゲーム画面用キャンバス GameObject canvas = Instantiate((GameObject)Resources.Load("Prefabs/GameSceneCanvas")); canvas.transform.SetParent(this.transform); this.sceneCanvas = canvas; this.SceneCanvasController = canvas.GetComponent <GameSceneCanvasController>(); //シーン開始フェード GameObject fd = Instantiate((GameObject)Resources.Load("Prefabs/Mask_first")); fd.transform.position = new Vector3(2.5f, -2.5f); //リスタート時は以下の処理を行わない if (isRestart) { return; } //ステージBGM再生 this.soundManager.addSound("stagebgm", "Sounds/bgm_Stage" + this.app.playingStageNumber); this.soundManager.playBGM("stagebgm", 2.0f); }
// Update is called once per frame void Update() { if (this.view == null) { this.view = this.transform.parent.GetComponent <GameSceneViewController>(); } if (this.isFastForward && !this.view.isEvent) { Time.timeScale = 3.0f; } else { Time.timeScale = 1.0f; } }
// Use this for initialization void Start() { //チュートリアル画面用ビュー GameObject view = Instantiate((GameObject)Resources.Load("Prefabs/TutorialSceneView")); view.transform.SetParent(this.transform); this.sceneView = view; this.sceneViewController = view.GetComponent <GameSceneViewController>(); //ゲーム画面用キャンバス GameObject canvas = Instantiate((GameObject)Resources.Load("Prefabs/TutorialSceneCanvas")); canvas.transform.SetParent(this.transform); this.sceneCanvas = canvas; this.SceneCanvasController = canvas.GetComponent <GameSceneCanvasController>(); //サウンドマネージャー取得 this.soundManager = SoundManagerController.Instance; this.soundManager.addSound("bgm_tutorial", "Sounds/bgm_tutorial"); this.soundManager.addSound("change", "Sounds/yf_cursor22"); soundManager.playBGM("bgm_tutorial", 3.0f); }
void Start() { this.view = this.transform.parent.GetComponent <GameSceneViewController>(); this.animator = this.playerSprite.GetComponent <Animator>(); }
// Use this for initialization void Start() { this.view = this.transform.parent.GetComponent <GameSceneViewController>(); }