コード例 #1
0
ファイル: Controller.cs プロジェクト: mixpanel/mixpanel-unity
 private static void InitializeBeforeSceneLoad()
 {
     MixpanelSettings.LoadSettings();
     if (Config.ManualInitialization)
     {
         return;
     }
     Initialize();
 }
コード例 #2
0
 private static void InitializeBeforeSceneLoad()
 {
     MixpanelSettings.LoadSettings();
     if (Config.ManualInitialization)
     {
         return;
     }
     Initialize();
     Mixpanel.Log($"Track Queue Depth: {MixpanelStorage.TrackPersistentQueue.CurrentCountOfItemsInQueue}");
     Mixpanel.Log($"Engage Queue Depth: {MixpanelStorage.EngagePersistentQueue.CurrentCountOfItemsInQueue}");
 }
コード例 #3
0
 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.FlushInterval = _instance.FlushInterval;
     }
 }
コード例 #4
0
        private static MixpanelSettings FindOrCreateInstance()
        {
            MixpanelSettings instance = null;

            instance = instance ? null : Resources.Load <MixpanelSettings>("Mixpanel");
            instance = instance ? instance : Resources.LoadAll <MixpanelSettings>(string.Empty).FirstOrDefault();
            instance = instance ? instance : CreateAndSave <MixpanelSettings>();
            if (instance == null)
            {
                throw new Exception("Could not find or create settings for Mixpanel");
            }
            return(instance);
        }
コード例 #5
0
ファイル: Controller.cs プロジェクト: nonumpa/mixpanel-unity
        private IEnumerator Start()
        {
            MigrateFrom1To2();
            DontDestroyOnLoad(this);
            StartCoroutine(PopulatePools());
            MixpanelSettings.LoadSettings();
            Worker.StartWorkerThread();
            TrackIntegrationEvent();
            while (true)
            {
                yield return(new WaitForSecondsRealtime(Config.FlushInterval));

                DoFlush();
            }
        }