private void Awake() { deliveryCount = 0; thePlayer = FindObjectOfType <PlayerController>(); pickupParent = FindObjectOfType <PickupParentScript>(); theDoor = FindObjectOfType <KioskDoor>(); whereIs = PlayerLocationState.InLobby; warpLocations = new List <GameObject>(GameObject.FindGameObjectsWithTag("PlayerWarpPoint")); kioskSolid = FindObjectOfType <KioskEntranceSolidCollider>(); kioskTrigger = FindObjectOfType <KioskEntranceTriggerCollider>(); kioskRoof = FindObjectOfType <KioskRoofScript>(); npc = FindObjectOfType <NPCScript>(); _paused = false; m_AudioSource = GetComponent <AudioSource>(); m_AudioSource.clip = delivery1; m_AudioSource.Play(); m_AudioSource.loop = true; theEagleHasLandedOnTheRoof = false; done = false; pauseMenu = FindObjectOfType <PauseMenuScript>(); dialogue = FindObjectOfType <DialogueScript>(); _inDialogue = false; dialogue.gameObject.SetActive(false); pauseMenu.gameObject.SetActive(false); }
public void PlayerHitTheKioskTriggerCollider() { whereIs = PlayerLocationState.InLobby; kioskSolid.TimeToCollide(); kioskTrigger.StopColliding(); _inDialogue = true; thePlayer.ForceMouseUnlock(); dialogue.gameObject.SetActive(true); switch (deliveryCount) { case 0: break; case 1: dialogue.StartConversation(DialogueEnum.Second); break; case 2: dialogue.StartConversation(DialogueEnum.Third); break; case 3: dialogue.StartConversation(DialogueEnum.Last); break; default: break; } }
public void PlayerHasJumped() { if (whereIs != PlayerLocationState.IsFree) { whereIs = PlayerLocationState.IsFree; kioskSolid.StopColliding(); } }
public void PlayerWalkedIntoDoor() { deliveryCount++; if (deliveryCount == 4) { theDoor.gameObject.SetActive(false); } else { pickupParent.HidePickups(thePlayer.LoseControls(deliveryCount)); thePlayer.Teleport(warpLocations[Random.Range(0, warpLocations.Count)].transform.position); switch (deliveryCount) { case 1: thePlayer.ChangeBag(BagEnum.Bag1); break; case 2: thePlayer.ChangeBag(BagEnum.Bag2); m_AudioSource.Stop(); m_AudioSource.clip = delivery2; m_AudioSource.loop = true; m_AudioSource.Play(); break; case 3: thePlayer.ChangeBag(BagEnum.Bag3); m_AudioSource.Stop(); m_AudioSource.clip = delivery3; m_AudioSource.loop = true; m_AudioSource.Play(); break; } whereIs = PlayerLocationState.IsLost; kioskTrigger.TimeToCollide(); kioskSolid.StopColliding(); } }