public static void SendFinalShipPartChoice() { Dictionary <string, object> dict = new Dictionary <string, object>(); dict.Add("time", DateTime.Now); int num; //This is designed to accommodate additional eShipPartTypes foreach (ShipPart.eShipPartType type in (ShipPart.eShipPartType[]) Enum.GetValues(typeof(ShipPart.eShipPartType))) { if (dict.Count == 10) { //This is necessary because AnalyticsEvent.Custom has a hard //Limit on this dict size of 10, according to //https://docs.unityed.com/Manual/UnityAnalyticsCustomEventsSDK.html break; } num = ShipCustomizationPanel.GetSelectedPart(type); dict.Add(type.ToString(), num); } AnalyticsEvent.Custom("ShipPartChoice", dict); }
static public void Save() { // If this is LOCKed, don't save if (LOCK) { return; } saveFile.stepRecords = AchievementManager.GetStepRecords(); saveFile.achievements = AchievementManager.GetAchievements(); saveFile.selectedBody = ShipCustomizationPanel.GetSelectedPart(ShipPart.eShipPartType.body); saveFile.selectedTurret = ShipCustomizationPanel.GetSelectedPart(ShipPart.eShipPartType.turret); string jsonSaveFile = JsonUtility.ToJson(saveFile, true); File.WriteAllText(filePath, jsonSaveFile); #if DEBUG_VerboseConsoleLogging Debug.Log("SaveGameManager:Save() – Path: " + filePath); Debug.Log("SaveGameManager:Save() – JSON: " + jsonSaveFile); #endif }