Exemple #1
0
 public void OnMouseUp()
 {
     if (SinkInteractable.isInteractable() == true)
     {
         CanStatus.StopAdd();
     }
 }
Exemple #2
0
 public void OnMouseDown()
 {
     if (SinkInteractable.isInteractable() == true)
     {
         CanStatus.Add();
     }
 }
Exemple #3
0
    public IEnumerator filling()
    {
        while (staticAmount < capacity && adding == true && SinkInteractable.isInteractable() == true)
        {
            yield return(new WaitForSeconds(fillSpeed));

            staticAmount++;
            soundPrevent = 0;
        }
    }
Exemple #4
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++;
        }
    }
Exemple #5
0
 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;
         }
     }
 }