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