Exemple #1
0
 /// <summary>
 /// 判断支付 限制的回调
 /// </summary>
 /// <param name="e"></param>
 /// <param name="args"></param>
 private static void OnCheckPayLimitResult(CheckPayLimitResultEvent e, object[] args)
 {
     Debug.Log("OnCheckPayLimitResult SDK: " + e.payLimitType);
     if (e.payLimitType == PayLimitType.None)
     {
         PayInfo payInfo = new PayInfo(m_goodsInfo.goodsID, m_goodsInfo.localizedTitle, m_payPlatform.payPlatformTag, FrameWork.SDKManager.GoodsType.NORMAL, "", m_goodsInfo.localizedPrice, m_goodsInfo.isoCurrencyCode, user.userID, m_payPlatform.SDKName);
         if (Application.platform == RuntimePlatform.Android)
         {
             SDKManager.Pay(m_payPlatform.SDKName, payInfo);
         }
         else
         {
             SDKManager.Pay(payInfo);
         }
     }
     else if (e.payLimitType == PayLimitType.ChildLimit)
     {
         //未成年本日消费超出
         OnVerificationResultCallBack(new PayResult(-21, m_goodsInfo.goodsID, "今日消费已超出未成年限制"));
     }
     else if (e.payLimitType == PayLimitType.NoRealName)
     {
         //未实名制,无法支付
         OnVerificationResultCallBack(new PayResult(-22, m_goodsInfo.goodsID, "请完成实名制认证后重试"));
     }
     else
     {
         //错误,不应该会进来
     }
 }
Exemple #2
0
 public override void Init()
 {
     if (SDKManager.IncludeThePayPlatform(StoreName.HuaWei))
     {
         GlobalEvent.AddTypeEvent <PrePay2Client>(OnPrePay);
     }
 }
