Beispiel #1
0
    public virtual void CollectContent()
    {
        if (!isCollecting)
        {
            LogUtil.Log("CollectContent:Collect", true);

            isCollecting = true;

            string gamePlayerItemCode = transform.name.Replace(" (Clone)", "");
            gamePlayerItemCode = gamePlayerItemCode.Replace("(Clone)", "");

            Debug.Log("CollectContent:" + " gamePlayerItemCode:" + gamePlayerItemCode);

            GameItem gameItem = GameItems.Instance.GetById(gamePlayerItemCode);

            if (gameItem == null)
            {
                return;
            }

            // add state for item

            GamePlayerProgress.SetStatItems(gameItem.code, 1);

            GameController.CurrentGamePlayerController.HandleItemUse(gameItem);

            //UINotificationDisplay.Instance.QueuePoint(title, description, pointValue);
            //}
        }

        RemoveContent();
    }
    public virtual void CollectContent()
    {
        if (!isCollecting)
        {
            //Debug.Log("CollectContent:Collect" + true);

            isCollecting = true;

            if (gameItem == null)
            {
                return;
            }

            // add state for item

            GamePlayerProgress.SetStatItems(gameItem.code, 1);

            GameController.CurrentGamePlayerController.HandleItemUse(gameItem);

            //Debug.Log("CollectContent:" + gameItem.ToJson());

            //UINotificationDisplay.Instance.QueuePoint(title, description, pointValue);
            //}
        }

        RemoveContent();
    }
Beispiel #3
0
    public void UpdateDisplayStateResultsData()
    {
        LogUtil.Log("UIPanelModeTypeChoice:UpdateDisplayStateResultsData");

        UIColors.UpdateColors();

        UIUtil.SetLabelValue(labelResultsStatus, "Results");

        GameAudioController.PlaySoundPlayerActionGood();

        //double timeCompleted = 30; // TODO
        double coins         = 500;
        double choiceTotal   = choices.Count;
        double choicesResult = choicesCorrect / choiceTotal;

        coins = choicesCorrect * 100;

        string scoreFractionValue   = string.Format("{0}/{1}", choicesCorrect, choiceTotal);
        string scorePercentageValue = choicesResult.ToString("P0");
        //string scoreTitleValue = ;
        //string scoreTypeValue = "4/5";
        string scoreCoinsValue = coins.ToString("N0");

        UIUtil.SetSliderValue(sliderScore, choicesResult);

        UIUtil.SetLabelValue(labelResultsScoreFractionValue, scoreFractionValue);
        UIUtil.SetLabelValue(labelResultsScorePercentageValue, scorePercentageValue);
        //UIUtil.SetLabelValue(labelResultsTitle, choiceResultValue);
        //UIUtil.SetLabelValue(labelResultsType, choiceResultType);
        UIUtil.SetLabelValue(labelResultsCoinsValue, scoreCoinsValue);

        // REWARDS

        GameProfileRPGs.Current.AddCurrency(coins);

        GamePlayerProgress.SetStatCoins(coins);
        GamePlayerProgress.SetStatCoinsEarned(coins);

        double xpEarned = coins * 2;

        GamePlayerProgress.SetStatXP(xpEarned);

        GameProfileCharacters.Current.CurrentCharacterAddGamePlayerProgressXP(xpEarned);
        GameProfileCharacters.Current.CurrentCharacterAddGamePlayerProgressEnergy(1f); // refill
        GameProfileCharacters.Current.CurrentCharacterAddGamePlayerProgressHealth(1f); // refill

        GameController.ProcessLevelStats();


        /*
         * AppContentChoice choice = GetCurrentChoice();
         *
         * if(choice != null) {
         *
         *  string choiceTitle = "Loading...";
         *  string choiceQuestion = "Loading...";
         *
         *  if(choice != null) {
         *      choiceTitle = "Question";
         *      choiceQuestion = choice.display_name + choice.code;
         *  }
         *
         *  UIUtil.SetLabelValue(labelDisplayItemTitle, choiceTitle);
         *  UIUtil.SetLabelValue(labelDisplayItemQuestion, choiceQuestion);
         * }
         */
    }