示例#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 ActivateObject()
 {
     Active = true;
     if (_sourceAndTarget)
     {
         _activatableObject.UnlockSource();
     }
     else
     {
         _activatableObject.Activate();
     }
 }
示例#3
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (!collision.CompareTag("Projectile"))
        {
            if (triggerCount == 0)
            {
                if (target != null)
                {
                    target.Activate();
                }

                if (spriteRenderer != null)
                {
                    spriteRenderer.color = Color.gray;
                }
                m_AudioPlayer.PlaySFX(activateSfx);
            }

            ++triggerCount;
        }
    }