Exemple #3
0
    static int Authorize(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(SDKManager), typeof(cn.sharesdk.unity3d.PlatformType)))
            {
                SDKManager obj = (SDKManager)ToLua.ToObject(L, 1);
                cn.sharesdk.unity3d.PlatformType arg0 = (cn.sharesdk.unity3d.PlatformType)ToLua.ToObject(L, 2);
                obj.Authorize(arg0);
                return(0);
            }
            else if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(SDKManager), typeof(int)))
            {
                SDKManager obj  = (SDKManager)ToLua.ToObject(L, 1);
                int        arg0 = (int)LuaDLL.lua_tonumber(L, 2);
                obj.Authorize(arg0);
                return(0);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: SDKManager.Authorize"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
    /// <summary>
    /// 验证结果调用
    /// </summary>
    /// <param name="code">是否成功</param>
    /// <param name="goodsID">物品ID</param>
    /// <param name="repeatReceipt">是否是重复的订单凭据</param>
    /// <param name="receipt">回执,商户订单号等</param>
    public static void OnVerificationResult(int code, string goodsID, bool repeatReceipt, string receipt, string error, StoreName storeName)
    {
        try
        {
            if (onVerificationResultCallBack != null)
            {
                PayResult result = new PayResult(code, goodsID, error, storeName);
                Debug.Log("验证回调 code " + code + " goodsID " + goodsID);
                onVerificationResultCallBack(result);
            }
        }
        catch (Exception e)
        {
            Debug.LogError(e);
        }


        if (code == 0 || code == ErrorCodeDefine.StorePay_RepeatReceipt || repeatReceipt)
        {
            Debug.Log("订单确认" + goodsID);
            SDKManager.ConfirmPay(storeName.ToString(), goodsID, receipt);
        }

        //验证成功
        if (code != 0)
        {
            Debug.LogError("凭据验证失败! goodID:" + goodsID);
        }
    }
Exemple #5
0
        public App()
        {
            // SfdcSDK
            InitializeSfdcConfig();

            SDKManager.CreateClientManager(false);
            SDKManager.RootApplicationPage = typeof(VisualBrowserPage);
            SDKManager.EndLoginCallBack    = () => { Messenger.Default.Send(new UserLogInMessage()); };

            PlatformAdapter.Resolve <ISFApplicationHelper>().Initialize();

            // Set up the Logging Service and the custom log action function in the PlatformAdapter
            var target = new LogFileTarget();

            target.RetainDays = 10;
            LoggingServices.DefaultConfiguration.AddTarget(LoggingLevel.Information, target);
            PlatformAdapter.SetCustomLoggerAction(LoggingServices.LogAction);

            // Continue App setup
            InitializeComponent();
            Suspending += OnSuspending;
            Resuming   += OnResuming;

            // Setup the global crash handler
            GlobalCrashHandler.Configure();
        }
 /// <summary>
 /// 检测支付是否受限
 /// </summary>
 /// <returns></returns>
 public virtual void CheckPayLimit(int payAmount)
 {
     if (SDKManager.PayLimitCallBack != null)
     {
         SDKManager.PayLimitCallBack(false, payAmount);
     }
 }
 /// <summary>
 /// 触发登出
 /// </summary>
 public virtual void RealNameLogoutCallBack()
 {
     if (SDKManager.RealNameLogoutCallBack != null)
     {
         SDKManager.RealNameLogoutCallBack();
     }
 }
Exemple #8
0
    public void Awake()
    {
        _instance                   = this;
        Debuger.EnableLog           = false;
        Application.targetFrameRate = 50;
        isOpenMicrophone            = true;
        Screen.sleepTimeout         = SleepTimeout.NeverSleep;
        //保留主程序
        GameObject.DontDestroyOnLoad(gameObject);
        VersionManager.localVersion = Application.version;
        //Bugly、友盟等对接
        SDKManager.SetupBugly();
        //
        LayerManager.Setup();
        AssetPathUtil.Setup();
        LoaderManager.Setup();
        AlertUI.Setup();
        PopManager.Setup();

        /**
         * _loadingView = GameObject.Find("UI_Loading").AddComponent<SceneLoadingPanel>();
         * m_NOTICEUI = LayerManager.topUILayer.Find("NoticeUI").gameObject.AddComponent<NoticeUI>();
         * m_NOTICEUI.Online();
         * _loadingView.SetTitle("正在检查游戏版本...");
         */
    }
Exemple #9
0
 private void Login91Cancel(string msg)
 {
     if (!Singleton <LoginMode> .Instance.IsOpenLoginView)
     {
         SDKManager.SDK91GuestLogin();
     }
 }
Exemple #10
0
        /// <summary>
        ///     初始加载回调
        /// </summary>
        /// <param name="obj"></param>
        private void startLoadingFinish(Object obj)
        {
            EffectMgr.Instance.PreloadUIEffect(EffectId.UI_SelectRoleFeedback);
            EffectMgr.Instance.PreloadUIEffect(EffectId.UI_SelectRoleStage2);
            EffectMgr.Instance.PreloadUIEffect(EffectId.UI_SelectRoleStage1);
            EffectMgr.Instance.PreloadUIEffect(EffectId.UI_SelectRoleBurst);

            UpdateView.Instance.closeView();
            Singleton <StartLoadingView> .Instance.CloseView();

            if (AppStart.RunMode == 0)
            {
                PlatformLoginFinish();
            }
            else if (AppStart.RunMode == 1)
            {
                Singleton <WaitingView> .Instance.OpenView();

                SDKManager.SDKAutoUpdate();                 //先进行自动更新----modify by lixi
            }
            else if (AppStart.RunMode == 2)
            {
                AutoUpdateEnd();
            }
        }
    static void Init()
    {
        s_versionConfig   = (Dictionary <string, object>)FrameWork.Json.Deserialize(ReadVersionContent());
        s_hotUpdateConfig = ConfigManager.GetData(c_HotUpdateConfigName);

        string downLoadServicePath = null;
        bool   isTest = s_hotUpdateConfig[c_UseTestDownLoadPathKey].GetBool();

        //获取下载地址
        if (SDKManager.GetProperties(SDKInterfaceDefine.PropertiesKey_UpdateDownLoadPath, "") != "")
        {
            downLoadServicePath = SDKManager.GetProperties(SDKInterfaceDefine.PropertiesKey_UpdateDownLoadPath, "");
        }
        else
        {
            if (isTest)
            {
                downLoadServicePath = s_hotUpdateConfig[c_testDownLoadPathKey].GetString();
            }
            else
            {
                downLoadServicePath = s_hotUpdateConfig[c_downLoadPathKey].GetString();
            }
        }

        string downLoadPath = downLoadServicePath + "/" + platform + "/" + Application.version + "/";

        s_versionFileDownLoadPath   = downLoadPath + c_versionFileName.ToLower();
        s_ManifestFileDownLoadPath  = downLoadPath + AssetsManifestManager.c_ManifestFileName;
        s_resourcesFileDownLoadPath = downLoadPath;

        Debug.Log("=====>" + s_versionFileDownLoadPath);
    }
    /// <summary>
    /// 获得预支付订单
    /// </summary>
    /// <param name="e"></param>
    /// <param name="args"></param>
    private void OnPrePay(PrePay2Client e, object[] args)
    {
        Debug.LogWarning("OnPrePay=======partnerId==:" + e.prepay_id + "===" + e.storeName.ToString());

        //判断是否需要重发支付
        if (SDKManager.GetReSendPay(e.storeName.ToString()))
        {
            OnPayInfo onPayInfo = new OnPayInfo();
            onPayInfo.isSuccess = true;
            onPayInfo.goodsId   = e.goodsID;
            onPayInfo.storeName = e.storeName;
            onPayInfo.receipt   = e.mch_orderID;
            onPayInfo.price     = payInfo.price;
            PayReSend.Instance.AddPrePayID(onPayInfo);
        }

        if (SDKManager.GetPrePay(e.storeName.ToString()))
        {
            payInfo.orderID   = e.mch_orderID;
            payInfo.prepay_id = e.prepay_id;

            SDKManagerNew.Pay(payInfo);
            StartLongTimeNoResponse();
        }
    }
Exemple #13
0
    /// <summary>
    /// 检测实名总开关
    /// </summary>
    private void TestRealNameSwitch()
    {
        string l_openRealName = SDKManager.GetProperties(SDKInterfaceDefine.PropertiesKey_OpenRealName, "false");

        openRealName = (l_openRealName == "true");  //重打包工具控制总开关
        //上报服务器
    }
    private static void OnUserLoginEvent(UserLogin2Client e, object[] args)
    {
        activationCode = "";
        if (e.code == 0)
        {
            isLogin = true;
            GameDataMonitor.PushData("User", e.user, "玩家数据");

            SDKManager.UserID = e.user.userID;
        }

        if (OnUserLogin != null)
        {
            OnUserLogin(e);
        }
        if (e.reloginState)
        {
            return;
        }
        isClickLogin = false;
        if (e.code != 0)
        {
            Debug.LogError("Login error code:" + e.code);
            return;
        }
        ResendMessageManager.startResend = true;
        loginMsg.typeKey = e.user.typeKey;

        SDKManager.LogLogin(e.user.userID);
    }
Exemple #15
0
    /// <summary>
    /// Get application external data path (read & write)
    /// Path ends with '/'
    /// </summary>
    /// <returns></returns>
    public static string GetExternalDataPath()
    {
        if (m_externalDataPath == null)
        {
            if (Application.isEditor)
            {
                m_externalDataPath = dataPath;
            }
            else if (Application.isMobilePlatform || Application.isConsolePlatform)
            {
                #if UNITY_ANDROID
                m_externalDataPath = SDKManager.CallAliya <string>("GetExternalDataPath", "kzwg");
                if (string.IsNullOrEmpty(m_externalDataPath))
                #endif
                m_externalDataPath = Application.persistentDataPath;
            }
            else
            {
                m_externalDataPath = Application.dataPath;  // For standalone player.
            }
            m_externalDataPath = m_externalDataPath.Replace("\\", "/");
            if (!m_externalDataPath.EndsWith("/"))
            {
                m_externalDataPath += "/";
            }

            Logger.LogInfo("External data path set to: <color=#00DDFF><b>{0}</b></color>", m_externalDataPath);
        }

        return(m_externalDataPath);
    }
Exemple #16
0
 void ChangeScheme(string newScheme, string oldScheme)
 {
     SchemeDataService.ChangeScheme(newScheme);
     m_currentSchemeData  = SDKManager.LoadGameSchemeConfig();
     m_currentSelectIndex = GetCurrentSelectIndex();
     LoadSchemeData(m_currentSchemeData);
 }
        private void load()
        {
            try
            {
                String xmlfile = Application.ExecutablePath.Substring(0, Application.ExecutablePath.LastIndexOf("\\")) + "\\config.xml";
                if (File.Exists(xmlfile) == false)
                {
                    return;
                }

                XmlDocument doc = new XmlDocument();
                doc.Load(xmlfile);
                XmlNode root       = doc.SelectSingleNode("root");
                XmlNode u8pathnode = root.SelectSingleNode("u8path");

                ProjectConfig.getInstance().setU8Workspace(u8pathnode.InnerText);
                SDKManager.getInstance().readSDKDirectory();
                refreshGameList();

                doc.Save(xmlfile);
            }
            catch (System.Exception ex)
            {
                return;
            }
        }
    /// <summary>
    /// 切换方案
    /// 由于自动打包会调用这里,所以将切换宏定义的代码也放在此处,注意!
    /// </summary>
    /// <param name="SchemeName"></param>
    public static void ChangeScheme(string SchemeName)
    {
        SchemeData data          = SDKManager.LoadGameSchemeConfig();
        string     oldSchemeName = "None";

        Debug.Log("ChangeScheme " + SchemeName);

        if (!IsExitsSchemeName(SchemeName))
        {
            Debug.Log("->" + SchemeName + "<- 方案不存在! ");
            return;
        }

        if (data != null)
        {
            oldSchemeName = data.SchemeName;
        }

        //方案相同不切换
        if (SchemeName == oldSchemeName)
        {
            return;
        }

        //重新生成游戏内使用的配置
        SaveGameSchemeConfig(GetSchemeData(SchemeName));
        AssetDatabase.Refresh();
    }
Exemple #19
0
    public void Connect(Action <Session> onConnect = null)
    {
        if (connecting)
        {
            m_onConnect += onConnect;
            return;
        }

        Disconnect();

        m_onConnect += onConnect;

        state = SessionState.CONNECTING;

        var callback  = m_onConnect;
        var validHost = host;
        var family    = AddressFamily.Unknown;
        var hostInfo  = Util.ParseString <string>(SDKManager.GetValidHost(host), false, ',');

        if (hostInfo.Length != 2 || hostInfo[0] != "0" && hostInfo[0] != "1")
        {
            family = AddressFamily.Unknown;
            Logger.LogException("<b><color=#FFFFFF>[{0}]</color></b> Could not resolve host [{1}:{2}]! Family:{3}", m_typeName, host, port, hostInfo.Length > 0 ? hostInfo[0] : "-1");
        }
        else
        {
            family    = hostInfo[0] == "0" ? AddressFamily.InterNetwork : AddressFamily.InterNetworkV6;
            validHost = hostInfo[1];

            Logger.LogInfo("<b><color=#FFFFFF>[{0}]</color></b> Current Address: <b><color=#FAA000>[{1} -- {2}]</color></b>", m_typeName, family, validHost);
        }

        OnValidateHost(validHost, family, callback);
    }
Exemple #20
0
    static int SDKLogin(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 2);
        SDKManager obj = (SDKManager)LuaScriptMgr.GetNetObjectSelf(L, 1, "SDKManager");

        SDKManager.SDKFinish arg0      = null;
        LuaTypes             funcType2 = LuaDLL.lua_type(L, 2);

        if (funcType2 != LuaTypes.LUA_TFUNCTION)
        {
            arg0 = (SDKManager.SDKFinish)LuaScriptMgr.GetNetObject(L, 2, typeof(SDKManager.SDKFinish));
        }
        else
        {
            LuaFunction func = LuaScriptMgr.GetLuaFunction(L, 2);
            arg0 = (param0) =>
            {
                int top = func.BeginPCall();
                LuaScriptMgr.Push(L, param0);
                func.PCall(top, 1);
                func.EndPCall(top);
            };
        }

        obj.SDKLogin(arg0);
        return(0);
    }
    public void on_click_btn(int i)
    {
        string ret = null;

#if UNITY_ANDROID
        switch (i)
        {
        case 1:
            ret = SDKManager.CallApiReturn <string>("com.rongygame.util.XMsgTest", "GetGPS");
            LogMgr.E("CallApiReturn info:{0}", ret);
            break;

        case 2:
            ret = SDKManager.CallApiReturn <string>("com.rongygame.sdk.SDKApi", "OnGameMessageReturn",
                                                    "{\"method\":\"doTakePhoto\",\"param\":\"takephoto\"}");
            LogMgr.E("CallApiReturn info:{0}", ret);
            break;

        case 3:

            ret = SDKManager.CallApiReturn <string>("com.rongygame.sdk.SDKApi", "OnGameMessageReturn",
                                                    "{\"method\":\"doTakePhoto\",\"param\":\"other\"}");
            LogMgr.E("CallApiReturn info:{0}", ret);
            break;

        default:
            ret = "nothing";
            break;
        }
        lbLog.text = ret;
#endif
    }
