// Used when we want settings to create the project... public static BTPrjSettingsDef GetCreateProjectSettingsForType(BTProjectTypes t) { var templ = new BTPrjSettingsDef(); templ.ProjectType = t; templ.AddItem("bi", "Bundle Identifier", "", "com.ThisLittleCompany.ThisAppId"); templ.AddItem("prjname", "Project Name", "string", "", true, true, false); if (t == BTProjectTypes.GenericUnityProject) { return(templ); } else if (t == BTProjectTypes.QuizGame) { // The main scene is the scene that we must select //templ.AddItem( "mainscene", "Main Scene", "string", "001_GenericQuiz", true, false, false ); //templ.AddItem( "online_prefs_url", "Online Prefs Url (Google TSV/JSON Prefs)", "string", "", true ); //templ.AddItem( "quiz_url", "Quiz Data Url (Google Sheet/TSV)", "string", "", true, true, false ); templ.AddItem("run_method", "Run Method On Build", "string", "QuizPublishSettings.Apply( \"https://docs.google.com/spreadsheets/d/spreadsheetId/pub?gid=0&single=true&output=tsv\" )", true, true, false); return(templ); } else if (t == BTProjectTypes.RunnerGame) { return(templ); } else if (t == BTProjectTypes.RateApp) { //templ.AddItem( "" ); return(templ); } throw new System.Exception("invalid settp"); }
public static BTPrjSettingsDef FromJSONEncodedString(string str) { var tbl = (Hashtable)MiniJSON.jsonDecode(str); if (tbl == null) { throw new System.Exception("Error, string is not json or json object : " + str); } var ret = new BTPrjSettingsDef(); ret.keys = tbl.GetArrayOfSimple <string>("keys").ToList(); ret.dispName = tbl.GetArrayOfSimple <string>("dispName").ToList(); ret.types = tbl.GetArrayOfSimple <string>("types").ToList(); ret.defaultValue = tbl.GetArrayOfSimple <string>("defaultValue").ToList(); ret.value = tbl.GetArrayOfSimple <string>("value").ToList(); ret.writeEnabled = tbl.GetArrayOfSimple <bool>("writeEnabled").ToList(); ret.needsChange = tbl.GetArrayOfSimple <bool>("needsChange").ToList(); //Debug.Log( tbl.Get<ArrayList>( "format" )[0].GetType().Name ); var _format = tbl.GetArrayOfSimple <System.Double> ("format"); ret.format = new System.Collections.Generic.List <int> (); foreach (var e in _format) { ret.format.Add(System.Convert.ToInt32((System.Double)e)); } return(ret); }
// The prjoect settings.... static public BTPrjSettingsDef GetProjectSettingsByProjectType(BTProjectTypes pt) { var templ = new BTPrjSettingsDef(); AddDefaultSettings(ref templ); if (pt == BTProjectTypes.GenericUnityProject) { templ.AddItem("apptype", "App type", "string", "", true, true, false); return(templ); } else if (pt == BTProjectTypes.QuizGame) { templ.AddItem("apptype", "App Type", "string", "", true, true, false); return(templ); } throw new System.Exception("invalid pt"); }
static void AddDefaultSettings(ref BTPrjSettingsDef templ) { templ.AddItem("bi", "Bundle Identifier", "", "com.ThisLittleCompany.ThisAppId"); }