示例#1
0
    private IEnumerator PadlockAction()
    {
        //Set key parent
        SetKeyPosition();

        //Start animation
        mAnimator.SetTrigger(animationTriggerName);

        //Play sound
        mAudioSource.Play();

        //Wait for some time
        yield return(new WaitForSeconds(actionTime));

        //Enable physics
        mRigidbody.isKinematic = false;

        //Unlock locked object
        if (lockedObject != null)
        {
            ILockable objectToUnlock = lockedObject.GetComponent <ILockable>();
            if (objectToUnlock != null)
            {
                objectToUnlock.Unlock();
            }
        }

        //Deactivate padlock action
        mActivated = true;

        yield return(null);
    }
示例#2
0
 public void Unlock()
 {
     if (theLock != null)
     {
         theLock.Unlock();
     }
 }
            public void Remove(ILockable lockable)
            {
                if(locked)
                    lockable.Unlock();

                lockables.Remove(lockable);
            }
示例#4
0
 void IDisposable.Dispose()
 {
     _obj.Unlock();
 }