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); }
public void Unlock() { if (theLock != null) { theLock.Unlock(); } }
public void Remove(ILockable lockable) { if(locked) lockable.Unlock(); lockables.Remove(lockable); }
void IDisposable.Dispose() { _obj.Unlock(); }