コード例 #1
0
ファイル: NpcInteraction.cs プロジェクト: clock2255/awagas
        void _HandleNpcDialogue(Dictionary <string, object> props)
        {
            // update our idea of the state
            //QuestLogEntry logEntry = null;
            NpcId               = (OID)props["npcOid"];
            dialogue            = new Dialogue();
            dialogue.dialogueID = (int)props["dialogueID"];
            dialogue.title      = (string)props["title"];
            dialogue.text       = (string)props["text"];
            dialogue.npcId      = NpcId;

            int numOptions = (int)props["numOptions"];

            for (int i = 0; i < numOptions; i++)
            {
                DialogueAction action = new DialogueAction();
                action.interactionType  = (string)props["option" + i + "action"];
                action.interactionID    = (int)props["option" + i + "actionID"];
                action.interactionTitle = (string)props["option" + i + "text"];
                action.dialogueID       = dialogue.dialogueID;
                action.npcId            = NpcId;
                dialogue.actions.Add(action);
            }

            // dispatch a ui event to tell the rest of the system
            string[] args = new string[1];
            AtavismEventSystem.DispatchEvent("DIALOGUE_UPDATE", args);
        }
コード例 #2
0
ファイル: NpcInteraction.cs プロジェクト: clock2255/awagas
 public void PerformDialogueAction(DialogueAction action)
 {
     action.StartInteraction();
 }