Example #1
0
    public void endGame()
    {
        LocalStats stats = this.getStats();

        stats.save();

        SceneManager.LoadScene("MainMenu");
        pointsNum = 0;
    }
Example #2
0
    LocalStats getStats()
    {
        LocalStats stats = new LocalStats
        {
            score = pointsNum
        };

        return(stats);
    }
Example #3
0
    public static LocalStats fromStorage()
    {
        GeneralStats stats = GeneralStats.fromStorage();

        if (stats.localStats.Count == 0)
        {
            LocalStats newStats = new LocalStats {
            };
            return(newStats);
        }
        else
        {
            return(stats.localStats[0]);
        }
    }
Example #4
0
 private void OnTriggerEnter(Collider other)
 {
     Debug.Log("Potion collided with: " + other.transform.name);
     if (other.tag.Equals("Player"))
     {
         Debug.Log("shrinking");
         if (other.gameObject.GetComponent <PhotonView>().IsMine)
         {
             LocalStats.scale         = 0.5f;
             LocalStats.scaleDuration = duration;
             StatusEffectUI.AddEffect("Shrunk", duration, "purple");
             LocalStats.Scale();
         }
         StartCoroutine(respawnPotion());
     }
 }