Esempio n. 1
0
 public void SaveScore(string name)
 {
     SavedScores.AddScore(new ScoreModel(name, PlayerModel.Happiness));
     saver.Save(SavedScores);
     ScreenManager.Close(ScreenType.YourScoreScreen);
     ScreenManager.Open(ScreenType.ScoreboardScreen);
 }
 public void OnPlotStateSwitch(FarmPlot.State state, FarmPlot.State previousState, FarmPlot plot)
 {
     if (state == FarmPlot.State.Decay)
     {
         Scores.SubScore(_decayPenaltyPoints);
     }
     else if (state == FarmPlot.State.Withered)
     {
         Scores.SubScore(_witherPenaltyPoints);
     }
     else if (state == FarmPlot.State.Growing)
     {
         var swarmGO = Instantiate(_swarmPrefab);
         var swarm   = swarmGO.GetComponent <Swarm>();
         swarm.Init(plot);
         swarmGO.transform.position = plot.gameObject.transform.position;
         Subscribe(swarm);
     }
     else if (state == FarmPlot.State.Grown)
     {
         if (!plot.HasBeenPoisened())
         {
             Scores.AddScore(_fullyHealthyPoints);
         }
     }
 }
Esempio n. 3
0
 private void OnTriggerEnter(Collider collision)
 {
     if (collision.tag == "Enemy")
     {
         //Debug.Log("ENEMY TRIGGER HIT");
         Scores.AddScore(1);
         Destroy(this.gameObject);
     }
 }
Esempio n. 4
0
    public void OnSubmitButtonPressed()
    {
        if (nameInput.text != "")
        {
            // Generate score
            Score score = new Score();
            score.name    = nameInput.text;
            score.catches = String.Format("{0:.##}", encounter.weight) + "kg" + " - " + encounter.fatPercentage + "% - " + (encounter.gender == Game.Gender.MALE ? "Male" : "Female");
            score.value   = encounter.CalculatePercentage();

            // Add score
            Scores scores = new Scores();
            GameController.HasNewHighscore = scores.AddScore(score);
        }
        StartCoroutine(TransitionToMain());
    }
Esempio n. 5
0
 public void AddScore(GameObject gameObject)
 {
     _scores.AddScore(gameObject);
 }
Esempio n. 6
0
    public bool RecordScore(int MemberNumber, Score score)
    {
        Scores ScoreManager = new Scores();

        return(ScoreManager.AddScore(MemberNumber, score));
    }
 public void OnBugKill(SwarmUnit unit)
 {
     Scores.AddScore(_killBugPoinst);
 }
 public void OnPlotHarvest(FarmPlot plot)
 {
     Scores.AddScore(_harvestPoints);
 }
Esempio n. 9
0
 void Death()
 {
     _score.AddScore(_scoreToGive, 1);
 }
Esempio n. 10
0
 public void OnIngredientAdd(ISubject subject, IIngredient ingredient)
 {
     Scores.AddScore(250);
 }