Пример #1
0
    IEnumerator StartScreen()
    {
        yield return(new WaitForSeconds(1f));

        wardAnim.SetBool("Transition", true);
        yield return(new WaitForSeconds(3f));

        Destroy(GameObject.Find("Ward Logo"));
        peakAnim.SetBool("Transition", true);

        yield return(new WaitForSeconds(2f));

        if (ctrlNum > 0)
        {
            while (pauseButtonGroup[0].GetComponent <Text>().color.a < 1f)
            {
                Transparency.SetOpacity(pauseButtonGroup, pauseButtonGroup[0].GetComponent <Text>().color.a + 0.1f);
                yield return(new WaitForSeconds(0.05f));
            }
        }

        else
        {
            while (pauseKeyboardGroup[0].GetComponent <Text>().color.a < 1f)
            {
                Transparency.SetOpacity(pauseKeyboardGroup, pauseKeyboardGroup[0].GetComponent <Text>().color.a + 0.1f);
                yield return(new WaitForSeconds(0.05f));
            }
        }


        // Transparency.UpFade(pauseButtonGroup);

        // if (ctrlNum > 0) {
        //  print(ctrlNum);
        //  Transparency.UpFade(leftStickGroup);

        //  yield return new WaitForSeconds(1f);
        //  Transparency.UpFade(rightStickGroup);

        //  yield return new WaitForSeconds(1f);
        //  Transparency.UpFade(pauseGroup);

        //  yield return new WaitForSeconds(1f);
        //  Transparency.UpFade(startGroup);
        // }

        // else {
        //  Transparency.UpFade(asGroup);

        //  yield return new WaitForSeconds(1f);
        //  Transparency.UpFade(klGroup);

        //  yield return new WaitForSeconds(1f);
        //  Transparency.UpFade(escGroup);

        //  yield return new WaitForSeconds(1f);
        //  Transparency.UpFade(spaceGroup);
        // }
    }
Пример #2
0
    IEnumerator FadeUpWindow(int index)
    {
        float alpha = 0f;

        if (index >= textWindows.Count)
        {
            yield break;
        }

        while (alpha < 1f)
        {
            // print("TEST");
            // print(textWindows[0].transform.GetChild(0).GetComponent<Image>().color.a);
            Transparency.SetOpacity(textWindows[index], textWindows[index].transform.GetChild(0).GetComponent <Image>().color.a + 0.1f);
            alpha += 0.1f;
            yield return(new WaitForSeconds(0.01f));
        }

        textBoxCount++;

        print(textBoxCount);
        canNext = true;

        // if (textBoxCount >= 2) curtain.SwitchPausedGame();
    }
Пример #3
0
    IEnumerator Pulse()
    {
        // bool fadeStarted = false;
        Image img = GetComponent <Image>();

        while (true)
        {
            // if (!fadeStarted) {
            //  // print ()
            //  // Transparency.DownFade(imgColor);
            //  fadeStarted = !fadeStarted;
            //  // print("fade started");
            // }

            float rate = (endWidth - startWidth) / 20f;

            // rect.rect = new Vector2(rect.sizeDelta.x + 5f, rect.sizeDelta.y);
            // rect.sizeDelta = new Vector2(rect.sizeDelta.x + 1f, rect.sizeDelta.y + 1f);
            transform.localScale = new Vector3(transform.localScale.x + rate, transform.localScale.y + rate, transform.localScale.z + rate);
            Transparency.SetOpacity(gameObject, img.color.a - 0.04f);
            // print(img.color.a);
            yield return(new WaitForSeconds(0.07f));

            // if (new Vector2(rect.rect.width, rect.rect.height) == new Vector2(endWidth, endHeight)) {
            if (transform.localScale.x >= endWidth)
            {
                // rect.sizeDelta = new Vector2(startWidth, startHeight);
                transform.localScale = new Vector3(startWidth, startHeight, startHeight);
                Transparency.SetOpacity(gameObject, 0.75f);
                // fadeStarted = false;
            }
        }
    }
Пример #4
0
    IEnumerator FadeUp(GameObject go)
    {
        float alpha = 0f;

        // if (index >= textWindows.Count) yield break;

        while (alpha < 1f)
        {
            // print("TEST");
            // print(textWindows[0].transform.GetChild(0).GetComponent<Image>().color.a);
            if (go.transform.childCount > 0)
            {
                Transparency.SetOpacity(go, go.transform.GetChild(0).GetComponent <Text>().color.a + 0.1f);
            }
            else
            {
                Transparency.SetOpacity(go, go.GetComponent <Text>().color.a + 0.1f);
            }
            alpha += 0.1f;
            yield return(new WaitForSeconds(0.01f));
        }

        // textBoxCount++;

        // print(textBoxCount);
        // canNext = true;
    }
Пример #5
0
    IEnumerator FlashWarning()
    {
        float t = 4f;

        while (t > 0f)
        {
            Transparency.SetOpacity(warningSign, 1f);
            yield return(new WaitForSeconds(0.25f));

            Transparency.SetOpacity(warningSign, 0f);
            yield return(new WaitForSeconds(0.25f));

            t -= 0.5f;
        }
    }