public void AddActions(JSONNode next, IActionHolder ah) { foreach (JSONNode actionSpec in next["actions"].Children) { string jsonString = actionSpec.ToString(); if (allActions.ContainsKey(actionSpec["type"].Value)) { Type t = allActions[actionSpec["type"].Value]; Action action = JsonUtility.FromJson(jsonString, t) as Action; if (actionSpec.HasKey("actions")) { AddActions(actionSpec, action); } ah.AddAction(action); } } }