Exemple #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;
            }
        }
Exemple #2
0
 public void SetEventData(EventData d)
 {
     data = d;
 }
Exemple #3
0
 public Action()
 {
     ev = null;
 }
Exemple #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;
 }