void Awake() { instance = this; DontDestroyOnLoad(gameObject); #if !UNITY_EDITOR && UNITY_ANDROID Debug.Log("[CallStatic(INIT)] <<<<<<<<<<<<<<<<<"); NativeMessageBinding.javaBinding.CallStatic("Init", name, "ButtonPressed"); #endif }
public static void SaveLivesAndNotify(int _lives, long _waitTime, bool notifications = true) { Exception e = new Exception(); Debug.Log("[LivesSystem] " + e.ToString()); Debug.Log("[LivesSystem] set UserCloud numsLiveLeft: " + _lives); UserManagerCloud.Instance.CurrentUser.NumsLiveLeft = _lives; UserManagerCloud.Instance.CurrentUser.LivesTime = _waitTime; // PlayerPrefs.SetInt(livesKey, _lives); // PlayerPrefs.SetString(livesTimeKey, _waitTime.ToString()); UserCloud.Serialize(UserManagerCloud.FILE_NAME_LOCAL); if (notifications) { NativeMessagesSystem.CancelNotifications(Language.Get("LIVES_NOTIFICATION_MESSAGE")); if (_lives < maxLives) { long showTime = lifeRefillTime * (maxLives - _lives) - (TimeSeconds() - _waitTime); NativeMessagesSystem.ScheduleNotification(Language.Get("LIVES_NOTIFICATION_TITLE"), Language.Get("LIVES_NOTIFICATION_MESSAGE"), showTime); } } }