internal JSONObject ToJsonObject() { var jsonObject = new JSONObject(); jsonObject["mode"] = Mode.ToString(); jsonObject["dotMode"] = DotMode.ToJsonObject(); jsonObject["pathMode"] = PathMode.ToJsonObject(); return(jsonObject); }
internal static HapticEffectMode ToMode(JSONObject jsonObj) { var mode = new HapticEffectMode(); mode.Mode = EnumParser.ToMode(jsonObj["mode"]); mode.DotMode = DotMode.ToDotMode(jsonObj["dotMode"].AsObject); mode.PathMode = PathMode.ToPathMode(jsonObj["pathMode"].AsObject); return(mode); }
internal static DotMode ToDotMode(JSONObject jsonObj) { var dotMode = new DotMode(); dotMode.DotConnected = jsonObj["dotConnected"]; var feedbackList = new List <DotModeObjectCollection>(); var arr = jsonObj["feedback"]; foreach (var val in arr) { feedbackList.Add(DotModeObjectCollection.ToObject(val.Value.AsObject)); } dotMode.Feedback = feedbackList.ToArray(); return(dotMode); }