public IGamerProfile()
 {
     IGamerProfile.myInstance = this;
 }
Esempio n. 2
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);
        }
    }