private IEnumerator UpdateVariables() { // Real apps would only update at key points in the application's user experience, of course... var waiter = new WaitForSeconds(5.0f); while (true) { yield return(waiter); Leanplum.ForceContentUpdate(); } }
void OnTriggerEnter2D(Collider2D other) { if (other.gameObject.CompareTag("PickUp")) { pickupCount++; other.gameObject.SetActive(false); // TEST CASE 02 // Manually generate userId on each pickUp (5 users in total). if (Leanplum.HasStarted) { Dictionary <string, object> attributes = new Dictionary <string, object>(); attributes.Add("pickUp Count", pickupCount); Leanplum.SetUserAttributes(attributes); Leanplum.Track("PickUp"); string userName = "******" + (pickupCount).ToString(); Leanplum.SetUserId(userName); Leanplum.ForceContentUpdate(); } } }