Ejemplo n.º 1
0
        bool CheckLockStatus()
        {
            bool retVal = false;

            if (isLocked == true && inventory.HasItem(unlockItemId) == false)
            {
                gui.SetPopUpText(lockedMessage);
                if (lockedSound != null)
                {
                    PlayDoorSound(lockedSound);
                }
                retVal = true;
            }
            else if (isLocked == true && inventory.HasItem(unlockItemId) == true)
            {
                isLocked = false;
                if (destroyItemOnUnlock == true)
                {
                    inventory.DestroyItem(unlockItemId);
                }
            }
            return(retVal);
        }
Ejemplo n.º 2
0
    IEnumerator CheckIfHoldingFlashlight()
    {
        yield return(new WaitForSeconds(0.1f));

        if (inventoryManager.HasItem(flashlightId) == false)
        {
            this.gameObject.GetComponent <Light> ().enabled = false;
            this.GetComponent <AudioSource> ().clip         = flashlightOffSound;
            if (overrideAudioSource == null)
            {
                this.GetComponent <AudioSource> ().Play();
            }
            else
            {
                overrideAudioSource.Play();
            }
        }
    }
Ejemplo n.º 3
0
 public void LoadTargetLevel()
 {
     if (locked == true && invManager.HasItem(itemId))
     {
         Unlock();
     }
     else if (locked == false)
     {
         string desc = loadingDesc[Random.Range(0, loadingDesc.Length)];
         tranManager.LoadTargetLevel(sceneIndexOrNameToLoad, objectNameToTravelTo, loadingMusic, audioVolume, loadingTitle, desc, loadImage);
     }
     else
     {
         if (lockSound != null && unlockSoundSource != null)
         {
             unlockSoundSource.clip = lockSound;
             unlockSoundSource.Play();
         }
         guiManager.SetPopUpText(lockedMessage);
     }
 }