Beispiel #1
0
    void FixedUpdate()
    {
        Color color = Splashes[currentSplash].color;

        if (!hitFullView)
        {
            //Debug.Log("Fading in! a[" + color.a.ToString() + "]");
            color.a += (1.5f / 255f);
            if (color.a > (252f / 255f))
            {
                hitFullView = true;
            }
        }
        else
        {
            //Debug.Log("Fading out! a[" + color.a.ToString() + "]");
            color.a -= (1.5f / 255f);
            if (color.a < (4f / 255f) && (currentSplash < Splashes.Length - 1))
            {
                currentSplash++;
                hitFullView = false;
                return;
            }
            else if (color.a < (4f / 255f) && (currentSplash == Splashes.Length - 1))
            {
                SceneEngine.PushScene(SceneEngine.Scenes.MENU);
            }
        }
        Splashes[currentSplash].color = color;
    }
Beispiel #2
0
    public void SelectLevel(int level)
    {
        GameData._instance.setPlaying(true);
        switch (level)
        {
        case 0:
            SceneEngine.PopScene();
            break;

        case 1:
            SceneEngine.PushScene(SceneEngine.Scenes.SPRING);
            break;

        case 2:
            SceneEngine.PushScene(SceneEngine.Scenes.SUMMER);
            break;

        case 3:
            SceneEngine.PushScene(SceneEngine.Scenes.FALL);
            break;

        case 4:
            SceneEngine.PushScene(SceneEngine.Scenes.WINTER);
            break;
        }
    }
Beispiel #3
0
 private void Update()
 {
     if (Input.GetKeyDown(KeyCode.Escape))
     {
         SceneEngine.PopScene();
     }
     else if (Input.anyKeyDown)
     {
         for (int i = 0; i < 5; i++)
         {
             if (Input.GetMouseButtonDown(i))
             {
                 return;
             }
         }
         if (currentSplash == Splashes.Length - 1)
         {
             SceneEngine.PushScene(SceneEngine.Scenes.MENU);
         }
         Splashes[currentSplash].color = new Color(0, 0, 0, 0);
         currentSplash++;
         hitFullView = false;
     }
 }