Exemple #1
0
        private IEnumerator MoveLeft(AnimatablePaper paper, int index)
        {
            paper.SetIsAnimating(true);

            LerpValue <Vector3> rotateToMiddle = paper.RotateToMiddle;

            while (rotateToMiddle.Continue())
            {
                paper.transform.localEulerAngles = Vector2.Lerp(rotateToMiddle.start, rotateToMiddle.end, rotateToMiddle.perc);
                yield return(null);
            }

            Audio.MusicPlayer.Instance.PlaySFXSound(Audio.SFXSound.TurningPage);
            paper.SetOrderInLayer(startSortingOrder + index);
            paper.SetIsOnBack(true);

            LerpValue <Vector3> rotateToOutside = paper.RotateToOutside;

            while (rotateToOutside.Continue())
            {
                paper.transform.localEulerAngles = Vector2.Lerp(rotateToOutside.start, rotateToOutside.end, rotateToOutside.perc);
                yield return(null);
            }

            paper.SetIsLeft(true);
            paper.SetIsAnimating(false);
        }
Exemple #2
0
        private AnimatablePaper CreateTabPaper(PaperSprite sprite, MailType mailType, int countAt, bool isTab = false)
        {
            AnimatablePaper paper = Instantiate(prefabFolderPaper, parent).GetComponent <AnimatablePaper>();

            paper.SetDisplay(sprite);
            paper.SetOrderInLayer(startSortingOrder + (papers.Length - countAt));
            paper.SetMailShowing(mailType);
            paper.SetAnimateTime(setting.GetTurnTime());
            paper.SetIsTab(isTab);
            return(paper);
        }
Exemple #3
0
        private PlacementResult GetPlacementResult(int indexOfPaper)
        {
            AnimatablePaper paper      = papers[indexOfPaper];
            bool            isStartTab = paper.IsTab && indexOfPaper == 0;

            MailType mailPlacing = placer.MailPlacing;
            MailType mailShowing = paper.MailShowing;

            if (!isStartTab && mailPlacing == mailShowing)
            {
                winEffects.SetActive(true);
                return(new PlacementResult {
                    succesfull = true, message = $"Je hebt de post juist geplaatst bij de {mailPlacing}."
                });
            }
            else
            {
                winEffects.SetActive(false);
                return(new PlacementResult {
                    succesfull = false, message = $"Je hebt de post niet bij de {mailPlacing} geplaatst."
                });
            }
        }