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); } } }
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; }
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 }
private void Awake() { if (_master == null) { _master = this; _source = GetComponent <AudioSource>(); DontDestroyOnLoad(this); } else { Destroy(gameObject); } }
public void Toggle() { SoundMaster.Play(SoundMaster.Type.Menu); if (_isOpen) { _isOpen = false; animator.SetBool("clicked", false); } else { _isOpen = true; animator.SetBool("clicked", true); } }
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); } }
public void ClosePressed() { SoundMaster.Play(SoundMaster.Type.Menu); SceneManager.LoadScene(StartMenu); }
public void ContinuePressed() { SoundMaster.Play(SoundMaster.Type.Menu); Save.Load(); SceneManager.LoadScene(PlayScene); }
public void NewGamePressed() { SoundMaster.Play(SoundMaster.Type.Menu); Save.Reset(); SceneManager.LoadScene(PlayScene); }