Beispiel #1
0
    protected override void OnEnterItem(uint ItemId)
    {
        switch (ItemId)
        {
        case 0x2B87E8FA:    //ControlPanel_4 CRC32HashCode
            optionsProcess.CurrentControlPanelName = "ControlPanelGameOptions.prefab";
            break;

        case 0x5C80D86C:    //ControlPanel_5 CRC32HashCode
            optionsProcess.CurrentControlPanelName = "ControlPanelInsertCoins.prefab";
            break;

        case 0xB28EB940:    //ControlPanel_7 CRC32HashCode
            //GameRoot.gameProcessControl.ActivateProcess(typeof(SelfCheckingModalProcess));
            RestartGame();
            break;

        case 0x2231A4D1:    //ControlPanel_8 CRC32HashCode
            UniGameOptionsDefine.RemoveAllOptions();
            SetItemText(0x2231A4D1, GameRoot.gameResource.LoadLanguageResource_Text("ControlPanel_8") + "[succeed]");
            break;
        }
    }
 //初始化函数
 public override void Initialization()
 {
     //首先在启动过程中先查看是否出现了错误,如果出现了错误需要显示错误信息
     //然后就不进行下面的过程了
     if (ErrMessageBox.IsShowErrMessageBox)
     {
         ErrMessageBox.ShowErrMessage("游戏启动发生错误,停止自检过程!");
         return;
     }
     //进入游戏待机画面
     base.Initialization();
     guiModule = GameRoot.gameResource.LoadResource_Prefabs("SelfCheckingWindows.prefab").GetComponent <GuiModule>();
     //创建出来自检画面
     guiModule.mainGroup.AutoWidth       = new GuiVector2(1.0f, 0.0f);
     guiModule.mainGroup.AutoHeight      = new GuiVector2(1.0f, 0.0f);
     guiModule.mainGroup.BackgroupSeting = new GuiBackgroup(guiModule.skin.box);
     textdoc            = guiModule.RegisterGuiLableTextDoc("", "", 0.1f, 0.1f, guiModule.skin.label, Color.white, int.MaxValue);
     textdoc.AutoWidth  = new GuiVector2(1.0f, 0.0f);
     textdoc.AutoHeight = new GuiVector2(1.0f, 0.0f);
     //再次加载游戏配置信息,因为从控制台退出后也是会重新开始这个过程的
     UniGameOptionsDefine.LoadGameOptionsDefine();
     //显示非致命错误
     if (GameRoot.non_fatal_error_list != null)
     {
         ShowMessage("发生非致命错误:");
         for (int i = 0; i < GameRoot.non_fatal_error_list.Count; i++)
         {
             ShowMessage(GameRoot.non_fatal_error_list[i]);
         }
         GameRoot.non_fatal_error_list = null;
         ShowMessage("");
         ShowMessage("");
     }
     checkedEvent = CheckedEvent.Eve_Start;
     SelfCheckingProcess(null);
 }
    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);
        }
    }
Beispiel #4
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);
        }
    }