Ejemplo n.º 1
0
 void Awake()
 {
     if (_keenClient == null)
     {
         _keenClient = new Helios.Keen.Client();
     }
 }
Ejemplo n.º 2
0
 void Awake()
 {
     // Add a metrics client as a member
     if (MetricsClient == null)
     {
         MetricsClient = gameObject.AddComponent <Helios.Keen.Client>();
     }
 }
Ejemplo n.º 3
0
 void Start()
 {
     // This line assigns project settings AND starts
     // client instance's cache service if everything is OK.
     _keenClient          = new Helios.Keen.Client();
     _keenClient.Settings = new Helios.Keen.Client.Config
     {
         /* [REQUIRED] Keen.IO project id, Get this from Keen dashboard */
         ProjectId = KEEN_PROJECT_ID,
         /* [REQUIRED] Keen.IO write key, Get this from Keen dashboard */
         WriteKey = KEEN_WRITE_KEY,
         /* [OPTIONAL] Attempt to sweep the cache every 2 minutes */
         CacheSweepInterval = 120.0f,
         /* [OPTIONAL] In every sweep attempt pop 10 cache entries */
         CacheSweepCount = 10,
         /* [OPTIONAL] This is the callback per Client's event emission */
         EventCallback = OnKeenClientEvent,
         /* [OPTIONAL] A cache implementation instance. If not provided, cache is turned off */
         CacheInstance = new Helios.Keen.Cache.Sqlite(Path.Combine(Application.persistentDataPath, "keen.sqlite3"))
     };
 }