//显示 public override void OnEnable() { #if UNITY_STANDALONE_WIN || UNITY_EDITOR #else SdkConector.ShowToolBar(1); #endif }
//显示 public override void OnEnable() { #if UNITY_STANDALONE_WIN || UNITY_EDITOR || SKIP_SDK #else SdkConector.ShowToolBar(1); #endif Debug.Log("GameUserData.Instance.GameUserGold.ToString() " + GameUserModel.Instance.mGameUserGold.ToString()); mGoldText.text = GameUserModel.Instance.mGameUserGold.ToString(); mDiamondText.text = GameUserModel.Instance.mGameUserDmd.ToString(); //初始化 mBattle.value = true; // if (SystemNoticeData.Instance.StateType == GameDefine.SystemNoticeState.SystemUnRead) // { // CreateSystemNotice(); // } // #if UNITY_STANDALONE_WIN // if (InputNotice == null && IGuideTaskManager.Instance().IsLineTaskFinish()) // { // ResourceUnit objUnit = ResourcesManager.Instance.loadImmediate(GameConstDefine.LoadInputSend, ResourceType.PREFAB); // InputNotice = GameObject.Instantiate(objUnit.Asset) as GameObject; // InputNotice.transform.parent = mRoot; // InputNotice.transform.localPosition = Vector3.zero; // InputNotice.transform.localScale = Vector3.one; // } // #endif }
/// <summary> /// sdk的登陆接口 /// </summary> public void LoginSDK() { #if UNITY_ANDROID //TD_info.setLogin();//TD接入进入游戏 AndroidJavaClass jc = new AndroidJavaClass("com.unity3d.player.UnityPlayer"); AndroidJavaObject jo = jc.GetStatic <AndroidJavaObject>("currentActivity"); jo.Call("doLYLogin"); #elif UNITY_IPHONE // Debug.Log("Unity--------LoginSDK-------------"); #if SDK_AZ #elif SDK_JYIOS SdkConector.NdLogin(); #elif SDK_ITOOLS ItoolsSdkControl.ItoolSDKLogin(); #elif SDK_KUAIYONG KYSdkControl.KYSDKLogin(); #elif SDK_XY XYSDKControl.XYSDKLogin(); #elif SDK_I4 ASSDKControl.ASSDKLogin(); #elif SDK_ZSY ZSYSDKControl.ZSYSDKLogin(); #elif SDK_ZSYIOS ZSYSDKControl.ZSYSDKLogin(); #elif SDK_PP PPSdkControl.PPSdkLogin(); #elif SDK_TONGBU TBSdkControl.TBSdkLogin(); #elif SDK_HM HMSdkControl.HMSdkLogin(); #endif #endif }
//SDK检查成功 void SdkServerCheckSuccess() { ShowServer(LOGINUI.Login); mWaitingParent.gameObject.SetActive(false); #if UNITY_STANDALONE_WIN || UNITY_EDITOR || SKIP_SDK #else SdkConector.ShowToolBar(0); #endif }
//显示 public override void OnEnable() { mVersionLable.text = SdkConector.GetBundleVersion(); mPlayAnimate.enabled = true; ShowServer(LOGINUI.None); #if UNITY_STANDALONE_WIN || UNITY_EDITOR || SKIP_SDK mLoginInput.gameObject.SetActive(true); #endif }
//类对象释放 public override void Realse() { EventCenter.RemoveListener(EGameEvent.eGameEvent_BattleInfoEnter, Show); EventCenter.RemoveListener(EGameEvent.eGameEvent_BattleInfoExit, Hide); #if UNITY_STANDALONE_WIN || UNITY_EDITOR || SKIP_SDK #else SdkConector.HideToolBar(); #endif }
//显示 public override void OnEnable() { mVersionLable.text = SdkConector.GetBundleVersion(); mRoot.Find("Server_Choose/Loginer/AcountInput/Label").GetComponent <UILabel>().text = JxBlGame.Instance.lang.getString("lbl_username").ToUpper(); mRoot.Find("Server_Choose/Loginer/PassInput/Label").GetComponent <UILabel>().text = JxBlGame.Instance.lang.getString("lbl_password").ToUpper(); mPlayAnimate.enabled = true; ShowServer(LOGINUI.None); #if UNITY_STANDALONE_WIN || UNITY_EDITOR || SKIP_SDK mLoginInput.gameObject.SetActive(true); #endif }
// 连接SDK public void SdkLink() { Debugger.Log("----sdk link----"); #if UNITY_STANDALONE_WIN || UNITY_EDITOR || SKIP_SDK #else if (!SdkConector.islink) { SdkConector.islink = true; SdkConector.isLogOut = false; SdkConector.Logout(1); } #endif }
//显示服务器信息或者显示登录信息 void ShowServer(LOGINUI state) { bool showLogin = false; bool showServer = false; bool showSelectServer = false; switch (state) { case LOGINUI.Login: ShowSelectServerInfo(); showLogin = true; showServer = false; showSelectServer = false; break; case LOGINUI.SelectServer: showLogin = false; showServer = true; showSelectServer = false; break; case LOGINUI.None: showLogin = false; showServer = false; #if UNITY_STANDALONE_WIN || UNITY_EDITOR || SKIP_SDK showSelectServer = true; #endif break; } mPlayParent.gameObject.SetActive(showLogin); mServerParent.gameObject.SetActive(showServer); mLoginParent.gameObject.SetActive(showSelectServer); if (showLogin) { #if UNITY_STANDALONE_WIN || UNITY_EDITOR || SKIP_SDK mChangeAccountName.text = mLoginAccountInput.value; #else mChangeAccountName.text = SdkConector.NickName(); #endif } mChangeAccountBtn.gameObject.SetActive(showLogin); }
//游戏退出前执行(玩家强行关闭游戏) void OnApplicationQuit() { #if UNITY_STANDALONE_WIN || UNITY_EDITOR || SKIP_SDK #else SdkConector.Quit(); #endif Debug.Log("游戏退出前执行了OnAppliactionQuit"); /* * // PlatformManager.GetSingleton ().OnAction (EActionType.eA_Logout,null,null,null); #region talkingdata * CEvent eve = new CEvent(EGameEvent.eGameEvent_TalkgameAction); * eve.AddParam("type", EActionType.eA_Logout); * EventCenter.SendEvent(eve); #endregion */ NetworkManager.Instance.Close(); }
public static void LogOutToLogin() { if (PlayerManager.Instance != null) { if (PlayerManager.Instance.AccountDic != null) { PlayerManager.Instance.AccountDic.Clear(); } Iselfplayer player = PlayerManager.Instance.LocalPlayer; if (player != null) { player.UserGameItemsCount.Clear(); player.UserGameItemsCoolDown.Clear(); player.UserGameItems.Clear(); Debug.LogError("player"); } MsgInfoManager.Instance.RemoveKillMsg(); AltarData.Instance.DelAllAltar(); FriendManager.Instance.DelAllList(); PlayerManager.Instance.DestoryAllEntity(); GameUserModel.Instance.Clear(); //GoodsModel.Instance.Clear(); MailModel.Instance.Clear(); SystemNoticeData.Instance.Clear(); MarketHeroListModel.Instance.Clear(); MarketRuneListModel.Instance.Clear(); RuneEquipModel.Instance.Clear(); PlayerManager.Instance.LocalAccount = PlayerManager.Instance.LocalPlayer = null; } NetworkManager.Instance.canReconnect = false; NetworkManager.Instance.Close(); #if UNITY_STANDALONE_WIN || UNITY_EDITOR || SKIP_SDK #else SdkConector.ShowToolBar(1); #endif }
public void PositionOnPress(int ie, bool isPress) { //Debug.Log("button on press"); SdkConector.ShowCenter (); }
void OnDisable() { Instance = null; }
void Awake() { Instance = this; DontDestroyOnLoad(gameObject); }
private static string appkey = "8148112b941e470f8bcbe72532e82091"; // TODO: 设置APPKEY #endif void Start() { #if UNITY_IPHONE #if SDK_AZ #elif SDK_JYIOS SdkConector.NdInit(); SdkConector.NdSetUnityReceiver(this.transform.name); #elif SDK_ITOOLS if (ItoolsSdkControl.isInit == false) { ItoolsSdkControl.ItoolSDKInit(appid, appkey); ItoolsSdkControl.isInit = true; } ItoolsSdkControl.ItoolSDKSetUnityReceiver(this.transform.name); #elif SDK_KUAIYONG if (KYSdkControl.isInit == false) { KYSdkControl.KYSDKInit(); KYSdkControl.isInit = true; } KYSdkControl.KYSDKSetUnityReceiver(this.transform.name); #elif SDK_XY if (XYSDKControl.isInit == false) { XYSDKControl.XYSDKInit(appid, appkey); XYSDKControl.isInit = true; } XYSDKControl.XYSDKSetUnityReceiver(this.transform.name); #elif SDK_I4 ASSDKControl.ASSDKInit(appid, appkey); ASSDKControl.ASSDKSetUnityReceiver(this.transform.name); #elif SDK_ZSY if (ZSYSDKControl.isInit == false) { ZSYSDKControl.isInit = true; ZSYSDKControl.ZSYSDKInit(); } ZSYSDKControl.ZSYSDKSetUnityReceiver(this.transform.name); #elif SDK_ZSYIOS if (ZSYSDKControl.isInit == false) { ZSYSDKControl.isInit = true; ZSYSDKControl.ZSYSDKInit(); } ZSYSDKControl.ZSYSDKSetUnityReceiver(this.transform.name); #elif SDK_PP if (PPSdkControl.isInit == false) { PPSdkControl.isInit = true; PPSdkControl.PPSdkInit(); } PPSdkControl.PPSdkSetUnityReceiver(this.transform.name); #elif SDK_TONGBU if (TBSdkControl.isInit == false) { TBSdkControl.isInit = true; TBSdkControl.TBSdkInit(); } TBSdkControl.TBSdkSetUnityReceiver(this.transform.name); #elif SDK_HM if (HMSdkControl.isInit == false) { HMSdkControl.isInit = true; HMSdkControl.HMSdkInit(); } HMSdkControl.HMSdkSetUnityReceiver(this.transform.name); #endif #endif }