예제 #1
0
 //用户继续游戏,扣币函数
 public static void PlayerContinueGamePayCoins(IParkourPlayer_Xiong.PlayerIndex index)
 {
     //记录一次持续
     UniGameRecordData.PlayerContinueIntoGame();
     //如果是免费模式就不支付了
     if (UniGameOptionsDefine.chargeMode == UniInsertCoinsOptionsFile.GameChargeMode.Mode_Free)
     {
         return;
     }
     //if (GameOptionsDefine.OneChargeModeContinueGame == GameOptionsDefine.GameChargeMode.Mode_Free)
     //{
     //    return;
     //}
     //不足够支付不记录
     if (GetPlayerCoins(index) < UniGameOptionsDefine.ContinueGameCoins)
     {
         throw new Exception("not have enough coins!");
     }
     RedPlayerCoins(UniGameOptionsDefine.ContinueGameCoins, index);
 }
    public static void Initialization()
    {
//#if _IgnoreVerify
//#else
        if (m_VerifyEnvironmentObj.VerifyIsSucceed == false)
        {
            return;
        }
//#endif //_IgnoreVerify
        //获取系统编号
        try
        {
            HelperInterface.ProduceActivateId.GetCurrentProduceActivateId(ref produceActivateId);
        }
        catch (System.Exception ex)
        {
            Error(string.Format("获取当前系统编号错误:{0}", ex.ToString()));
            return;
        }
        try
        {
            gameResource = new UniGameResources();
            gameResource.Initialization();
        }
        catch (System.Exception ex)
        {
            Error(string.Format("加载资源清单错误:{0}", ex.ToString()));
            return;
        }
        try
        {
            //载入系统设置
            SystemCommand.Initialization(gameResource.LoadResource_XmlFile("systemcommand.xml"));
            //加载游戏默认配置
            UniGameOptionsDefine.LoadGameOptionsDefault(gameResource);
        }
        catch (System.Exception ex)
        {
            Error(string.Format("载入系统设置错误:{0}", ex.ToString()));
            return;
        }
        try
        {
            //加载游戏当前配置
            UniGameOptionsDefine.LoadGameOptionsDefine();
            //加载游戏记录
            UniGameRecordData.LoadAllRecord(gameResource);
            //初始化控制台
            //控制台除了控制和保留一些中间值
            //控制加载过程会覆写一些固化在配置文件内的系统设定
            m_ConsoleCenter = new ConsoleCenter();
            m_ConsoleCenter.Initialization();
        }
        catch (System.Exception ex)
        {
            Error(string.Format("初始化控制台错误:{0}", ex.ToString()));
            return;
        }
        //初始化输入设备
        try
        {
            InputDevice.Initialization();
        }
        catch (System.Exception ex)
        {
            Error(string.Format("初始化输入设备错误:{0}", ex.ToString()));
            return;
        }
        //进行语言清单初始化
        try
        {
            //设置游戏选项里的语言定义
            gameResource.currentLanguageDefine = UniGameOptionsDefine.gameLanguage;
            //载入语言清单
            gameResource.LoadLanguageResourcesInventory();
        }
        catch (System.Exception ex)
        {
            Error(string.Format("加载系统语言清单错误:{0}", ex.ToString()));
            return;
        }

        if (GameRootInitializationSucceedEvent != null)
        {
            GameRootInitializationSucceedEvent(null, null);
        }
    }
예제 #3
0
    public static void Initialization()
    {
        try
        {
            gameResource = new UniGameResources();
            gameResource.Initialization();
        }
        catch (System.Exception ex)
        {
            Error(string.Format("加载资源清单错误:{0}", ex.ToString()));
            return;
        }
        try
        {
            //载入系统设置
            SystemCommand.Initialization(gameResource.LoadResource_XmlFile("systemcommand.xml"));
            //加载游戏默认配置
            UniGameOptionsDefine.LoadGameOptionsDefault(gameResource);
        }
        catch (System.Exception ex)
        {
            Error(string.Format("载入系统设置错误:{0}", ex.ToString()));
            return;
        }
        try
        {
            //加载游戏当前配置
            UniGameOptionsDefine.LoadGameOptionsDefine();
            //加载游戏记录
            UniGameRecordData.LoadAllRecord(gameResource);
            //初始化控制台
            //控制台除了控制和保留一些中间值
            //控制加载过程会覆写一些固化在配置文件内的系统设定
            m_ConsoleCenter = new ConsoleCenter();
            m_ConsoleCenter.Initialization();
        }
        catch (System.Exception ex)
        {
            Error(string.Format("初始化控制台错误:{0}", ex.ToString()));
            return;
        }
        //初始化输入设备
        try
        {
            InputDevice.Initialization();
        }
        catch (System.Exception ex)
        {
            Error(string.Format("初始化输入设备错误:{0}", ex.ToString()));
            return;
        }
        //进行语言清单初始化
        try
        {
            //设置游戏选项里的语言定义
            gameResource.currentLanguageDefine = UniGameOptionsDefine.gameLanguage;
            //载入语言清单
            gameResource.LoadLanguageResourcesInventory();
        }
        catch (System.Exception ex)
        {
            Error(string.Format("加载系统语言清单错误:{0}", ex.ToString()));
            return;
        }
        //载入游戏配置数据
        try
        {
            IGamerProfile.LoadGameConfigData();
        }
        catch (System.Exception ex)
        {
            Error(string.Format("加载游戏配置数据错误:{0}", ex.ToString()));
            return;
        }


        if (GameRootInitializationSucceedEvent != null)
        {
            GameRootInitializationSucceedEvent(null, null);
        }
    }