Пример #1
0
 public void CalculateScore(JewellerPiece.piece anchorType, JewellerPiece.piece jewelleryType)
 {
     if (anchorType == jewelleryType)
     {
         //Debug.Log("scored it");
         var curScore = scoreValue.GetValue();
         var total    = totalScore.GetValue();
         totalScore.SetValue(curScore + total);
         //scoreText.text = totalScore.GetValue().ToString();
         //add feadback for player here
         if (!_isDisabled)
         {
             feedbacks.GiveFeedback();
         }
     }
     noOfJewelleryPieces--;
     if (noOfJewelleryPieces <= 0)
     {
         _isComplete = true;
     }
     else
     {
         _isComplete = false;
     }
 }
Пример #2
0
        public void AddScore()
        {
            float score = 100 * scoreMultiplier.GetValue();

            totalScore.ApplyChange(score);
            currentScore.ApplyChange(score);
        }
Пример #3
0
 public void CalculateScore(JewellerPiece.piece anchorType, JewellerPiece.piece jewelleryType)
 {
     //if(anchorProperty.GetAnchorType() == anchorProperty.GetCurrentSelectedPiece())
     if (anchorType == jewelleryType)
     {
         //Debug.Log("scored it");
         var curScore = scoreValue.GetValue();
         var total    = totalScore.GetValue();
         totalScore.SetValue(curScore + total);
         //scoreText.text = totalScore.GetValue().ToString();
         //add feadback for player here
         if (!_isDisabled)
         {
             feedbacks.GiveFeedback();
         }
     }
     noOfJewelleryPieces--;
     if (noOfJewelleryPieces <= 0)
     {
         //Debug.Log("jewellery complete");
         undoButton.SetActive(false);
         _isComplete = true;
     }
     else
     {
         //Debug.Log("jewellery incomplete");
         _isComplete = false;
     }
 }
Пример #4
0
        public void UpdateUI()
        {
            float sizeMultiplier = 0.0f;

            this.scoreText.text = currentScore.GetValue().ToString();

            sizeMultiplier = currentScore.GetValue() / 5000;
            if (sizeMultiplier > 1.0f)
            {
                sizeMultiplier = 1.0f;
            }

            anim.SetFloat("SizeMultiplier", sizeMultiplier);

            anim.Play("Change Blend Tree");
            anim.SetBool("HasChanged", true);
        }
Пример #5
0
    private IEnumerator TriggerAttackAnimation()
    {
        animator.SetFloat("attackDirection", playerDirection.GetValue());
        animator.SetBool("isAttacking", true);
        yield return(null);

        animator.SetBool("isAttacking", false);
    }
Пример #6
0
 private void Update()
 {
     // Checking if the simulation speed has not been updated
     if (_simSpeed != _simulationSpeed.GetValue())
     {
         _simulationSpeed.SetValue(_simSpeed);
     }
 }
Пример #7
0
    public void CalculateReward(FloatVariable score)
    {
        var totalRewardValue = _levelManager.GetCurrentLevel().totalReward;
        var accurecyPoints   = score.GetValue();
        var calculatedReward = Mathf.RoundToInt(totalRewardValue * accurecyPoints / 100);

        _totalCash     += calculatedReward;
        rewardText.text = "+" + calculatedReward.ToString();
    }
Пример #8
0
    private void Update()
    {
        if (Image == null || Variable == null || Min == null || Max == null)
        {
            return;
        }

        Image.fillAmount = Mathf.Clamp01(
            Mathf.InverseLerp(Min.GetValue(), Max.GetValue(), Variable.GetValue()));
    }
Пример #9
0
    private void Update()
    {
        var accuracy = score.GetValue();

        meter.fillAmount = accuracy / 100f;
        if (accuracyText)
        {
            accuracyText.text = accuracy.ToString("00") + "%";
        }
        //Debug.Log(meter.fillAmount);
    }
Пример #10
0
        public void CheckRecord()
        {
            int newScore = Mathf.RoundToInt(score.GetValue());

            //Iterate through all current scores
            for (int i = 0; i < scores.Count; i++)
            {
                if (newScore > scores[i])
                {
                    SaveScores(i, newScore);
                    break;
                }
            }
        }
Пример #11
0
        public void AddScore()
        {
            int width  = group.width;
            int height = group.height;

            float scorePerBlock = 0;
            float score;

            if (width <= height)
            {
                scorePerBlock = WidthMultiplier();
            }
            else if (width > height)
            {
                scorePerBlock = HeightMultiplier();
            }

            score = (scorePerBlock * width * height) * scoreMultiplier.GetValue();

            this.totalScore.ApplyChange(score);
            this.currentScore.ApplyChange(score);
        }
 private bool hasChangedDirection()
 {
     return(lastPlayerDirection != playerDirection.GetValue());
 }
Пример #13
0
 public void UpdateUI()
 {
     scoreText.text = score.GetValue().ToString();
 }
Пример #14
0
 private void Start()
 {
     this.scoreText.text = score.GetValue().ToString();
 }