public IDialogueContext GetContextOfType(DialogueTypes.Type type, int index = 0)
    {
        index = Clamp(type, index);
        if (dialogueDic.ContainsKey(type))
        {
            return(dialogueDic[type][index]);
        }

        return(null);
        //else
        //    return CreateInstance<ScriptedDialogue>();
    }
 public ScriptedDialogue GetDialogueOfType(DialogueTypes.Type type)
 {
     // If the bundles contains the key then return the dialogue but if it doesnt then return an empty scripted dialogue.
     return((dialogueBundlesDic.ContainsKey(type)) ? dialogueBundlesDic[type] : CreateInstance <ScriptedDialogue>());
 }
 public void Draw()
 {
     type = (DialogueTypes.Type)EditorGUILayout.EnumPopup(type);
     proceedToNextSpeaker = EditorGUILayout.Toggle("Proceed to next speaker?", proceedToNextSpeaker);
 }
Ejemplo n.º 4
0
 public SerializedTypedNode(int order, Vector2 pos, DialogueTypes.Type type)
 {
     this.order    = order;
     this.position = pos;
     this.type     = type;
 }
Ejemplo n.º 5
0
 public void Init(DialogueTypes.Type type, bool proceedToNextSpeaker)
 {
     this.type = type;
     this.proceedToNextSpeaker = proceedToNextSpeaker;
 }
    private int Clamp(DialogueTypes.Type type, int index = 0)
    {
        int contextLength = dialogueDic[type].Length;

        return((index > contextLength) ? contextLength : index);
    }
Ejemplo n.º 7
0
 public ScriptedDialogue ReactToDialogue(DialogueTypes.Type type)
 {
     return(dialogueBundle.GetDialogueOfType(type));
 }
Ejemplo n.º 8
0
 public virtual IDialogueContext Respond(DialogueTypes.Type type)
 {
     return(dialogueData.GetDialogueOfType(type));
 }