Exemple #22
0
 private void AddSupportFunctionItems <T>()
     where T : CodeMapAttribute
 {
     this.AddFunctionItems(
         SDKManager.GetFunctions()
         .Where(f => f.Element.HasAttribute <T>()));
 }
Exemple #23
0
    public void ArcadeModel()
    {
        Dictionary <string, object> data = new Dictionary <string, object>();

        string difficultys = "";

        for (int i = 0; i < GameOptionService.DifficultyLevels.Count; i++)
        {
            difficultys += "|" + GameOptionService.DifficultyLevels[i];
        }

        string types = "";

        for (int i = 0; i < GameOptionService.PoemTypes.Count; i++)
        {
            types += "|" + GameOptionService.PoemTypes[i];
        }

        data.Add("GameType", "normal");
        data.Add("DifficultyLevels", difficultys);
        data.Add("PoemTypes", types);

        SDKManager.Log("StartGame", data);

        GameLogic.s_GameModel = GameModel.Arcade;
        PoemLibrary.SetPoemByTag(GameOptionService.DifficultyLevels, GameOptionService.PoemTypes);
        ApplicationStatusManager.EnterStatus <GameStatus>();
    }
Exemple #24
0
 /// <summary>
 /// 修改用户名按钮被点击
 /// </summary>
 /// <param name="go"></param>
 private void ChangeUserNameOnClick(GameObject go)
 {
     if (AppStart.RunMode != 0)
     {
         SDKManager.SDKChangeLoginUser();
     }
 }
