示例#1
0
 void Start()
 {
     animator = role.GetComponentInChildren <Animator>();
     bb       = role.GetComponentInChildren <BindBody>();
     EventDelegate.Add(m_Btn_Test.onClick, BoomShakalaka);
     EventDelegate.Add(m_Btn_Save.onClick, SaveData);
     EventDelegate.Add(m_Btn_Clear.onClick, ClearBtn);
 }
示例#2
0
    public void BindFBActual(string _fbtoken, string _fbid, Action bindSucessCallback = null)
    {
        BindBody body = new BindBody(URLConfig.BindUser);

        body.type       = "facebook";
        body.id         = _fbid;
        body.thirdtoken = _fbtoken;
        body.gameUid    = StorageManager.Inst.GetStorage <StorageAccountInfo>().Uid;

        HttpRequestTool.SendMessage(
            body,
            (x) => {
            JSONNode respons = JSONNode.Parse(x);
            int code         = respons["code"];
            if (code == 0)
            {
                fbid = _fbid;
                Debug.Log("Bind Success 1:" + x);
                if (bindSucessCallback != null)
                {
                    bindSucessCallback();
                }
                EventUtil.EventDispatcher.TriggerEvent(EventKey.FB_Bind_Sucess);
                UIManager.Inst.ShowMessage(LanguageTool.Get("bind_fb_success"));
                //弹出绑定成功面板
                //UIManager.Inst.ShowUI(UIModuleEnum.UIFacebookTips, FacebookTipType.Login_Suc);
            }
            else if (code == -10008)
            {
                Debug.Log("Bind Success 2 :" + "该fb之前已经绑定过当前游戏账号了,无需再次操作");
                UIManager.Inst.ShowMessage(LanguageTool.Get("bind_fb_success"));
                fbid = _fbid;
                //弹出绑定失败面板
                //UIManager.Inst.ShowUI(UIModuleEnum.UIFacebookTips, FacebookTipType.Login_Fail);
            }
            else if (code == -10010)
            {
                Debug.Log("Bind Success 3 :" + "找到fb之前绑定过的游戏进度,即将切换到该游戏进度");
                UIManager.Inst.ShowMessage(LanguageTool.Get("fb_bind_account_reloading"));
                // 清除fb数据
                fbid = _fbid;
                // 清除本地缓存数据
                PlayerPrefs.DeleteAll();
                //重启游戏
                // GameController.Inst.Restart();
                SceneLoadManager.Inst.LoadScene(SceneName.StartScene);
            }
        },
            (x) => {
            Debug.LogError("Bind Fail :" + x);
        }, null, true
            );
    }
示例#3
0
 /// <summary>
 /// Draw the inspector widget.
 /// </summary>
 public override void OnInspectorGUI()
 {
     serializedObject.Update();
     EditorGUILayout.PropertyField(serializedObject.FindProperty("body"), false);
     EditorGUILayout.PropertyField(serializedObject.FindProperty("strBindAniName"), false);
     EditorGUILayout.PropertyField(serializedObject.FindProperty("bSetPlayAwake"));
     EditorGUILayout.PropertyField(serializedObject.FindProperty("bPlyAwake"));
     mBindBodyBtn = target as BindBody;
     if (GUILayout.Button(playContent))
     {
         Debug.Log("effect start play now");
         mBindBodyBtn.Play();
     }
     if (GUILayout.Button(stopContent))
     {
         Debug.Log("effect stop play now");
         mBindBodyBtn.Stop();
     }
     serializedObject.ApplyModifiedProperties();
 }