예제 #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;
        }
    }