Exemple #25
0
    private void OnGUI()
    {
        float buttonWidth = Screen.width * 0.2f;

        float buttonHeight = Screen.height * 0.1f;

        float positionX = Screen.width / 2f - buttonWidth / 2f;

        if (GUI.Button(new Rect(positionX, Screen.height * 0.05f, buttonWidth, buttonHeight), "初始化"))
        {
            SDKManager.GetSingleton().IUnityToSDK.Init();
        }
        if (GUI.Button(new Rect(positionX, Screen.height * 0.25f, buttonWidth, buttonHeight), "登入"))
        {
            SDKManager.GetSingleton().IUnityToSDK.Login();
        }
        if (GUI.Button(new Rect(positionX, Screen.height * 0.45f, buttonWidth, buttonHeight), "上传数据"))
        {
            SDKMessage message = SDKConfig.GetUploadInfo();

            SDKManager.GetSingleton().IUnityToSDK.UploadInfo(message);
        }
        if (GUI.Button(new Rect(positionX, Screen.height * 0.65f, buttonWidth, buttonHeight), "支付"))
        {
            SDKMessage message = SDKConfig.GetPayInfo();
            SDKManager.GetSingleton().IUnityToSDK.Pay(message);
        }
        if (GUI.Button(new Rect(positionX, Screen.height * 0.85f, buttonWidth, buttonHeight), "补充方法"))
        {
            SDKMessage message = new SDKMessage((int)SDKMessageType.Method0);
            SDKManager.GetSingleton().IUnityToSDK.Other(message);
        }
    }
