当前位置: 首页>>代码示例>>C#>>正文


C# LoadMode.ToString方法代码示例

本文整理汇总了C#中LoadMode.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# LoadMode.ToString方法的具体用法?C# LoadMode.ToString怎么用?C# LoadMode.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LoadMode的用法示例。


在下文中一共展示了LoadMode.ToString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnLevelLoaded

 public override void OnLevelLoaded(LoadMode mode)
 {
     base.OnLevelLoaded(mode);
     CurrentLoadMode = mode;
     try
     {
         if (Mod.DEBUG_LOG_ON && Mod.DEBUG_LOG_LEVEL > 0) { Helper.dbgLog("LoadMode:" + mode.ToString()); }
         if (Mod.IsEnabled == true)
         {
             // only setup redirect when in a real game
         /*  NewScenarioFromGame,8
             NewScenarioFromMap,9
             LoadScenario,10
             NewGameFromScenario,11
             UpdateScenarioFromGame,12
             UpdateScenarioFromMap,13
         */
             if (mode == LoadMode.LoadGame || mode == LoadMode.NewGame || mode==LoadMode.LoadMap ||mode==LoadMode.NewMap || mode== LoadMode.NewGame
                 || (int)mode == 8 || (int)mode == 9 || (int)mode == 10 || (int)mode == 11 || (int)mode == 12 || (int)mode == 13)
             {
                 if (Mod.DEBUG_LOG_ON) { Helper.dbgLog("Asset modes not detcted"); }
                 if (Mod.IsGuiEnabled) { SetupGui(); } //setup gui if we're enabled.
             }
             int a = (int)CurrentLoadMode;
         }
         else
         {
             //This should never happen.
             if (Mod.DEBUG_LOG_ON) { Helper.dbgLog("We fired when we were not even enabled active??"); }
             if (Mod.IsGuiEnabled) { RemoveGui(); }
         }
     }
     catch(Exception ex)
     { Helper.dbgLog("Error:", ex, true); }
 }
开发者ID:Knighth,项目名称:CSL-Show-More-Limits,代码行数:35,代码来源:Loader.cs

示例2: OnLevelLoaded

 public override void OnLevelLoaded(LoadMode mode)
 {
     base.OnLevelLoaded(mode);
     CurrentLoadMode = mode;
     try
     {
         if (Mod.DEBUG_LOG_ON && Mod.DEBUG_LOG_LEVEL > 0) { Helper.dbgLog("LoadMode:" + mode.ToString()); }
         if (Mod.IsEnabled == true)
         {
             // only setup redirect when in a real game
             if (mode == LoadMode.LoadGame || mode == LoadMode.NewGame || mode==LoadMode.LoadMap ||mode==LoadMode.NewMap )
             {
                 if (Mod.DEBUG_LOG_ON) { Helper.dbgLog("Asset modes not detcted"); }
                 if (Mod.IsGuiEnabled) { SetupGui(); } //setup gui if we're enabled.
             }
         }
         else
         {
             //This should never happen.
             if (Mod.DEBUG_LOG_ON) { Helper.dbgLog("We fired when we were not even enabled active??"); }
             if (Mod.IsGuiEnabled) { RemoveGui(); }
         }
     }
     catch(Exception ex)
     { Helper.dbgLog("Error:", ex, true); }
 }
开发者ID:Knighth,项目名称:Phantom-Lane-Remover,代码行数:26,代码来源:Loader.cs

示例3: OnLevelLoaded

        public override void OnLevelLoaded(LoadMode mode)
        {
            base.OnLevelLoaded(mode);
            try
            {
                if (Mod.DEBUG_LOG_ON && Mod.DEBUG_LOG_LEVEL > 0) { Helper.dbgLog("LoadMode:" + mode.ToString()); }
                if (Mod.IsEnabled == true & Mod.IsRedirectActive == false)
                {
                    // only setup redirect when in a real game
                    if (mode == LoadMode.LoadGame || mode == LoadMode.NewGame)
                    {
                        if (Mod.DEBUG_LOG_ON) { Helper.dbgLog("Map or Asset modes not detcted"); }
                        Mod.SetupRedirects();  //setup the redirects.

                        if (Mod.IsGuiEnabled) { SetupGui(); } //setup gui if we're enabled.
                    }
                }
                else if (Mod.IsEnabled == false & Mod.IsRedirectActive == true)
                {
                    //This should never happen.
                    if (Mod.DEBUG_LOG_ON) { Helper.dbgLog("Redirects were active when mod disabled?"); }
                    Mod.ReverseRedirects(); //attempt to revert redirects

                    if (Mod.IsGuiEnabled) { RemoveGui(); }
                }
            }
            catch(Exception ex)
            { Helper.dbgLog("Error:", ex, true); }
        }
开发者ID:Knighth,项目名称:CSLServiceReserve,代码行数:29,代码来源:Loader.cs

示例4: OnLevelLoaded

 /// <summary>
 /// Optional
 /// This core function will get called just after the Level - aka your map has been fully loaded.
 /// That means the game data has all been read from your file and the simulation is ready to go.
 /// </summary>
 /// <param name="mode">a LoadMode enum (ie newgame,newmap,loadgame,loadmap,newasset,loadassett)</param>
 public override void OnLevelLoaded(LoadMode mode)
 {
     base.OnLevelLoaded(mode);  //call the original implemenation first if does anything... it doesn't actually but whatever maybe some day it might.
     CurrentLoadMode = mode; //save this guy for later.
     try
     {
         if (SomeModName.DEBUG_LOG_ON && SomeModName.DEBUG_LOG_LEVEL > 0) { Logger.dbgLog("LoadMode:" + mode.ToString()); }
         if (SomeModName.isEnabled == true)
         {
             // only setup gui when in a real game, not in the asset editor
             if (mode == LoadMode.LoadGame || mode == LoadMode.NewGame || mode==LoadMode.LoadMap ||mode==LoadMode.NewMap )
             {
                 if (SomeModName.DEBUG_LOG_ON) { Logger.dbgLog("Asset modes not detcted, setting up gui."); }
                 SetupGui();  //setup gui
             }
         }
         else
         {
             //This should technically never happen, but why not account for it anyway.
             if (SomeModName.DEBUG_LOG_ON) { Logger.dbgLog("We fired when we were not even enabled active??"); }
             RemoveGui();
         }
     }
     catch(Exception ex)
     { Logger.dbgLog("Error:", ex, true); }
 }
开发者ID:Knighth,项目名称:Sample-SomeMod,代码行数:32,代码来源:SomeModNameLoader.cs


注:本文中的LoadMode.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。