// シーン切り替え実行 private void Exec(string nextSceneName, ScreenControllerBase ctrl, Action didProcEnd = null) { if (m_currentCtrl != null) { m_currentCtrl.Dispose(); m_currentCtrl = null; } m_currentCtrl = ctrl; this.ChangeScene(nextSceneName, delegate() { m_currentCtrl.Init(delegate(bool bSuccess) { // 通信エラー時はスクリーンを展開せずにそのまま if (!bSuccess) { Debug.LogWarning("[ScreenChanger - Exec] Connection error."); return; } m_currentCtrl.CreateBootScreen(); if (didProcEnd != null) { didProcEnd(); } }); }); }
public static void MournActivePlayerDead(MainModel model, ScreenControllerBase self) { var i = 0; foreach (var p in model.AvailablePlayers) { if (p != model.ActivePlayer) { p.PlayerState = PlayerState.Happy; p.TargetX = model.ActivePlayer.TargetX - 2f - 0.75f * i; if (p.GameObject.transform.position.x < p.TargetX - 10f) { p.GameObject.transform.position = new Vector3(p.TargetX - 10f, p.GameObject.transform.position.y, p.GameObject.transform.position.z); } i++; } } self.StartCoroutineWithDelay(() => { if (model.ActivePlayer.PlayerState != PlayerState.Dead) { model.ActivePlayer.PlayerState = PlayerState.Dead; } }, 2f); self.StartCoroutineWithDelay(() => { foreach (var p in model.AvailablePlayers) { if (p != model.ActivePlayer) { p.PlayerState = PlayerState.Hurt; } } }, 3f); }
/// <summary> /// タイトルシーンに移動 /// </summary> public void GoToTitle(Action didProcEnd = null) { var ctrl = ScreenControllerBase.Create <TitleSController>(); ScreenChanger.SharedInstance.Exec("title", ctrl, didProcEnd); }