예제 #1
0
        IEnumerator CO_Show(List <EndsessionResultData> _sessionData, int _alreadyUnlockedRewards)
        {
            yield return(null);

            SetRewardsGos();

            // Show minigames
            Bar.Hide();
            Minigames.Show(_sessionData);
            yield return(new WaitForSeconds(1));

            // Show bar
            if (_alreadyUnlockedRewards > 2)
            {
                _alreadyUnlockedRewards = 2;
            }
            while (_alreadyUnlockedRewards > -1)
            {
                Bar.Achievements[_alreadyUnlockedRewards].AchieveReward(true, true);
                _alreadyUnlockedRewards--;
            }
            Bar.Show(_sessionData.Count * 3);
            //GameResultUI.I.BonesCounter.Show();
            while (!Bar.ShowTween.IsComplete())
            {
                yield return(null);
            }

            // Start filling bar and/or show Continue button
            releasedMinigamesStars = Minigames.CloneStarsToMainPanel();
            if (releasedMinigamesStars.Count > 0)
            {
                minigamesStarsToBarTween = DOTween.Sequence();
                Vector2 to = Bar.GetComponent <RectTransform>().anchoredPosition;
                for (int i = 0; i < releasedMinigamesStars.Count; ++i)
                {
                    RectTransform mgStar = releasedMinigamesStars[i];
                    minigamesStarsToBarTween.Insert(i * 0.2f, mgStar.DOAnchorPos(to, 0.3f).OnComplete(() => Bar.IncreaseBy(1)))
                    .Join(mgStar.GetComponent <Image>().DOFade(0, 0.2f).SetDelay(0.1f).SetEase(Ease.InQuad))
                    .Join(mgStar.DORotate(new Vector3(0, 0, 180), 0.3f));
                }
                yield return(new WaitForSeconds(minigamesStarsToBarTween.Duration()));
            }
            AudioManager.I.PlaySound(SfxShowContinue);
            ContinueScreen.Show(Continue, ContinueScreenMode.Button, true);
        }
예제 #2
0
        public void Hide(bool _immediate)
        {
            if (!setupDone)
            {
                return;
            }

            this.StopAllCoroutines();
            ContinueScreen.Close(true);
            if (_immediate)
            {
                showTween.Rewind();
            }
            else
            {
                showTween.PlayBackwards();
            }
        }
예제 #3
0
        void Update()
        {
            // SceneTransitioner - SPACE to show/hide
            if (Input.GetKeyDown(KeyCode.Space))
            {
                SceneTransitioner.Show(!SceneTransitioner.IsShown);
            }

            // Subtitles - T to show text, SHIFT+T to show keeper text, CTRL/CMD+T to close
            if (WidgetSubtitles.I != null)
            {
                if (Input.GetKeyDown(KeyCode.T))
                {
                    if (Input.GetKey(KeyCode.LeftControl) || Input.GetKey(KeyCode.RightControl) || Input.GetKey(KeyCode.LeftCommand) || Input.GetKey(KeyCode.RightCommand))
                    {
                        WidgetSubtitles.I.Close();
                    }
                    else
                    {
                        var testData = new Database.LocalizationData();
                        testData.Arabic = "من فضلك، حاول اصطياد البعض منها. من فضلك، حاول التقاطها.";
                        WidgetSubtitles.I.DisplaySentence(testData, 2, Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift));
                    }
                }
            }

            // Continue button - C to show, SHIFT+C to show fullscreen-button on the side
            if (WidgetSubtitles.I != null)
            {
                if (Input.GetKeyDown(KeyCode.C))
                {
                    ContinueScreenMode continueScreenMode = Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift)
//                        ? ContinueScreenMode.FullscreenBg : ContinueScreenMode.ButtonWithBgFullscreen;
                        ? ContinueScreenMode.ButtonFullscreen : ContinueScreenMode.ButtonWithBg;
                    ContinueScreen.Show(null, continueScreenMode);
                }
            }

            // Popup - P to show/hide
            if (Input.GetKeyDown(KeyCode.P))
            {
                WidgetPopupWindow.I.Show(!WidgetPopupWindow.IsShown);
            }
        }
예제 #4
0
        public void Show(List <EndsessionResultData> _sessionData, int _alreadyUnlockedRewards, bool _immediate)
        {
            ContinueScreen.Close(true);
            Hide(true);
            Setup();

            this.StopAllCoroutines();
            if (_immediate)
            {
                showTween.Complete();
            }
            else
            {
                showTween.Restart();
            }
            godraysTween.Restart();
            this.gameObject.SetActive(true);
            this.StartCoroutine(CO_Show(_sessionData, _alreadyUnlockedRewards));
        }
예제 #5
0
        public void Show(int _numStars = 0)
        {
            Setup();

            this.StopAllCoroutines();
            ContinueScreen.Close(true);
            numStars = _numStars;
            this.gameObject.SetActive(true);
            foreach (EndgameStar star in Stars)
            {
                star.Reset();
            }
            showTween.Restart();
            this.gameObject.SetActive(true);
            GameResultUI.I.BonesCounter.Show();


            // NOT NEEDED ANYMORE: bones are added only AFTER we Continue after the game
            // GameResultUI.I.BonesCounter.DecreaseBy(_numStars);
        }
예제 #6
0
    public void continueTheGame()
    {
        ContinueScreen.SetActive(false);
        GameObject p    = GameObject.FindGameObjectWithTag("Player");
        float      diff = p.transform.position.y - lazer.transform.position.y;

        if (diff < 5)
        {
            float off = p.transform.position.y - 5;
            if (off < -12)
            {
                lazer.transform.position = new Vector3(0f, -12.5f, -1.8f);
            }
            else
            {
                lazer.transform.position = new Vector3(0f, off, -1.8f);
            }
        }


        player pum = GameObject.FindObjectOfType(typeof(player)) as player;

        pum.continueGame();
    }
예제 #7
0
 public void ContinueScreen_ShowFullscreenBg()
 {
     ContinueScreen.Show(null, ContinueScreenMode.FullscreenBg);
 }
예제 #8
0
 public void ContinueScreen_ShowButtonFullscreen()
 {
     ContinueScreen.Show(null, ContinueScreenMode.ButtonFullscreen);
 }
예제 #9
0
 public void ContinueScreen_ShowButtonWithBg()
 {
     ContinueScreen.Show(null, ContinueScreenMode.ButtonWithBg);
 }
예제 #10
0
 void OnEnable()
 {
     src = target as ContinueScreen;
 }