示例#1
0
    void Update()
    {
        if (interactable)
        {
            if (Input.GetKeyUp("e"))
            {
                if (modalPanel.modalPanelObject.activeInHierarchy)
                {
                    modalPanel.ClosePanel();
                    GameInformation.PlayerControllable = true;

                    interactions++;
                    GameInformation.AddInteraction(this.gameObject.name, interactions);

                    SendMessage("ResetFacing");
                }
                else
                {
                    GameInformation.PlayerControllable = false;

                    SendMessage("FaceThePlayer");

                    ModalPanelDetails modalPanelDetails = new ModalPanelDetails();

                    string temp = DialogueData.LoadFromXML(dialogID);
                    modalPanelDetails.text = temp.Replace("PlayerName", GameInformation.PlayerName);

                    modalPanelDetails.title     = this.gameObject.name;
                    modalPanelDetails.iconImage = spriteRenderer.sprite;
                    modalPanel.NewChoice(modalPanelDetails);
                }
            }
        }
    }
    // Update is called once per frame
    void Update()
    {
        // This only happens when we are able to move on in the game and the empathy bar is full.
        if (NPC.GetComponent <UpdateBars>() != null && NPC.GetComponent <UpdateBars>().isEmpathyFull() && NPC.gameObject.tag != "Fie")
        {
            NextConversation = "end";
        }
        else if (NPC.GetComponent <UpdateBars>() != null && NPC.GetComponent <UpdateBars>().isEmpathyFull() && NPC.gameObject.tag == "Fie")
        {
            NextConversation = "winGame";
        }

        // We always want Fie to have the first conversation and we do not need the player to press space; we always want it to happen.
        if (!IsTalking && WithinRadius && NPC.name == "Fie Ronndly" && !player.GetComponent <PlayerInteraction>().isTalkingToNPC() && NextConversation == "AwakenInTown0")
        {
            AudioManager.Get().TriggerSoundEffect(SoundEffect.uiConfirmation);
            NPC.GetComponent <InteractionPanel>().setInteractionPanel(false);
            PlayerMovement.AllowMovement(false);
            player.GetComponent <PlayerInteraction>().setTalkingToNPC(true);
            StartTalking();
        }
        if (!IsTalking && WithinRadius && Input.GetButtonDown("Jump") && !player.GetComponent <PlayerInteraction>().isTalkingToNPC())
        {
            AudioManager.Get().TriggerSoundEffect(SoundEffect.uiConfirmation);
            NPC.GetComponent <InteractionPanel>().setInteractionPanel(false);
            PlayerMovement.AllowMovement(false);
            player.GetComponent <PlayerInteraction>().setTalkingToNPC(true);
            StartTalking();
        }
        else if (IsTalking && Input.GetKeyDown(KeyCode.C) && !DisplayingLastTextScreen)
        {
            DisplayNextTextScreen();
        }
        else if (DisplayingLastTextScreen && Input.GetKeyDown(KeyCode.C) && TextObject.choice1 == "") // Means they do not have any choices available on screen.
        {
            DisplayingLastTextScreen = false;

            if (IsConversationOver())
            {
                IsTalking = false;
                player.GetComponent <PlayerInteraction>().setTalkingToNPC(false);
                NPC.GetComponent <InteractionPanel>().setInteractionPanel(true);
                PlayerMovement.AllowMovement(true);
                modalPanel.ClosePanel();
            }
            else // Else we know they just pressed Jump and there is still more to the conversation.
            {
                GetAndStartDisplayingText(TextObject.choice1id);
            }
        }
    }
示例#3
0
 public void YesFunction()
 {
     Debug.Log("Eliminando archivos .dat");
     //gdp.DeleteDatFiles();
     //SceneManager.LoadScene("MainMenu");
     modalPanel.ClosePanel();
 }
示例#4
0
    void NextConversation()
    {
        Debug.Log("Current convo: " + theConversation.CurrentConversation);
        int current = theConversation.CurrentConversation;
        int nextCon = current + 1;

        theConversation.CurrentConversation = nextCon;
        Debug.Log("New conversation: " + nextCon);
        Debug.Log("Made it to next conversation");
        switch (nextCon)
        {
        case 2:
            Debug.Log("Made it to second switch");
            modalPanel.Choice(theConversation.Conversation2, YesAction, NoAction, false);
            break;

        case 3:
            Debug.Log("Made it to third switch");
            modalPanel.Choice(theConversation.Conversation3, YesAction, NoAction, true);
            break;

        default:
            GameStats.Instance.SetBirdSeduction(theConversation.BirdNum, theScore >= 3);
            modalPanel.ClosePanel();
            flock.InitFlock(GameStats.Instance);
            break;
        }
    }
示例#5
0
 void TestNoFunction()
 {
     SaveLoadManager.SavePlayer();
     modalPanel.ClosePanel();
 }