Example #1
0
    void DepositFood()
    {
        if (m_FoodCollected > 0)
        {
            // Play sound
            AudioManager.PlaySound(ScoreSound, Vector3.zero);

            // Update score
            m_Score += m_FoodCollected;
            UIManager.instance.activeElements.scoreText.SetValue(m_Score);
            UIManager.instance.cachedScore += m_Score;

            // Reset collected food
            m_FoodCollected     = 0;
            collectedSeeds      = 0;
            collectedSandwiches = 0;
            UIManager.instance.ClearFoodUI();

            Spawning.RefreshSpawned();
        }
    }
Example #2
0
 void Start()
 {
     UIManager.instance.ClearFoodUI();
     Spawning.RefreshSpawned();
 }