예제 #1
0
파일: Story.cs 프로젝트: CzarMaze/TimeHeart
 protected void lmralpha(GameObject lmr, string s1)
 {
     if (lmr.GetComponent <Image>().sprite != Resources.Load <Sprite>("Image/" + s1) as Sprite)
     {
         lmr.GetComponent <Image>().sprite = Resources.Load <Sprite>("Image/" + s1) as Sprite;
         StartCoroutine(Sumthing.view(lmr.GetComponent <CanvasGroup>(), 1, 0, 0, 0));
     }
 }
예제 #2
0
 public void Print(string t)
 {
     string[] a;
     a = t.Split(',');
     open(a[0], a[1]);
     SumVariable.keyboardopen = false;
     StartCoroutine(Sumthing.view(box, 0, 1, 0.0625, 0.005f));
     StartCoroutine(word());
     this.GetComponent <Animator>().enabled = false;
 }
예제 #3
0
파일: Story.cs 프로젝트: CzarMaze/TimeHeart
 //---------------------------------------------------------------------------------
 protected void meet(string a, string s)
 {
     open(a, s);
     button1.GetComponent <Canvas>().sortingOrder = 150;
     button2.GetComponent <Canvas>().sortingOrder = 150;
     GameObject.Find("Panel").GetComponent <Canvas>().sortingOrder   = 10;
     GameObject.Find("talkbox").GetComponent <Canvas>().sortingOrder = 1;
     SumVariable.keyboardopen = false;
     StartCoroutine(Sumthing.view(box, 0, 1, 0.0625, 0.005f));
     StartCoroutine(word());
 }
예제 #4
0
파일: Story.cs 프로젝트: CzarMaze/TimeHeart
    protected IEnumerator word()
    {
        soundmuc(talkbox, Z.getmusic());
        ploading(Z.getim("l"), Z.getim("m"), Z.getim("r"));
        n.text = Z.getname();
        s.text = "";
        if (Z.getsay(road).Substring(0, 1) == "(")
        {
            buttons.GetComponent <CanvasGroup>().alpha      = 1;
            buttonText1.GetComponent <Text>().text          = Z.getsay(1);
            buttonText2.GetComponent <Text>().text          = Z.getsay(2);
            button1.GetComponent <Canvas>().overrideSorting = true;
            button2.GetComponent <Canvas>().overrideSorting = true;
            button1.interactable = true;
            button2.interactable = true;
        }
        else
        {
            bool   colorlock  = false;
            string colorcolor = "";
            for (int i = 0; i < Z.getsay(road).Length; i++)
            {
                if (Z.getsay(road).Substring(i, 1) == "<" && !colorlock)
                {
                    colorlock  = true;
                    colorcolor = Z.getsay(road).Substring(i + 1, 15);
                    i          = i + 17;
                }
                else if (Z.getsay(road).Substring(i, 1) == "<" && colorlock)
                {
                    if (Z.getsay(road).Substring(i, 8) == "</color>")
                    {
                        i += 8;
                        if (Z.getsay(road).Length == i)
                        {
                            break;
                        }
                        colorlock = false;
                    }
                }
                if (colorlock)
                {
                    s.text += "<" + colorcolor + ">" + Z.getsay(road).Substring(i, 1) + "</color>";
                }
                else
                {
                    s.text += Z.getsay(road).Substring(i, 1);
                }

                yield return(new WaitForSeconds(0.07f));//文字顯示速度

                if (Input.GetKeyDown(KeyCode.Space) || Input.GetKey(KeyCode.Space) || Input.GetKey(KeyCode.LeftControl))
                {
                    s.text = Z.getsay(road);
                    break;
                }
            }
        }
        //-------------------------------------------------------
        while (true)
        {                                            //延遲判斷
            yield return(new WaitForSeconds(0.01f)); //延遲判斷速度

            if (Z.getsay(road).Substring(0, 1) == "(")
            {
                if (!(button1.interactable || button2.interactable))//需縮減
                {
                    buttons.GetComponent <CanvasGroup>().alpha = 0;
                    break;
                }
            }
            else
            {
                if (Input.GetKeyDown(KeyCode.Space) || Input.GetKey(KeyCode.LeftControl))              //需縮減
                {
                    break;
                }
            }
        }
        Z = Z.n();
        if (Z.getsay(road) == "" || Z.getsay(road) == null)
        {
            StartCoroutine(Sumthing.notview(box, 1, 0, 0.5, 0.07f));
            Resources.UnloadUnusedAssets();
            Invoke("endthing", 0.2f);
        }
        else if (Z.getsay(road) == "finish")
        {
            StartCoroutine(Sumthing.notview(box, 1, 0, 0.5, 0.07f));
            Resources.UnloadUnusedAssets();
            Invoke("endthing", 0.2f);
            otherthing();
        }
        else
        {
            StartCoroutine(word());
        }
        yield return(null);
    }
예제 #5
0
 public void nexts()
 {
     StartCoroutine(Sumthing.view(wx, 0, 1, 0.0625, 0.03f));
     Invoke("nexts2", 0.5f);
 }
예제 #6
0
 void delayfuntion()
 {
     StartCoroutine(Sumthing.notview(wx, 1, 0, 0.0625, 0.03f));
 }