Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BasePlayer"/> class.
        /// </summary>
        public BasePlayer()
        {
            Buffer = new List<byte>();
            CanTalk = true;

            OnLevelEvent += new OnLevelHandler(OnLevel);
            OnLoginEvent += new OnLoginHandler(OnLogin);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BasePlayer"/> class.
        /// </summary>
        public BasePlayer()
        {
            Buffer  = new List <byte>();
            CanTalk = true;

            OnLevelEvent += new OnLevelHandler(OnLevel);
            OnLoginEvent += new OnLoginHandler(OnLogin);
        }
Exemplo n.º 3
0
        public void Login(System.Action CallBackHandler)
        {
            if (CallBackHandler != null)
            {
                OnLoginHandler += CallBackHandler;
            }
            //
            FB.LogInWithReadPermissions(new List <string> ()
            {
                "public_profile", "email", "user_friends"
            },
//			FB.LogInWithPublishPermissions (new List<string> ()
                                        //				{ "public_profile", "email", "user_friends", "publish_actions" },
                                        (ILoginResult result) => {
#if !RELEASE_VERSION
                if (verbose)
                {
                    Debug.Log(result.RawResult);
                }
#endif
                if (result.ResultDictionary.ContainsKey("user_id"))
                {
                    user_id = (string)result.ResultDictionary ["user_id"];
                }
                if (result != null)
                {
                    OnLoginHandler();
                }
                //clear
                System.Delegate[] list = OnLoginHandler.GetInvocationList();
                foreach (System.Delegate del in list)
                {
                    OnLoginHandler -= (System.Action)del;
                }
            }
                                        );
        }