Exemple #26
0
        /// <summary>
        /// 在版本更新完成后,才调用该函数,开启游戏初始化。
        /// step1:开始加载配置文件
        /// </summary>
        public void StartUp()
        {
            SDKManager.getInstance().sendNewbieguideDeviceUniqueIdentifier("2");
            _bStartUp = true;
            GameObject pMgrObj = GameObject.Find("ApplicationMgr");

            if (pMgrObj == null)
            {
                pMgrObj = new GameObject("ApplicationMgr");
                pMgrObj.transform.position = default(Vector3);
                _applicationMgr            = pMgrObj.AddComponent <ApplicationMgr>();
            }
            else
            {
                _applicationMgr = pMgrObj.GetComponent <ApplicationMgr>();
            }
            DontDestroyOnLoad(pMgrObj);

            BaseScene pSceneMono = GameSceneManager.getInstance().SceneMono;
            bool      isStartUp  = pSceneMono is StartUpScene;

            if (pSceneMono == null || !isStartUp)
            {
                //SceneConfig config = GameSceneManager.getInstance().GetSceneConfig(SceneName.s_StartupScene);
                GameSceneManager.getInstance().sceneLoadCompleteAndInit(SceneName.s_StartupScene, new SceneConfig());
            }

            base.Start();
            _startUpStep = 1;

            UtilTools.SetServerListTip("");
        }
