Exemplo n.º 1
0
 private static void InitializeBeforeSceneLoad()
 {
     SeembaSDKMixpanelSettings.LoadSettings();
     if (Config.ManualInitialization)
     {
         return;
     }
     Initialize();
     SeembaMixpanel.Log($"Track Queue Depth: {MixpanelStorage.TrackPersistentQueue.CurrentCountOfItemsInQueue}");
     SeembaMixpanel.Log($"Engage Queue Depth: {MixpanelStorage.EngagePersistentQueue.CurrentCountOfItemsInQueue}");
 }
        private static SeembaSDKMixpanelSettings FindOrCreateInstance()
        {
            SeembaSDKMixpanelSettings instance = null;

            instance = instance ? null : Resources.Load <SeembaSDKMixpanelSettings>("Mixpanel");
            instance = instance ? instance : Resources.LoadAll <SeembaSDKMixpanelSettings>(string.Empty).FirstOrDefault();
            instance = instance ? instance : CreateAndSave <SeembaSDKMixpanelSettings>();
            if (instance == null)
            {
                throw new Exception("Could not find or create settings for Mixpanel");
            }
            return(instance);
        }
 public static void LoadSettings()
 {
     if (!_instance)
     {
         _instance = FindOrCreateInstance();
         string host = _instance.APIHostAddress.EndsWith("/") ? _instance.APIHostAddress : $"{_instance.APIHostAddress}/";
         Config.TrackUrl             = string.Format(TrackUrlTemplate, host);
         Config.EngageUrl            = string.Format(EngageUrlTemplate, host);
         Config.ShowDebug            = _instance.ShowDebug;
         Config.ManualInitialization = _instance.ManualInitialization;
         Config.FlushInterval        = _instance.FlushInterval;
     }
 }