示例#1
0
文件: Lever.cs 项目: AshnakAGQ/BDSM
 public void Interact()
 {
     if (!activated)
     {
         activated = true;
         if (animator != null)
         {
             animator.SetBool("activated", true);
         }
         if (target != null)
         {
             target.Activate();
         }
     }
     else
     {
         activated = false;
         if (animator != null)
         {
             animator.SetBool("activated", false);
         }
         if (target != null)
         {
             target.Deactivate();
         }
     }
     m_AudioPlayer.PlaySFX(sound);
 }
 public void DeactivateObject()
 {
     Active = false;
     if (_sourceAndTarget)
     {
         _activatableObject.LockSource();
     }
     else
     {
         _activatableObject.Deactivate();
     }
 }
示例#3
0
    public void OnTriggerExit2D(Collider2D collision)
    {
        if (!collision.CompareTag("Projectile"))
        {
            if (triggerCount == 1)
            {
                if (target != null)
                {
                    target.Deactivate();
                }

                if (spriteRenderer != null)
                {
                    spriteRenderer.color = Color.white;
                }
                m_AudioPlayer.PlaySFX(deactivateSfx);
            }

            --triggerCount;
        }
    }