void Start() { sceneChanger = new FadeSceneChanger(gameObject); sceneChanger.sceneOpen(); this.UpdateAsObservable().Where(_ => Input.GetButtonDown("Fire1")) .Subscribe(p => sceneChanger.sceneClose()); }
IEnumerator Change(int index) { FadeImage.color = new Color(0, 0, 0, 0); LeanTween.value(gameObject, UpdateAlpha, new Color(0, 0, 0, 0), Color.black, 1); yield return(new WaitForSeconds(1)); if (LevelStartedLoading != null) { LevelStartedLoading(); } ao = SceneManager.LoadSceneAsync(index, LoadSceneMode.Single); FadeImage.color = Color.black; while (!ao.isDone) { yield return(null); } if (LevelFinishedLoading != null) { LevelFinishedLoading(); } LeanTween.value(gameObject, UpdateAlpha, Color.black, new Color(0, 0, 0, 0), 1); yield return(new WaitForSeconds(1)); instance = null; LoadingScene = false; Destroy(gameObject); }
void Start() { var events = GameObject.FindGameObjectWithTag("EventController").GetComponent <Event_Master>(); sceneChanger = new FadeSceneChanger(gameObject); sceneChanger.sceneOpen() .Subscribe(_ => { }, () => events.startEvent() .Subscribe(_ => { }, () => sceneChanger.sceneClose()).AddTo(gameObject)) .AddTo(gameObject); }
private void Start() { setup(); Debug.Log("GameController Start"); sceneChanger = new FadeSceneChanger(gameObject); GameTimeStopGraphicController gameTimeStopGraphicController = GetComponent <GameTimeStopGraphicController>(); gameTimeStopGraphicController.TimeStop(0.0f); timeStop.Subscribe(b => { if (b) { gameTimeStopGraphicController.TimeStop(1.0f); } else { gameTimeStopGraphicController.TimeStop(0.0f); } }); sceneChanger.sceneOpen(); var events = GameObject.FindGameObjectsWithTag("EventController"); foreach (var e in events) { var t = e.GetComponent <Event_Trigger>(); if (t) { t.Event.Subscribe(talk).AddTo(gameObject); } } var gate = GameObject.FindGameObjectWithTag("Finish"); gate.GetComponent <Gate>().Event.Where(b => b).First() .Subscribe(_ => StartCoroutine(GoalStage(gate))) .AddTo(gameObject); Observable.CombineLatest(talkEvent, clearEvent).Select(list => list.Any(b => b)).Subscribe(f => { freezed.Value = f; }).AddTo(gameObject); }
IEnumerator RestartLevel(float time) { yield return(new WaitForSeconds(time)); FadeSceneChanger.ChangeScene(0); }
void Start() { GameObject alice = GameObject.FindGameObjectWithTag("Alice"); stageView = GameObject.FindGameObjectWithTag("StageView").GetComponent <StageView>(); //ステージの表示 int stage = PlayerData.nowStage; stageView.showStageBack(stage); for (int i = 0; i < GameData.StageNumber[stage]; i++) { if (PlayerData.AppearStageFlag[new GameData.StageID { stage = stage, number = i + 1 }]) { stageView.showStage(stage, i + 1); } } var nextStage = PlayerData.ApperNextStage();//---------------------------------------------------------- if (!nextStage.Equals(GameData.StageID.None)) { stageView.showNewStage(nextStage.stage, nextStage.number); } //プレイヤーの移動 this.UpdateAsObservable().Where(_ => Input.GetButtonDown("Up")).Subscribe(_ => { var newstage = GameData.StageMove(new GameData.StageID { stage = PlayerData.nowStage, number = PlayerData.nowNumber }, GameData.Way.up); if (newstage.Equals(GameData.StageID.None) || !PlayerData.AppearStageFlag[newstage]) { return; } PlayerData.nowStage = newstage.stage; PlayerData.nowNumber = newstage.number; alice.transform.position = stageView.getStagePos(PlayerData.nowStage, PlayerData.nowNumber); }); this.UpdateAsObservable().Where(_ => Input.GetButtonDown("Down")).Subscribe(_ => { var newstage = GameData.StageMove(new GameData.StageID { stage = PlayerData.nowStage, number = PlayerData.nowNumber }, GameData.Way.down); if (newstage.Equals(GameData.StageID.None) || !PlayerData.AppearStageFlag[newstage]) { return; } PlayerData.nowStage = newstage.stage; PlayerData.nowNumber = newstage.number; alice.transform.position = stageView.getStagePos(PlayerData.nowStage, PlayerData.nowNumber); }); this.UpdateAsObservable().Where(_ => Input.GetButtonDown("Left")).Subscribe(_ => { var newstage = GameData.StageMove(new GameData.StageID { stage = PlayerData.nowStage, number = PlayerData.nowNumber }, GameData.Way.left); if (newstage.Equals(GameData.StageID.None) || !PlayerData.AppearStageFlag[newstage]) { return; } PlayerData.nowStage = newstage.stage; PlayerData.nowNumber = newstage.number; alice.transform.position = stageView.getStagePos(PlayerData.nowStage, PlayerData.nowNumber); }); this.UpdateAsObservable().Where(_ => Input.GetButtonDown("Right")).Subscribe(_ => { var newstage = GameData.StageMove(new GameData.StageID { stage = PlayerData.nowStage, number = PlayerData.nowNumber }, GameData.Way.right); if (newstage.Equals(GameData.StageID.None) || !PlayerData.AppearStageFlag[newstage]) { return; } PlayerData.nowStage = newstage.stage; PlayerData.nowNumber = newstage.number; alice.transform.position = stageView.getStagePos(PlayerData.nowStage, PlayerData.nowNumber); }); sceneChanger = new FadeSceneChanger(gameObject); sceneChanger.sceneOpen(); this.UpdateAsObservable().Where(_ => Input.GetButtonDown("Fire1")).Take(1).Subscribe(_ => sceneChanger.sceneClose(PlayerData.GoScene(new GameData.StageID { stage = PlayerData.nowStage, number = PlayerData.nowNumber })) ); }