Exemplo n.º 1
0
 public void StartIntroductionConversation()
 {
     // disable player movement
     playerController.GetComponent <CharacterController2D>().enabled = false;
     // choose partner
     currentPartner = introductionPartner;
     // display Conversation UI
     conversationUI.gameObject.SetActive(true);
     // halt police officers
     foreach (PoliceOfficer officer in officers)
     {
         officer.GetComponent <NavMeshAgent>().Stop();
     }
     conversing = true;
     currentConversationLine = 0;
     dialogueBox.text        = currentPartner.conversation[currentConversationLine];
     if (currentPartner.playerSpeaking[currentConversationLine])
     {
         selfBackground.gameObject.SetActive(true);
         otherBackground.gameObject.SetActive(false);
         positiveSelf.gameObject.SetActive(true);
         negativeSelf.gameObject.SetActive(false);
     }
     else
     {
         selfBackground.gameObject.SetActive(false);
         otherBackground.gameObject.SetActive(true);
         positiveSelf.gameObject.SetActive(false);
         negativeSelf.gameObject.SetActive(true);
     }
     currentConversationLine++;
 }
Exemplo n.º 2
0
    ConversationPartner GetRandomConversationPartner()
    {
        System.Random       rand = new System.Random();
        ConversationPartner ret  = remainingCharacters[rand.Next(0, remainingCharacters.Count)];

        remainingCharacters.Remove(ret);
        return(ret);
    }
Exemplo n.º 3
0
 protected override void Start()
 {
     base.Start();
     doorOpen    = false;
     animator    = GetComponent <Animator>();
     displayVerb = "Open";
     janice      = GameObject.FindGameObjectWithTag("Conversation Partner").GetComponent <ConversationPartner>();
 }//End Start
Exemplo n.º 4
0
 public void StartConversation()
 {
     // disable player movement
     playerController.GetComponent<CharacterController2D>().enabled = false;
     // choose partner
     currentPartner = GetRandomConversationPartner();
     // display Conversation UI
     conversationUI.gameObject.SetActive(true);
     // halt police officers
     foreach(PoliceOfficer officer in officers)
     {
         officer.GetComponent<NavMeshAgent>().Stop();
     }
     // set the next pick up item
     //GameObject toBeSpawned = null;
     //switch (currentPartner.secretType)
     //{
     //    case Pickup.PickupType.ADDICT:
     //        toBeSpawned = pickupTypes[0].gameObject;
     //        break;
     //    case Pickup.PickupType.CHEATER:
     //        toBeSpawned = pickupTypes[1].gameObject;
     //        break;
     //    case Pickup.PickupType.LIAR:
     //        toBeSpawned = pickupTypes[2].gameObject;
     //        break;
     //    case Pickup.PickupType.MURDERER:
     //        toBeSpawned = pickupTypes[3].gameObject;
     //        break;
     //    case Pickup.PickupType.THIEF:
     //        toBeSpawned = pickupTypes[4].gameObject;
     //        break;
     //}
     //Instantiate(toBeSpawned, pickupLocations[(5 - remainingCharacters.Count) - 1].transform.position, Quaternion.identity);
     // start conversation
     conversing = true;
     currentConversationLine = 0;
     dialogueBox.text = currentPartner.conversation[currentConversationLine];
     if (currentPartner.playerSpeaking[currentConversationLine])
     {
         selfBackground.gameObject.SetActive(true);
         otherBackground.gameObject.SetActive(false);
         positiveSelf.gameObject.SetActive (true);
         negativeSelf.gameObject.SetActive (false);
     }
     else
     {
         selfBackground.gameObject.SetActive(false);
         otherBackground.gameObject.SetActive(true);
         positiveSelf.gameObject.SetActive (false);
         negativeSelf.gameObject.SetActive(true);
     }
     currentConversationLine++;
 }
Exemplo n.º 5
0
 public void StartConversation()
 {
     // disable player movement
     playerController.GetComponent <CharacterController2D>().enabled = false;
     // choose partner
     currentPartner = GetRandomConversationPartner();
     // display Conversation UI
     conversationUI.gameObject.SetActive(true);
     // halt police officers
     foreach (PoliceOfficer officer in officers)
     {
         officer.GetComponent <NavMeshAgent>().Stop();
     }
     // set the next pick up item
     //GameObject toBeSpawned = null;
     //switch (currentPartner.secretType)
     //{
     //    case Pickup.PickupType.ADDICT:
     //        toBeSpawned = pickupTypes[0].gameObject;
     //        break;
     //    case Pickup.PickupType.CHEATER:
     //        toBeSpawned = pickupTypes[1].gameObject;
     //        break;
     //    case Pickup.PickupType.LIAR:
     //        toBeSpawned = pickupTypes[2].gameObject;
     //        break;
     //    case Pickup.PickupType.MURDERER:
     //        toBeSpawned = pickupTypes[3].gameObject;
     //        break;
     //    case Pickup.PickupType.THIEF:
     //        toBeSpawned = pickupTypes[4].gameObject;
     //        break;
     //}
     //Instantiate(toBeSpawned, pickupLocations[(5 - remainingCharacters.Count) - 1].transform.position, Quaternion.identity);
     // start conversation
     conversing = true;
     currentConversationLine = 0;
     dialogueBox.text        = currentPartner.conversation[currentConversationLine];
     if (currentPartner.playerSpeaking[currentConversationLine])
     {
         selfBackground.gameObject.SetActive(true);
         otherBackground.gameObject.SetActive(false);
         positiveSelf.gameObject.SetActive(true);
         negativeSelf.gameObject.SetActive(false);
     }
     else
     {
         selfBackground.gameObject.SetActive(false);
         otherBackground.gameObject.SetActive(true);
         positiveSelf.gameObject.SetActive(false);
         negativeSelf.gameObject.SetActive(true);
     }
     currentConversationLine++;
 }
Exemplo n.º 6
0
 public void StartIntroductionConversation()
 {
     // disable player movement
     playerController.GetComponent<CharacterController2D>().enabled = false;
     // choose partner
     currentPartner = introductionPartner;
     // display Conversation UI
     conversationUI.gameObject.SetActive(true);
     // halt police officers
     foreach(PoliceOfficer officer in officers)
     {
         officer.GetComponent<NavMeshAgent>().Stop();
     }
     conversing = true;
     currentConversationLine = 0;
     dialogueBox.text = currentPartner.conversation[currentConversationLine];
     if (currentPartner.playerSpeaking[currentConversationLine])
     {
         selfBackground.gameObject.SetActive(true);
         otherBackground.gameObject.SetActive(false);
         positiveSelf.gameObject.SetActive (true);
         negativeSelf.gameObject.SetActive (false);
     }
     else
     {
         selfBackground.gameObject.SetActive(false);
         otherBackground.gameObject.SetActive(true);
         positiveSelf.gameObject.SetActive (false);
         negativeSelf.gameObject.SetActive(true);
     }
     currentConversationLine++;
 }