Esempio n. 1
0
 private void OnMouseDown()
 {
     PlayerVisibility.Instance.Select(PlayerIndex);
     if (_hasFood)
     {
         if (Player.holding == null)
         {
             SoundMaster.Play(SoundMaster.Type.Item);
             Player.holding = FoodToProduce;
             //_hasFood = false;
         }
         else
         {
             SoundMaster.Play(SoundMaster.Type.Invalid);
         }
     }
     else
     {
         if (!_timerStarted)
         {
             StartCoroutine(Timer());
         }
         else
         {
             SoundMaster.Play(SoundMaster.Type.Invalid);
         }
     }
 }
Esempio n. 2
0
        private void OnMouseDown()
        {
            PlayerVisibility.Instance.Select(PlayerIndex);
            if (Player.holding == null)
            {
                SoundMaster.Play(SoundMaster.Type.Invalid);
                return;
            }

            Customer.gotFood = true;
            if (Player.holding == Customer.orderDish)
            {
                // todo
                Player.Money++;
                if (HappyParticles != null)
                {
                    Instantiate(HappyParticles, transform);
                }
            }
            else
            {
                if (SadParticles != null)
                {
                    Instantiate(SadParticles, transform);
                }
            }

            Player.holding = null;
        }
Esempio n. 3
0
        public void QuitPressed()
        {
            SoundMaster.Play(SoundMaster.Type.Menu);
#if UNITY_EDITOR
            UnityEditor.EditorApplication.isPlaying = false;
#elif UNITY_WEBGL
            Debug.Log("Can't just quit in web");
#else
            Application.Quit();
#endif
        }
Esempio n. 4
0
 private void Awake()
 {
     if (_master == null)
     {
         _master = this;
         _source = GetComponent <AudioSource>();
         DontDestroyOnLoad(this);
     }
     else
     {
         Destroy(gameObject);
     }
 }
Esempio n. 5
0
 public void Toggle()
 {
     SoundMaster.Play(SoundMaster.Type.Menu);
     if (_isOpen)
     {
         _isOpen = false;
         animator.SetBool("clicked", false);
     }
     else
     {
         _isOpen = true;
         animator.SetBool("clicked", true);
     }
 }
Esempio n. 6
0
 private void OnMouseDown()
 {
     PlayerVisibility.Instance.Select(PlayerIndex);
     if (Player.holding != null)
     {
         Player.holding = null;
         // todo: particles
         var sound = GetComponent <AudioSource>();
         if (sound != null)
         {
             sound.Play();
         }
     }
     else
     {
         SoundMaster.Play(SoundMaster.Type.Invalid);
     }
 }
Esempio n. 7
0
 public void ClosePressed()
 {
     SoundMaster.Play(SoundMaster.Type.Menu);
     SceneManager.LoadScene(StartMenu);
 }
Esempio n. 8
0
 public void ContinuePressed()
 {
     SoundMaster.Play(SoundMaster.Type.Menu);
     Save.Load();
     SceneManager.LoadScene(PlayScene);
 }
Esempio n. 9
0
 public void NewGamePressed()
 {
     SoundMaster.Play(SoundMaster.Type.Menu);
     Save.Reset();
     SceneManager.LoadScene(PlayScene);
 }