void InitEndingList() { endingList = new List <Ending>(); List <Type> assemblyTypeList = new List <Type>(GetType().Assembly.GetTypes()); assemblyTypeList = assemblyTypeList.FindAll((Type t) => { return(t.BaseType == typeof(Ending)); }); foreach (Type type in assemblyTypeList) { Ending instance = ScriptableObject.CreateInstance(type) as Ending; endingList.Add(instance); } foreach (Ending ending in endingList) { GameObject content = GameObject.Find(ending.GetType().Name); if (ending.CheckPossibility()) { Button button = content.GetComponent <Button>(); button.interactable = true; button.onClick.AddListener(() => { UIEffect.Fade(canvasGroup, 0f, 1f); TaskManager.Delay(1f, () => ending.LoadEnding()); }); content.GetComponent <Image>().sprite = Resources.Load <Sprite>("Ending/Image/el_unlockListItem"); } } }
IEnumerator ShowContents(Action onEndContents) { canvasGroup.alpha = 0f; for (int i = 0; i < contents.Length; i++) { float loopStartTime = Time.time; InitContent(i); Coroutine fadeIn = UIEffect.Fade(canvasGroup, 1f, 1f); Coroutine showEachChar = TaskManager.Delay(1f, () => { textComponent.text = contents[i]; UIEffect.ShowEachChar(textComponent, showCharInterval); }); yield return(new WaitUntil(() => Input.GetKeyDown(KeyCode.Space) && Time.time - loopStartTime > 1f)); StopCoroutine(fadeIn); StopCoroutine(showEachChar); if (i != contents.Length - 1 && images[GetImageIdx(i)] != images[GetImageIdx(i + 1)]) { UIEffect.Fade(canvasGroup, 0f, 1f); yield return(new WaitForSeconds(1f)); } } onEndContents(); }
// Start is called before the first frame update void Start() { contents = textComponent.text.Split('|'); StartCoroutine(ShowContents(() => { UIEffect.Fade(canvasGroup, 0f, 1f); TaskManager.Delay(1f, () => SceneManager.LoadScene("Intro")); })); }
void SetName(string name) { if (name.Length == 0 || !Input.GetKey(KeyCode.Return)) { return; } CharacterManager.Get_instance().playerName = name; UIEffect.Fade(canvas.GetComponent <CanvasGroup>(), 0f, 1.0f); TaskManager.Delay(1.0f, () => SceneManager.LoadScene("Prologue_birthday", LoadSceneMode.Single)); }
// Start is called before the first frame update void Start() { next_btn.onClick.AddListener(btn_click); contents = textComponent.text.Split('|'); StartCoroutine(ShowContents(() => { UIEffect.Fade(canvasGroup, 0f, 1f); TaskManager.Delay(1f, () => SceneManager.LoadScene(nextScene)); })); }
void UpdateEndingList() { foreach (Ending ending in endingList) { GameObject content = GameObject.Find(ending.GetType().Name); content.GetComponent <Button>().onClick.AddListener(() => { if (!ending.CheckPossibility()) { return; } UIEffect.Fade(canvasGroup, 0f, 1f); TaskManager.Delay(1f, () => ending.LoadEnding()); }); } }
void EndScene() { StopCoroutine(fadeIn); UIEffect.Fade(canvas.GetComponent <CanvasGroup>(), 0.0f, 1.0f); TaskManager.Delay(1.0f, () => { SceneManager.LoadScene("Prologue_name", LoadSceneMode.Single); }); }
// Start is called before the first frame update void Start() { genderM.onClick.AddListener(SetGenderM); genderF.onClick.AddListener(SetGenderF); fadeIn = UIEffect.Fade(canvas.GetComponent <CanvasGroup>(), 1.0f, 1.0f); }
void Start() { canvasGroup.alpha = 0f; TaskManager.Delay(startTime, () => UIEffect.Fade(canvasGroup, 1f, duration)); }
void Start() { TaskManager.Delay(startTime, () => UIEffect.Fade(canvasGroup, 0f, duration)); TaskManager.Delay(startTime + duration, () => SceneManager.LoadScene(nextScene)); }
// Start is called before the first frame update void Start() { pName.onEndEdit.AddListener(SetName); UIEffect.Fade(canvas.GetComponent <CanvasGroup>(), 1.0f, 1.0f); }