コード例 #1
0
ファイル: Winner.cs プロジェクト: gigsabyte/LCL
    void OnTriggerEnter2D(Collider2D collision)
    {
        Debug.Log(collision.gameObject.tag);

        if (collision.gameObject.tag == "Player")
        {
            fo.Transition();
        }
    }
コード例 #2
0
    private IEnumerator ReadText()
    {
        float diagnum = 1;

        text.text  = "";
        text.color = new Color(text.color.r, text.color.g, text.color.b, 0);
        string nextline = reader.ReadLine();

        while (nextline != null)
        {
            if (nextline == "h")
            {
                yield return(new WaitForSeconds(1f * diagnum));

                while (text.color.a > 0)
                {
                    text.color = new Color(text.color.r, text.color.g,
                                           text.color.b, text.color.a - 0.1f);
                    yield return(new WaitForSeconds(0.1f));
                }
                text.color = new Color(text.color.r, text.color.g, text.color.b, 0);
                text.text  = "";
                diagnum    = 0;
                nextline   = reader.ReadLine();
            }
            else
            {
                while (nextline != null && nextline != "h")
                {
                    text.text = text.text + nextline + "\n";
                    diagnum++;
                    nextline = reader.ReadLine();
                    Debug.Log(nextline);
                    if (nextline == "h")
                    {
                        break;
                    }
                }
                if (text.color.a < 1)
                {
                    while (text.color.a < 1)
                    {
                        text.color = new Color(text.color.r, text.color.g,
                                               text.color.b, text.color.a + 0.1f);
                        yield return(new WaitForSeconds(0.1f));
                    }
                    text.color = new Color(text.color.r, text.color.g, text.color.b, 1);
                }
            }
        }
        yield return(new WaitForSeconds(1f));

        fadeout.Transition();
    }
コード例 #3
0
ファイル: FollowerManager.cs プロジェクト: gigsabyte/LCL
    public void removeFollower()
    {
        if (followers.Count == 0)
        {
            fo.Transition();
            return;
        }

        followers[followers.Count - 1].GetComponent <ParticleSystem>().Stop();

        followers[followers.Count - 1].GetComponent <FollowerKiller>().Kill();
        followers.RemoveAt(followers.Count - 1);

        if (followers.Count > 0)
        {
            followers[followers.Count - 1].GetComponent <ParticleSystem>().Play();
            sm.DimNextTrack(followers.Count);
        }
        else
        {
            gameObject.GetComponent <ParticleSystem>().Play();
        }
    }