private void OnTriggerEnter(Collider other)
 {
     if (other.CompareTag("Potato"))
     {
         pingScript.Disabled();
         pingScript.enabled = false;
         particle           = Instantiate(particleR, transform.position, Quaternion.identity);
         audioSource.Play();
         SetIsActivated(true);
     }
 }
Ejemplo n.º 2
0
    void Update()
    {
        if (hasUsedButton && !isActivated)
        {
            if (isOnButton)
            {
                Move(1);
            }
            else if (isOffButton)
            {
                Move(-1);
            }
        }

        if (isActivated && pingScript.enabled)
        {
            pingScript.Disabled();
            pingScript.enabled = false;
        }
        else if (!isActivated && !pingScript.enabled)
        {
            pingScript.enabled = true;
        }
    }