コード例 #1
0
 private void OnTriggerExit(Collider other)
 {
     if (other.gameObject.CompareTag("Ball"))
     {
         linked_object.Deactivate();
     }
 }
コード例 #2
0
 public void OnTriggerExit2D(Collider2D other)
 {
     if (other.tag == "Character" || other.tag == "Box")
     {
         Debug.Log("Plate depressured");
         activatable.Deactivate();
     }
 }
コード例 #3
0
 public void Deactivate()
 {
     if (!bonusActivator && objectToActivate)
     {
         objectToActivate.Deactivate();
     }
     activated             = false;
     spriteRenderer.sprite = deactivatedSprite;
 }
コード例 #4
0
 private void OnTriggerExit2D(Collider2D collision)
 {
     if (collision.tag == "Player")
     {
         activatable.Deactivate();
         if (destroyAfterUse)
         {
             Destroy(gameObject);
         }
     }
 }
コード例 #5
0
    public void PowerDownReceptor()
    {
        if (_activationCount == 0)
        {
            return;
        }

        _activationCount--;

        if (_activationCount == 0 && inactiveMaterialsArray != null)
        {
            _activating = true;
            activatable.Deactivate();
            audioSource.PlayOneShot(deactivatedClip);
            mesh.materials = inactiveMaterialsArray;
        }
    }
コード例 #6
0
    void Update()
    {
        if (isOnArea)
        {
            if (Input.GetKeyDown(KeyCode.E))
            {
                if (!toggle)
                {
                    activatable.Activate();
                    click.Play();
                }
                else
                {
                    activatable.Deactivate();
                    click.Play();
                    Debug.Log("Deactivate lever");
                }

                toggle = !toggle;
            }
        }
    }