Ejemplo n.º 1
0
 //支付完成逻辑处理//
 private void onPay(string jsonOrder)
 {
     //LogModule.DebugLog("----Unity-onPay-jsonOrder==" + jsonOrder);
     //GameRoot.onPay(jsonOrder);
     PlatformListener.Instance().OnCYPayResult(jsonOrder);
     //LogModule.DebugLog("--------------onPay done---------------");
 }
Ejemplo n.º 2
0
 void Awake()
 {
     //为gameManager赋值,所有的其他操作都要放在后面
     if (null != m_instance)
     {
         Destroy(this.gameObject);
     }
     m_instance = this;
     DontDestroyOnLoad(this.gameObject);
 }
Ejemplo n.º 3
0
    private void Awake()
    {
#if !UNITY_EDITOR
        try
        {
#endif
        sInstance = this;
#if !UNITY_EDITOR
    }
    catch (Exception ex)
    {
        Logger.Error(ex.ToString());
    }
#endif
    }
Ejemplo n.º 4
0
    // 充值回调
    public void WPOnMakePayResult(int status)
    {
        LogModule.DebugLog("--------------OnCYPayResult---------------" + status.ToString());
        switch ((CYMGCallbackStatus)status)
        {
        case CYMGCallbackStatus.CYMGCallbackStatus_Success:
            PlatformListener.SendCYPay(1);
            break;

        case CYMGCallbackStatus.CYMGCallbackStatus_Fail:
            PlatformListener.SendCYPay(2);
            break;

        case CYMGCallbackStatus.CYMGCallbackStatus_Close:
            PlatformListener.SendCYPay(2);
            break;

        default:
            break;
        }
        LogModule.DebugLog("============unity pay result :" + status.ToString());
    }
Ejemplo n.º 5
0
        void Awake()
        {
            //设置当前场景
            if (null == GameManager.gameManager)
            {
                ResourceManager.InstantiateResource("Prefab/Logic/GameManager", "GameManagerObject");
                if (null != GameManager.gameManager)
                {
                    GameManager.gameManager.Init();
                }
                else
                {
                    LogModule.ErrorLog("Create GameManagerInstance failed");
                }
            }

            if (null == PlatformListener.Instance())
            {
                ResourceManager.InstantiateResource("Prefab/Logic/PlatformListener", "PlatformListener");
            }
            //将当前场景SceneLogic放入GameManager暂存
            GameManager.gameManager.SceneLogic = this;

            ResourceManager.InstantiateResource("Prefab/Logic/FingerGestures", "FingerGestures");

            // 将Debug工具挂入场景,如发布正式版,注释掉此行代码
            DebugHelper.CreateDebugHelper();
            CreateAndroidHelper();             //```````````````````
            Singleton <ObjManager> .GetInstance().OnEnterScene();

            // 动态加载场景无法加载SHADER问题
#if UNITY_EDITOR
            GameObject SceneObj = GameObject.Find("Scene");
            if (null != SceneObj && SceneObj.GetComponent <ShaderFix>() == null)
            {
                SceneObj.AddComponent <ShaderFix>();
            }

            TeleportPoint[] Teleports = GameObject.FindObjectsOfType <TeleportPoint>();
            foreach (TeleportPoint curTeleport in Teleports)
            {
                if (curTeleport.gameObject.GetComponent <ShaderFix>() == null)
                {
                    curTeleport.gameObject.AddComponent <ShaderFix>();
                }
            }
#endif
            GameManager.gameManager.ActiveScene.Init();

            //为了防止低端机型在场景切换完成和人物创建完成之间会照到空白的地方,这里先调整一下摄像机的位置
            if (null != Camera.main)
            {
                Vector3 camInitPos = GameManager.gameManager.PlayerDataPool.EnterSceneCache.EnterScenePos;
                camInitPos    = ActiveScene.GetTerrainPosition(camInitPos);
                camInitPos.y += 8.0f;
                Camera.main.transform.position = camInitPos;
            }

            //初始化场景通路图
            if (null != GameManager.gameManager.AutoSearch)
            {
                GameManager.gameManager.AutoSearch.InitMapConnectPath();
            }

            //设置是否可处理消息包
            NetWorkLogic.GetMe().CanProcessPacket = true;

            // 广播进入场景消息
            if (GameManager.gameManager.RunningScene != (int)GameDefine_Globe.SCENE_DEFINE.SCENE_LOADINGSCENE)
            {
                Messenger.Broadcast(MessengerConst.OnEnterSceneFinish);
            }
        }
Ejemplo n.º 6
0
 public void LgoinCallBack(string jsonLoginInfo)
 {
     PlatformListener.Instance().OnCYUserLogin(jsonLoginInfo);
     IsNowLoginingIn = false;
 }
Ejemplo n.º 7
0
 public static string GetSpid()
 {
     //test
     // return "46";
     return(PlatformListener.GetSpid());
 }
Ejemplo n.º 8
0
 void OnRechargeError()
 {
     PlatformListener.SendCYPay(2);
 }
Ejemplo n.º 9
0
 // 注销完成的逻辑
 private void onChangeAccount(string jsonLogoutMsg)
 {
     //LogModule.DebugLog("----onChangeAccount");
     PlatformListener.Instance().OnCYUserLogout(jsonLogoutMsg);
 }
Ejemplo n.º 10
0
 //登录完成逻辑处理//
 //登录回调 1.08版本的聚合SDK登录返回为加密的字符串,客户端直接拿这个串去验证,成功后服务器给返回uid和token
 //现在登录回调中客户端得不到uid和token了,擦擦擦!!!  2014-06-25
 private void onLogin(string jsonLoginInfo)
 {
     PlatformListener.Instance().OnCYUserLogin(jsonLoginInfo);
 }
Ejemplo n.º 11
0
 private void onPaymentGoodInfoList(string goods)
 {
     PlatformListener.Instance().OnReqCYPayGoodListSuccess(goods);
 }
Ejemplo n.º 12
0
 //分享成功
 private void onShare(string json)
 {
     PlatformListener.Instance().OnUMengSNSSuccess(json);
 }
Ejemplo n.º 13
0
 private void onModifySwitchUser(string jsonModifySwitchMsg)
 {
     PlatformListener.Instance().OnCYSwitchAccount(jsonModifySwitchMsg);
 }