示例#1
0
    private bool GetSkillScore(int currentLevel, BoterkroonSkills skill, out float skillScore)
    {
        float maxScore = BoterkroonScoreRequirements.GetMaxScoreFor(currentLevel).Skill(skill);
        float minScore = BoterkroonScoreRequirements.GetMinScoreFor(currentLevel).Skill(skill);

        skillScore = Mathf.Min(maxScore, GetLastScoreFor(skill));
        return(minScore <= skillScore);
    }
    private void Update()
    {
        if (showStory == false || IsDone)
        {
            return;
        }

        if (Input.GetMouseButtonDown(0))
        {
            skipWaitTime = true;
        }

        if (/*lastVisualChangeTime + 5 > Time.time &&*/ skipWaitTime == false)
        {
            return;
        }

        skipWaitTime = false;

        if (lineItterator != 0)
        {
            UpdateVisual();
        }
        else
        {
            if (introductionFinished == false)
            {
                introductionFinished = true;
                float normalizedScore = (currentResult.Score - BoterkroonScoreRequirements.GetMinScoreFor(currentLevel).Total) / (BoterkroonScoreRequirements.GetMaxScoreFor(currentLevel).Total - BoterkroonScoreRequirements.GetMinScoreFor(currentLevel).Total);

                if (normalizedScore < 0.3f)
                {
                    currentVisual = (currentVisuals.Failed);
                    UpdateVisual();
                }
                else
                {
                    currentVisual = (currentVisuals.Succeeded);
                    UpdateVisual();
                }
            }
            else
            {
                IsDone = true;
                GameEventMessage.SendEvent(uiEventStringDone);
            }
        }
    }
    public float CalculateFadeHeight(float score)
    {
        float normalizedScore  = 0;
        float heightDifference = 0;

        if (score < BoterkroonScoreRequirements.GetMinScoreFor(2).Total)
        {
            normalizedScore  = score / BoterkroonScoreRequirements.GetMinScoreFor(2).Total;
            heightDifference = bannerLvl02.GetComponent <RectTransform>().anchoredPosition.y - bannerLvl01.GetComponent <RectTransform>().anchoredPosition.y;
            return(bannerLvl01.GetComponent <RectTransform>().anchoredPosition.y + heightDifference * normalizedScore);
        }
        else if (score < BoterkroonScoreRequirements.GetMinScoreFor(3).Total)
        {
            normalizedScore  = (score - BoterkroonScoreRequirements.GetMinScoreFor(2).Total) / (BoterkroonScoreRequirements.GetMinScoreFor(3).Total - BoterkroonScoreRequirements.GetMinScoreFor(2).Total);
            heightDifference = bannerLvl03.GetComponent <RectTransform>().anchoredPosition.y - bannerLvl02.GetComponent <RectTransform>().anchoredPosition.y;
            return(bannerLvl02.GetComponent <RectTransform>().anchoredPosition.y + heightDifference * normalizedScore);
        }
        else
        {
            normalizedScore  = (score - BoterkroonScoreRequirements.GetMinScoreFor(3).Total) / (BoterkroonScoreRequirements.GetMaxScoreFor(3).Total - BoterkroonScoreRequirements.GetMinScoreFor(3).Total);
            heightDifference = bannerLvl03.GetComponent <RectTransform>().sizeDelta.y;
            return(bannerLvl03.GetComponent <RectTransform>().anchoredPosition.y + heightDifference * normalizedScore);
        }
    }