Exemplo n.º 1
0
    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");
            }
        }
    }
Exemplo n.º 2
0
    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();
    }
Exemplo n.º 3
0
    // 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"));
        }));
    }
Exemplo n.º 4
0
 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));
 }
Exemplo n.º 5
0
    // 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));
        }));
    }
Exemplo n.º 6
0
    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());
            });
        }
    }
Exemplo n.º 7
0
 void EndScene()
 {
     StopCoroutine(fadeIn);
     UIEffect.Fade(canvas.GetComponent <CanvasGroup>(), 0.0f, 1.0f);
     TaskManager.Delay(1.0f, () => { SceneManager.LoadScene("Prologue_name", LoadSceneMode.Single); });
 }
Exemplo n.º 8
0
 // 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);
 }
Exemplo n.º 9
0
    void Start()
    {
        canvasGroup.alpha = 0f;

        TaskManager.Delay(startTime, () => UIEffect.Fade(canvasGroup, 1f, duration));
    }
Exemplo n.º 10
0
 void Start()
 {
     TaskManager.Delay(startTime, () => UIEffect.Fade(canvasGroup, 0f, duration));
     TaskManager.Delay(startTime + duration, () => SceneManager.LoadScene(nextScene));
 }
Exemplo n.º 11
0
 // Start is called before the first frame update
 void Start()
 {
     pName.onEndEdit.AddListener(SetName);
     UIEffect.Fade(canvas.GetComponent <CanvasGroup>(), 1.0f, 1.0f);
 }