public void OnMouseUp() { if (SinkInteractable.isInteractable() == true) { CanStatus.StopAdd(); } }
public void OnMouseDown() { if (SinkInteractable.isInteractable() == true) { CanStatus.Add(); } }
public IEnumerator filling() { while (staticAmount < capacity && adding == true && SinkInteractable.isInteractable() == true) { yield return(new WaitForSeconds(fillSpeed)); staticAmount++; soundPrevent = 0; } }
// Update is called once per frame void Update() { amount = staticAmount; //Turn sink water on and off animator.SetBool("sinkOn", adding); if (adding == true && gate == 0 && SinkInteractable.isInteractable() == true) { StartCoroutine("filling"); gate++; } if (soundPrevent == 0 && amount == 0) { cantWater.Play(); soundPrevent++; } }
void Update() { if (hover == true && SinkInteractable.isInteractable() == true) { SpriteRenderer sprite = GetComponent <SpriteRenderer>(); if (sprite != null) { sprite.color = highlightColor; } } else { SpriteRenderer sprite = GetComponent <SpriteRenderer>(); if (sprite != null) { sprite.color = standard; } } }