Пример #1
0
        private IEnumerator MoveTowardsPlacementWithResult(PlacementResult result)
        {
            LerpValue<Vector3> move = new LerpValue<Vector3>(paperToPlace.transform.position, placement.transform.position, placeTime, LerpSettings.Cosine);
            LerpValue<Vector3> popdown = new LerpValue<Vector3>(paperToPlace.transform.localScale, Vector3.one, placeTime);
            while (move.Continue() && popdown.Continue())
            {
                paperToPlace.transform.position = Vector3.Lerp(move.start, move.end, move.perc);
                paperToPlace.transform.localScale = Vector3.Lerp(popdown.start, popdown.end, popdown.perc);
                yield return null;
            }

            OnPlacement(result);
        }
Пример #2
0
        private void OnPlacement(PlacementResult result)
        {
            feedbackObject.SetActive(true);
            txtHeader.text = result.succesfull ? succesHead : failHead;
            txtMessage.text = result.message;

            MusicPlayer.Instance.PlaySFXSound(result.succesfull ? SFXSound.MinigameCorrect : SFXSound.MinigameFailed);

            if (animator.Setting.MinigameMode)
            {
                //set difficulty played as completed
                animator.Setting.SetCurrentDifficultyCompleted();

                //add reward according to minigame difficulty if the player succeded the game
                if (result.succesfull) rewardCollection.AddRewardThroughDifficulty(rewardName, setting.Difficulty);
            }
            else
            {
                //if not in minigame mode update properties
                mailProperty.OrdenMail(MailPlacing);

                //Add bronze reward since in normal mode
                rewardCollection.AddReward(rewardName, RewardType.Bronze);

                if (result.succesfull)
                {
                    happiness.AddValue(happinessOnSucces);
                }

                //mark game as available in minigame mode
                animator.Setting.SetIsCompletedInStoryMode();

                // and update quests
                if (createbankAccountQuest.IsUpdatable)
                {
                    DoOnceTask orderMailTask = createbankAccountQuest.GetTask<DoOnceTask>("BankPostOrdering");
                    orderMailTask.SetDoneOnce();
                    PlayerPropertyManager.Instance.GetProperty<DigiDProperty>("DigiD").UpdateAccountValue(true, false);
                }
            }
        }
Пример #3
0
 private void OnAnimatorFinish(PlacementResult result)
 {
     StartCoroutine(MoveTowardsPlacementWithResult(result));
 }