コード例 #1
0
 //Check the Distance between two Vectors
 private bool CheckDistance()
 {
     //if(Vector2.Distance(paintHead, playerHead) < distanceToCheck)
     if (playerUpPivot.position.y > pivotUp.position.y)
     {
         //Win Conditions here
         //Check if the player Win the Last CheckPoint
         if (lastPaintPail == true)
         {
             GameManager.instance.inLastCheckPoint = true;
         }
         OnGameOver?.Invoke(false);
         if (inCheckMode == true)
         {
             OnScoreIncrease?.Invoke(true, 1);
             inCheckMode = false;
         }
         return(true);
     }
     else
     {
         //Lose Conditions here
         OnGameOver?.Invoke(true);
         if (inCheckMode == true)
         {
             OnScoreIncrease?.Invoke(false, 0);
             inCheckMode = false;
         }
         return(false);
     }
 }
コード例 #2
0
    public async void AttemptWriteScore(Inventory inventory)
    {
        Score currentScore = inventory.ToScore();

        ScoreEntity scoreEntity = new ScoreEntity(SystemInfo.deviceUniqueIdentifier, SystemInfo.deviceName);

        scoreEntity.FromScore(currentScore);

        if (currentScore > maxScore)
        {
            Task <ScoreEntity> write = WriteScore(scoresTable, scoreEntity);

            UpdateLocalTable(scoreEntity);
            if (machineToNameMap.ContainsKey(SystemInfo.deviceName))
            {
                OnScoreIncrease?.Invoke();
            }

            await write;
        }
    }
コード例 #3
0
 public void IncreaseScore(int _value)
 {
     value += _value;
     OnScoreIncrease?.Invoke(this.value);
 }
コード例 #4
0
 public void AddNewAppleScore()
 {
     OnScoreIncrease?.Invoke(scoreIncrease: scorePerApple);
 }
コード例 #5
0
 public void AddNewKnifeScore()
 {
     OnScoreIncrease?.Invoke(scoreIncrease: scorePerKnife);
 }
コード例 #6
0
 public void IncreaseScore(int score) => OnScoreIncrease?.Invoke(score);