Beispiel #1
0
    // Use this for initialization
    void Start()
    {
        dialogueManager = FindObjectOfType <Dialogue.DialogueManager>();
        dialogueManager.actors[actorName] = actor;

        if (encounterWon.Triggered)
        {
            gameObject.SetActive(false);
        }
    }
    // Use this for initialization
    // This is given custom execution order before default time so
    // PersistentObjects are set before anything else initializes
    void Start()
    {
        player = FindObjectOfType <Controller>();
        Dialogue.DialogueActor playerActor = player.GetComponent <Dialogue.DialogueActor>();

        OnBusyStart.AddListener(player.Freeze);
        OnBusyEnd.AddListener(player.Unfreeze);

        // Have dialogue manager make this busy
        Dialogue.DialogueManager dialogue = FindObjectOfType <Dialogue.DialogueManager>();
        if (dialogue != null)
        {
            dialogue.OnConversationStart.AddListener(SetBusy);
            dialogue.OnConversationEnd.AddListener(ClearBusy);
            // add player
            dialogue.actors["Player"] = playerActor;
        }
        persistentObjects = new List <PersistentObject>(FindObjectsOfType <PersistentObject>());
        foreach (PersistentObject po in persistentObjects)
        {
            po.controller = this;
        }

        // If this scene has dictionary, load from it
        sceneKey = gameObject.scene.path;
        Dictionary <string, JObject> objectData;

        if (SceneLoader.Instance.persistentSceneData.TryGetValue(sceneKey, out objectData))
        {
            LoadPersistentObjects(objectData);
        }
        else
        {
            // If dictionary not found, create it
            SceneLoader.Instance.persistentSceneData[sceneKey] = new Dictionary <string, JObject>();
        }

        // TODO move player to entrypoint set
        int entryIndex = SceneLoader.Instance.EntrypointIndex;

        if (entryIndex >= 0 && entryIndex < Entrypoints.Count)
        {
            // HACK move player to indicated location
            Transform entryPoint = Entrypoints[entryIndex];
            player.transform.position = entryPoint.position;
            player.transform.rotation = entryPoint.rotation;
        }
    }
 public override string Evaluate(DialogueManager manager)
 {
     return(Contents);
 }
 public override string Evaluate(DialogueManager manager)
 {
     return(Options[Random.Range(0, Options.Count)].Evaluate(manager));
 }
 public abstract string Evaluate(DialogueManager manager);
Beispiel #6
0
 public void RedirectDialogue(SerializableTree dlg)
 {
     DialogueManager.RedirectDialogue(dlg);
 }
 private void Start()
 {
     dialogueManager = FindObjectOfType <Dialogue.DialogueManager>();
     dialogueManager.actors["Necromancer"] = actor;
 }
 private void Start()
 {
     manager = GetComponent <DialogueManager>();
 }
 private void Awake() => manager = DialogueManager.Instance;
Beispiel #10
0
 // Use this for initialization
 void Start()
 {
     dialogueManager = FindObjectOfType <Dialogue.DialogueManager>();
     m_actorDict     = actors.ToDictionary();
     trigger         = GetComponent <PersistentTrigger>();
 }
 public override bool Evaluate(DialogueManager dialogue)
 {
     return(dialogue.CheckFlag(Flag) != Not);
 }
Beispiel #12
0
 // Use this for initialization
 void Start()
 {
     dialogueManager = FindObjectOfType <Dialogue.DialogueManager>();
 }
Beispiel #13
0
 public void Execute(DialogueManager manager)
 {
     dialogueEvent.Execute(manager, target, parameters);
 }