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

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

        dialogueSystem = MainInstances.Get <DialogueSystem>();
        valueRegistry  = MainInstances.Get <ValueRegistry>();
    }
示例#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>();
 }
示例#7
0
 private void DialogueBox(DisplayStringNode node)
 {
     StartCoroutine(DialogueBox(MainInstances.Get <StringRegistry>().Get(node.RegistryValueName).ToString(), node.ErasePrevious, node.WaitForInput));
 }
示例#8
0
    private const int nightHour   = 10;   // Inclusive

    private void Start()
    {
        InteractionHandler.Instance.RegisterObject("Window", Interact, 1);
        dialogueSystem = MainInstances.Get <DialogueSystem>();
    }
示例#9
0
 private void Awake()
 {
     Instance      = this;
     valueRegistry = MainInstances.Get <ValueRegistry>();
 }
示例#10
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;
        }