Example #1
0
    private void Start()
    {
        dialogueSystem = MainInstances.Get <DialogueSystem>();

        InteractionHandler.Instance.RegisterObject("Room and Door", () =>
                                                   dialogueSystem.Present(dialogueGraph), 0);
    }
 public void Start()
 {
     scorekeeper    = globalScore.Instance;
     dialogueSystem = MainInstances.Get <DialogueSystem>();
     stringRegistry = MainInstances.Get <StringRegistry>();
     beginTutorial();
 }
Example #3
0
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.P))
     {
         MainInstances.Get <DialogueSystem>().Present(Dialogue);
     }
 }
Example #4
0
    private void Start()
    {
        DontDestroyOnLoad(this);
        Instance = this;
        DayNum   = 1;

        dialogueSystem = MainInstances.Get <DialogueSystem>();
        valueRegistry  = MainInstances.Get <ValueRegistry>();
    }
Example #5
0
        public void Play(DialogueSystem system)
        {
            if (!Verify())
            {
                Debug.Log("Failed to play DialogueGraph: " + name);
                return;
            }

            //Get dependencies

            valueRegistry  = MainInstances.Get <ValueRegistry>();
            agentRegistry  = MainInstances.Get <AgentRegistry>();
            stringRegistry = MainInstances.Get <StringRegistry>();

            currentSystem = system;
            current       = entry;

            current.MoveNext();

            //We started the graph
        }
 private void Start()
 {
     Instance       = this;
     dialogueSystem = MainInstances.Get <DialogueSystem>();
     stringRegistry = MainInstances.Get <StringRegistry>();
 }
Example #7
0
        // GameInput gameInput;


        private void Awake()
        {
            MainInstances.Add(this);
        }
Example #8
0
 private void DialogueBox(DisplayStringNode node)
 {
     StartCoroutine(DialogueBox(MainInstances.Get <StringRegistry>().Get(node.RegistryValueName).ToString(), node.ErasePrevious, node.WaitForInput));
 }
Example #9
0
    private const int nightHour   = 10;   // Inclusive

    private void Start()
    {
        InteractionHandler.Instance.RegisterObject("Window", Interact, 1);
        dialogueSystem = MainInstances.Get <DialogueSystem>();
    }
Example #10
0
 private void Awake()
 {
     Instance      = this;
     valueRegistry = MainInstances.Get <ValueRegistry>();
 }
Example #11
0
        public IEnumerator NormalType(float TextSpeed, string Text, bool clear = true)
        {
            if (Text == "Done")
            {
                yield break;                 // NOTE: Janky setup. Hopefully does not break anything - Nathan
            }

            var agentRegistry = MainInstances.Get <AgentRegistry>().registryObject;

            nameUI.text       = "";
            nameAvatarUI.text = "";
            //if(textUI != null) Debug.Log("Before textUI " + textUI.text);
            if (currentAgent != null)
            {
                var prop = agentRegistry.Get(currentAgent.AgentName);
                if (prop != null)
                {
                    var image = agentRegistry.GetEmotion(currentAgent.AgentName, currentAgent.Emotion);
                    if (image != null)
                    {
                        AvatarImage.sprite = image;
                        nameAvatarUI.text  = prop.name;
                        SwitchTextLayout(2);
                    }
                    else
                    {
                        nameUI.text = prop.name;
                        SwitchTextLayout(1);
                    }
                }
                else
                {
                    SwitchTextLayout(1);
                }
            }
            else
            {
                SwitchTextLayout(0);
            }
            //Debug.Log("Current textUI " + textUI.text);


            int index = 0;

            startingText = clear ? "" : textUI.text;
            currentText  = startingText;
            TextToWrite  = Text;

            while (index < Text.Length)
            {
                if (WrapUp)
                {
                    Debug.Log("Wrapping up text: " + startingText + Text);
                    currentText = startingText + Text;
                    break;
                }

                textUI.text = currentText;

                currentText += Text[index];
                index++;



                yield return(new WaitForSeconds(1 / TextSpeed));
            }

            textUI.text     = currentText;
            typingCoroutine = null;
            WrapUp          = false;
        }