Ejemplo n.º 1
0
    void Start()
    {
        // We fetch all Text components now so that we don't have to keep fetching them later.
        foreach (CHARACTER character in Enum.GetValues(typeof(CHARACTER)))
        {
            dialogueTexts[(int)character] = dialoguePanels[(int)character].GetComponent <Text>();
        }
        choiceText1 = choicePanel1.GetComponent <Text>();
        choiceText2 = choicePanel2.GetComponent <Text>();

        // Turn off all dialogue boxes and the prompt box.
        foreach (GameObject panel in dialogueBoxes)
        {
            panel.SetActive(false);
        }
        promptBox.SetActive(false);

        anyKeyForMainMenu.SetActive(false); // only show this after "Thank for Playing" fades in

        conversationSections = DialogueLoader.conversationsBySection();

        animationManager = animatorObject.GetComponent <CharacterAnimationManager>();

        launchFirstValidConversation(conversationSections[(int)currentDialogueSection]);
    }
Ejemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        typeText1 = textBox1.GetComponentInChildren <TypeTextBehaviour>();
        // Load the dialogue for the scene
        conversations = DialogueLoader.LoadDialogue(dialogueXml.text);

        textBox1.SetActive(false);
    }
Ejemplo n.º 3
0
        public Overseer()
        {
            this.Senses              = new Senses(this);
            this.Speaking            = new Speaking(this);
            this.MessageProcessor    = new Core.MessageProcessor(this);
            this.Persons             = new Core.Persons(this);
            this.Settings            = new MessengerSettings.MessengerSettings(this);
            this.Home                = new HomeEndpoint(this);
            this.Facebook            = new FacebookEndpoint(this);
            this.Telegram            = new TelegramEndpoint(this);
            this.DialogueLoader      = new DialogueLoader();
            this.FreeformPhrases     = new Freeform.FreeformPhrases(this);
            this.LoadedConversations = new LoadedConversations(this);
            Riddle.Load();
            Joke.Load();

            FacebookMetaCommunicator mc = new FacebookMetaCommunicator(this);

            mc.StartLoop();
            TelegramCommunicator tg = new TelegramCommunicator(this);

            tg.StartLoop();
        }
Ejemplo n.º 4
0
    void Update()
    {
        SECTION nextSection = currentDialogueSection + 1;

        if (sectionDelays.Length > (int)nextSection && Time.timeSinceLevelLoad > sectionDelays[(int)nextSection])
        {
            currentDialogueSection = nextSection;
            enterCharacter();
            if (currentDialogueSection == SECTION.I)
            {
                int score = 0;
                foreach (int attitude in attitudes)
                {
                    score += attitude;
                }
                launchConversation(DialogueLoader.getFinaleConversation(score));
            }
            else if (currentDialogueSection == SECTION.J)
            {
                CloseCurtain();
            }
            else if (currentDialogueSection == SECTION.K)
            {
                StartCoroutine(ShowThankYou());
            }
            else if (conversationSections.Length > (int)currentDialogueSection)
            {
                launchFirstValidConversation(conversationSections[(int)currentDialogueSection]);
            }
        }

        if (!isMakingChoice)
        {
            // If the player is not making a choice right now, there's no need to bother with input handling.
            return;
        }

        // only allow user to toggle options if selection has yet to be made
        if (promptBox.activeSelf)
        {
            // makes selection if user pressed enter or space
            if (Input.GetKeyDown("return") || Input.GetKeyDown("enter") || Input.GetKeyDown("space"))
            {
                promptBox.SetActive(false);
                soundFX.promptSelect.Play();
            }

            // toggles options between choice 1 and choice 2 via up and down arrow keys
            if (isUpSelected && (Input.GetKeyDown(KeyCode.DownArrow) || Input.GetKeyDown(KeyCode.S)))
            {
                isUpSelected = false;
                selectorPanel1.SetActive(false);
                selectorPanel2.SetActive(true);
            }
            else if (!isUpSelected && (Input.GetKeyDown(KeyCode.UpArrow) || Input.GetKeyDown(KeyCode.W)))
            {
                isUpSelected = true;
                selectorPanel1.SetActive(true);
                selectorPanel2.SetActive(false);
            }
        }
    }
 public DialogueTree LoadTree()
 {
     return(DialogueLoader.LoadDialogueTree(DialogueLoader.Dialogue.test));
 }
Ejemplo n.º 6
0
    // Use this for initialization
    void Start()
    {
        dialogSpeaker = GameObject.Find ("Voices").GetComponent<AudioSource> ();
                gui = GameObject.Find ("UI Root").GetComponent<GUIController> ();
                isTrigger = this.gameObject.tag != "Enemy";
                if (!isTrigger)
                        player = GameObject.FindGameObjectWithTag ("Player");

                dialogIDCounter = 0;
                game = GameObject.FindGameObjectWithTag ("GameController").GetComponent<GameController> ();
                dialogLoader = GameObject.FindGameObjectWithTag ("GameController").GetComponent<DialogueLoader> ();

                if (speakerName.Length > 0) {
                        print ("specialSpeaker = " + speakerName);
                        dialog = dialogLoader.GetDialogueNode (speakerName);
                } else {
                        print ("Random");
                        int randomNum = Random.Range (1, 6);
                        dialog = dialogLoader.GetDialogueNode ("RandomSpirit" + randomNum);
                }
    }