示例#1
0
        public void HandleMessage(Message m)
        {
            Debug.Log (m.type + " " + m.index);

            switch (m.type)
            {
            case "event":
                CleanUp();
                data = data.actions[m.index].ev;
                SetUp();
                break;
            case "finish":
                Debug.Log ("I should die now");
                CleanUp();
                break;
            }
        }
示例#2
0
 public void SetEventData(EventData d)
 {
     data = d;
 }
示例#3
0
 public Action()
 {
     ev = null;
 }
示例#4
0
 public static EventData ConstructFromJson(JSONClass json)
 {
     EventData ev = new EventData();
     ev.text = json["text"];
     if (json["actions"] != null)
     {
         JSONArray actions = json["actions"].AsArray;
         int index = 0;
         foreach (JSONClass action in actions)
         {
             Action a = new Action();
             a.text = action["text"];
             a.index = index;
             index++;
             if (action["event"] != null)
             {
                 a.ev = ConstructFromJson(action["event"].AsObject);
             }
             ev.actions.Add(a);
         }
     }
     return ev;
 }