コード例 #1
0
        public static void Notify(object sender, GameEventArgs e)
        {
            switch (e.type)
            {
            case SIGNED_IN:
                SingedIn?.Invoke(sender, e);
                break;

            case FAIL_SIGN_IN:
                FailSignIn?.Invoke(sender, e);
                break;

            case SIGNED_OUT:
                SignedOut?.Invoke(sender, e);
                break;

            case DATA_LOADED:
                DataLoaded?.Invoke(sender, e);
                break;

            case FAIL_DATA_LOADING:
                FailDataLoading?.Invoke(sender, e);
                break;
            }
        }
コード例 #2
0
        /// <summary>
        /// Use it for notify from EventTrigger Component. Requires to be component on GameObject!
        /// </summary>
        /// <param name="sender">The sender object.</param>
        /// <param name="e">Event arguments</param>
        public void Notify(string type)
        {
            switch (type)
            {
            case SIGNED_IN:
                SingedIn?.Invoke(null, new GameEventArgs(type));
                break;

            case FAIL_SIGN_IN:
                FailSignIn?.Invoke(null, new GameEventArgs(type));
                break;

            case SIGNED_OUT:
                SignedOut?.Invoke(null, new GameEventArgs(type));
                break;

            case DATA_LOADED:
                DataLoaded?.Invoke(null, new GameEventArgs(type));
                break;

            case FAIL_DATA_LOADING:
                FailDataLoading?.Invoke(null, new GameEventArgs(type));
                break;
            }
        }
コード例 #3
0
        void authStateChanged(object sender, System.EventArgs eventArgs)
        {
            FirebaseAuth senderAuth = sender as FirebaseAuth;
            FirebaseUser user       = null;

            if (senderAuth != null)
            {
                _userByAuth.TryGetValue(senderAuth.App.Name, out user);
            }

            if (senderAuth == _auth && senderAuth.CurrentUser != User)
            {
                bool signedIn = User != senderAuth.CurrentUser && senderAuth.CurrentUser != null;
                if (!signedIn && User != null)
                {
                    Debug.Log($"[EmailAuth::authStateChanged] Signed out {User.UserId}");
                    User = null;
                    SignedOut?.Invoke();
                }

                User = senderAuth.CurrentUser;
                _userByAuth[senderAuth.App.Name] = User;

                if (signedIn)
                {
                    Debug.Log($"[EmailAuth::authStateChanged] Signed in {DisplayName} {User.UserId} / {User.Email}");
                    // DisplayDetailedUserInfo(user, 1);
                }
            }
        }
コード例 #4
0
        private void SignOut()
        {
            _preferences.Nuke();
            _secureStorage.Nuke();
            _dbConnection.Nuke();
            _backgroundSync.Disable();

            _messenger.Unsubscribe <WokeUpMessage>(this);

            SignedOut?.Invoke(this, EventArgs.Empty);
        }