Пример #1
0
 private void CloseAreaSelection()
 {
     currentScreen = 0;
     hoveredMarker.Dispose();
     hoveredAreaName.Dispose();
     if (currentAreaMarker != null)
     {
         currentAreaMarker.SetActive(true);
     }
 }
Пример #2
0
 private void StopLoadingBar()
 {
     if (loadingCoroutine != null)
     {
         StopCoroutine(loadingCoroutine);
         if (rbBlackScreen != null)
         {
             rbBlackScreen.Dispose();
         }
         if (sbLoading != null)
         {
             sbLoading.Dispose();
         }
         if (sbHourglass != null)
         {
             sbHourglass.Dispose();
         }
     }
 }
Пример #3
0
        private IEnumerator PADisplayPattern()
        {
            gm.LockInput();

            keypad  = ScreenElement.BuildSprite("Keypad", Parent).SetSize(24, 24).Center().SetSprite(gm.spriteDB.jackpot_pad);
            keys[0] = ScreenElement.BuildSprite("Key Left", Parent).SetSize(8, 12).SetPosition(4, 10)
                      .SetSprite(gm.spriteDB.jackpot_keys[0]).SetTransparent(true).SetActive(false);
            keys[1] = ScreenElement.BuildSprite("Key Right", Parent).SetSize(8, 12).SetPosition(20, 10)
                      .SetSprite(gm.spriteDB.jackpot_keys[1]).SetTransparent(true).SetActive(false);
            keys[2] = ScreenElement.BuildSprite("Key Up", Parent).SetSize(12, 8).SetPosition(10, 4)
                      .SetSprite(gm.spriteDB.jackpot_keys[2]).SetTransparent(true).SetActive(false);
            keys[3] = ScreenElement.BuildSprite("Key Down", Parent).SetSize(12, 8).SetPosition(10, 20)
                      .SetSprite(gm.spriteDB.jackpot_keys[3]).SetTransparent(true).SetActive(false);

            SpriteBuilder hourglass = ScreenElement.BuildSprite("Hourglass", Parent).SetSprite(gm.spriteDB.hourglass);

            yield return(new WaitForSeconds(0.75f));

            hourglass.Dispose();

            for (int i = 0; i < pattern.Length; i++)
            {
                audioMgr.PlaySound(audioMgr.beepLow);
                keys[pattern[i]].SetActive(true);
                yield return(new WaitForSeconds(delay));

                keys[pattern[i]].SetActive(false);
            }

            //Black screen:
            RectangleBuilder rbBlackScreen = ScreenElement.BuildRectangle("BlackScreen0", Parent).SetSize(32, 32);
            SpriteBuilder    sbLoading     = ScreenElement.BuildSprite("Loading", Parent).SetSprite(gm.spriteDB.loading).PlaceOutside(Direction.Up);

            for (int i = 0; i < 64; i++)
            {
                sbLoading.Move(Direction.Down);
                yield return(new WaitForSeconds((delay * 2f) / 64));
            }
            rbBlackScreen.Dispose();
            sbLoading.Dispose();

            //Ready the player:
            keypad.Move(Direction.Down, 4);
            keys.Move(Direction.Down, 4);
            tbTime = ScreenElement.BuildTextBox("Time", screenDisplay.transform, DFont.Small)
                     .SetText("TIME").SetSize(18, 5).SetPosition(1, 1);
            tbTimeCount = ScreenElement.BuildTextBox("TimeCount", screenDisplay.transform, DFont.Small)
                          .SetText(timeRemaining.ToString()).SetSize(10, 5).SetPosition(22, 1);
            StartCoroutine(TimeCount());

            gm.UnlockInput();
        }