Exemple #27
0
 private void Init()
 {
     Debug.Log("游戏启动");
     checkProperty  = 1f;
     Instance       = this;
     isCaught       = false;
     isHas          = false;
     isTakeAway     = true;
     isOpenPay      = true;
     isPaySucess    = false;
     isEnd          = false;
     getCode        = false;
     caughtTime     = 0;
     randomQuXian   = 1;  //默认就一种最慢的速度
     probability    = 30; //百分之15不打掉
     carwBasicCount = 100;
     winningTimes   = 6;  //抓中百分六
     gameStatus     = null;
     dic            = new Dictionary <int, List <ExcelTableEntity> >();
     //androidjava = Current();
     GetVoiceData();
     GetProbability();
     GetGameStatusData();
     DontDestroyOnLoad(gameObject);
 }
Exemple #28
0
    /// <summary>
    /// 游客登陆
    /// </summary>
    /// <param name="go"></param>
    private void OnTourisLoginHandler(GameObject go)
    {
        //UIManager.CreateWin(UIName.LOGIN_INPUT_WIN);
        if (ClientDefine.isWXLogin && !VersionData.IsReviewingVersion())
        {
            string md5Content = PlayerPrefs.GetString("accountServerLoginContent", "");
            if (!string.IsNullOrEmpty(md5Content))
            {
                UtilTools.ShowWaitWin(WaitFlag.LoginWin);
                LoginInputController.AccountServer_WXLogin(md5Content);
            }
            else
            {
                SDKManager.getInstance().CommonSDKInterface.login();
            }
        }
        else
        {
            var ctrl = UIManager.GetControler <LoginInputController>();
            StartCoroutine(ctrl.registerToAccountServerFast());
            //UtilTools.ShowWaitWin(WaitFlag.LoginWin, 5f);
            //快速登录
            //LoginController.AccountServer_QuickLogin();
        }

//        ctrl.LoginTouris();
    }
Exemple #29
0
    public void Register(string accName, string password, bool lockUI = true)
    {
        var accountInfo = new AccountInfo
        {
            name     = accName,
            password = password.GetMD5()
        };

        if (lockUI)
        {
            moduleGlobal.LockUI("", 0.1f);
        }

        WebRequestHelper.Register(accountInfo, reply =>
        {
            if (lockUI)
            {
                moduleGlobal.UnLockUI();
            }

            DispatchModuleEvent(EventRegister, reply.code);

            if (reply.code == 0)
            {
                SDKManager.Register(reply.data.ToString());
            }
        });
    }
Exemple #30
0
    /// <summary>
    /// 切换方案
    /// 由于自动打包会调用这里,所以将切换宏定义的代码也放在此处,注意!
    /// </summary>
    /// <param name="SchemeName"></param>
    public static void ChangeScheme(string SchemeName)
    {
        SchemeData data          = SDKManager.LoadGameSchemeConfig();
        string     oldSchemeName = "None";

        if (!IsExitsSchemeName(SchemeName))
        {
            Debug.Log("->" + SchemeName + "<- 方案不存在! ");
            return;
        }

        if (data != null)
        {
            oldSchemeName = data.SchemeName;
        }

        //方案相同不切换
        if (SchemeName == oldSchemeName)
        {
            return;
        }

        //重新生成游戏内使用的配置
        SaveGameSchemeConfig(GetSchemeData(SchemeName));

        if (IsExitsSchemeName(SchemeName))
        {
            Debug.Log("Index: " + GetSchemeIndex(SchemeName));

            //替换文件夹
            if (oldSchemeName != "None")
            {
                UnloadPluginFile(oldSchemeName);
                UnloadSchemeFile(oldSchemeName);
            }
            LoadPluginFile(SchemeName);
            LoadSchemeFile(SchemeName);

            //调整宏定义
            EditorExpand.ChangeDefine(new string[] { SchemeName }, new string[] { oldSchemeName });
        }
        else
        {
            //这部分代码实际上不会执行

            Debug.Log("不存在的方案名! " + SchemeName);
            if (oldSchemeName != "None")
            {
                //把当前方案收起来
                UnloadPluginFile(oldSchemeName);
                UnloadSchemeFile(oldSchemeName);

                //移除宏定义
                EditorExpand.ChangeDefine(new string[] {}, new string[] { oldSchemeName });
            }
        }

        AssetDatabase.Refresh();
    }