private IEnumerator InitDependency2() { yield return(new WaitForSeconds(0.1f)); ActManager.Instance().Init(); StartStory(); }
private void StartAct() { if (CurrentAct != null) { CurrentAct.GameObject.SetActive(false); } CurrentAct = ActManager.Instance().GetActObject( ActManager.Instance().GetActDict().ElementAt(ActIndex).Key ); Acts.Add(CurrentAct); CurrentAct.InitAct(OnActEnd); ContinueStory(); }
private void OnActEnd() { ActIndex++; if (ActIndex >= ActManager.Instance().GetActDict().Count) { return; } if (_tStyle == TStyle.None) { StartAct(); } else { Overlay.Transition(OverlayTransition.Complete, 1f, () => { StartAct(); }); } _tStyle = TStyle.None; }
void StartStory() { Acts = new List <IAct>(); if (string.IsNullOrWhiteSpace(StartAtAct)) { StartAtAct = ActManager.Instance().GetActDict().ElementAt(0).Key; ActIndex = 0; } else { if (UsefullUtils.IsDigitsOnly(StartAtAct)) { ActIndex = System.Convert.ToInt32(StartAtAct); StartAtAct = ActManager.Instance().GetActDict().ElementAt(ActIndex).Key; } else { ActIndex = System.Array.IndexOf(ActManager.Instance().GetActDict().Keys.ToArray(), StartAtAct); } } Debug.Log(ActIndex); StartAct(); }