本文整理汇总了C#中LoadMode类的典型用法代码示例。如果您正苦于以下问题:C# LoadMode类的具体用法?C# LoadMode怎么用?C# LoadMode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LoadMode类属于命名空间,在下文中一共展示了LoadMode类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: OnLevelLoaded
public override void OnLevelLoaded(LoadMode mode)
{
if (mode != LoadMode.LoadGame && mode != LoadMode.NewGame && mode != LoadMode.NewMap && mode != LoadMode.LoadMap)
return;
lastLoadMode_ = mode;
UIView view = UIView.GetAView();
UITabstrip tabStrip = null;
whatsNewPanelGameObject = new GameObject("whatsNewPanel");
this.whatsNewPanel = whatsNewPanelGameObject.AddComponent<WhatsNewPanel>();
this.whatsNewPanel.transform.parent = view.transform;
this.whatsNewPanel.Hide();
exportPanelGameObject = new GameObject("exportPanel");
this.exportPanel = exportPanelGameObject.AddComponent<ExportPanel>();
this.exportPanel.transform.parent = view.transform;
this.exportPanel.whatsNewPanel = whatsNewPanel;
this.exportPanel.Hide();
if (mode == LoadMode.NewGame || mode == LoadMode.LoadGame)
{
tabStrip = ToolsModifierControl.mainToolbar.component as UITabstrip;
}
else
{
tabStrip = UIView.Find<UITabstrip>("MainToolstrip");
}
buttonObject = UITemplateManager.GetAsGameObject("MainToolbarButtonTemplate");
buttonObject2 = UITemplateManager.GetAsGameObject("ScrollablePanelTemplate");
menuButton = tabStrip.AddTab("cimtographerMod", buttonObject, buttonObject2, new Type[] { }) as UIButton;
menuButton.eventClick += uiButton_eventClick;
}
开发者ID:GRANTSWIM4,项目名称:Cimtographer,代码行数:35,代码来源:MapperLoading.cs
示例2: OnLevelLoaded
public override void OnLevelLoaded(LoadMode mode)
{
if (mode != LoadMode.LoadGame && mode != LoadMode.NewGame && mode != LoadMode.NewMap && mode != LoadMode.LoadMap)
return;
lastLoadMode_ = mode;
UIView view = UIView.GetAView();
UITabstrip tabStrip = null;
whatsNewPanelGameObject = new GameObject("whatsNewPanel");
this.whatsNewPanel = whatsNewPanelGameObject.AddComponent<WhatsNewPanel>();
this.whatsNewPanel.transform.parent = view.transform;
this.whatsNewPanel.Hide();
exportPanelGameObject = new GameObject("exportPanel");
this.exportPanel = exportPanelGameObject.AddComponent<ExportPanel>();
this.exportPanel.transform.parent = view.transform;
this.exportPanel.whatsNewPanel = whatsNewPanel;
this.exportPanel.Hide();
if (mode == LoadMode.NewGame || mode == LoadMode.LoadGame)
{
tabStrip = ToolsModifierControl.mainToolbar.component as UITabstrip;
}
else
{
tabStrip = UIView.Find<UITabstrip>("MainToolstrip");
}
if (m_tabButton == null)
{
GameObject buttonGameObject = UITemplateManager.GetAsGameObject("MainToolbarButtonTemplate");
GameObject pageGameObject = UITemplateManager.GetAsGameObject("ScrollablePanelTemplate");
m_tabButton = tabStrip.AddTab("Road Namer", buttonGameObject, pageGameObject, new Type[] { }) as UIButton;
UITextureAtlas atlas = CimToolsHandler.CimToolBase.SpriteUtilities.GetAtlas("CimtographerIcons");
m_tabButton.eventClicked += uiButton_eventClick;
m_tabButton.tooltip = "Cimtographer";
m_tabButton.foregroundSpriteMode = UIForegroundSpriteMode.Fill;
if (atlas != null)
{
m_tabButton.atlas = atlas;
m_tabButton.normalFgSprite = "ToolbarFGIcon";
m_tabButton.focusedFgSprite = "ToolbarFGIcon";
m_tabButton.hoveredFgSprite = "ToolbarFGIcon";
m_tabButton.disabledFgSprite = "ToolbarFGIcon";
m_tabButton.pressedFgSprite = "ToolbarFGIcon";
m_tabButton.focusedBgSprite = "ToolbarBGFocused";
m_tabButton.hoveredBgSprite = "ToolbarBGHovered";
m_tabButton.pressedBgSprite = "ToolbarBGPressed";
}
else
{
Debug.LogError("Cimtographer: Could not find atlas.");
}
}
}
开发者ID:PropaneDragon,项目名称:Cimtographer,代码行数:60,代码来源:MapperLoading.cs
示例3: 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
示例4: OnLevelLoaded
public override void OnLevelLoaded(LoadMode mode)
{
EconomyManager em = Singleton<EconomyManager>.instance;
DifficultyManager d = Singleton<DifficultyManager>.instance;
if (mode == LoadMode.NewGame)
{
int moneyToAdd = (d.InitialMoney.Value - 70) * 100000;
em.AddResource(EconomyManager.Resource.LoanAmount, moneyToAdd, ItemClass.Service.None, ItemClass.SubService.None, ItemClass.Level.None);
}
if (mode == LoadMode.NewGame || mode == LoadMode.LoadGame)
{
for (int i = 0; i < 3; i++)
{
EconomyManager.Bank bank = em.m_properties.m_banks[i];
EconomyManager.LoanInfo li = bank.m_loanOffers[0];
li.m_amount = (int)Math.Round(0.01f * li.m_amount * d.LoanMultiplier.Value);
li.m_length = (int)Math.Round(0.01f * li.m_length * d.LoanMultiplier.Value);
bank.m_loanOffers[0] = li;
em.m_properties.m_banks[i] = bank;
//DebugOutputPanel.AddMessage(PluginManager.MessageType.Message, bank.m_bankName);
}
}
Achievements.Update();
PrefabsManager.UpdatePrefabs(false);
}
开发者ID:Hinaata,项目名称:Cities-Skyline-Difficulty-Tuning-Mod,代码行数:31,代码来源:LoadingExtension.cs
示例5: OnLevelLoaded
public override void OnLevelLoaded(LoadMode mode)
{
if (mode != LoadMode.LoadGame && mode != LoadMode.NewGame && mode != LoadMode.NewMap && mode != LoadMode.LoadMap)
return;
_mode = mode;
buildingWindowGameObject = new GameObject("buildingWindowObject");
var view = UIView.GetAView();
this.buildingWindow = buildingWindowGameObject.AddComponent<MapperWindow7>();
this.buildingWindow.transform.parent = view.transform;
this.buildingWindow.position = new Vector3(300, 122);
this.buildingWindow.Hide();
UITabstrip strip = null;
if (mode == LoadMode.NewGame || mode == LoadMode.LoadGame)
{
strip = ToolsModifierControl.mainToolbar.component as UITabstrip;
}
else
{
strip = UIView.Find<UITabstrip>("MainToolstrip");
}
buttonObject = UITemplateManager.GetAsGameObject("MainToolbarButtonTemplate");
buttonObject2 = UITemplateManager.GetAsGameObject("ScrollablePanelTemplate");
menuButton = strip.AddTab("mapperMod", buttonObject, buttonObject2, new Type[] { }) as UIButton;
menuButton.eventClick += uiButton_eventClick;
}
开发者ID:GlitchedMan,项目名称:Cities-Skylines-Mapper,代码行数:29,代码来源:MapperLoading.cs
示例6: OnLevelLoaded
public override void OnLevelLoaded(LoadMode mode)
{
if (mode == LoadMode.NewGame || mode == LoadMode.LoadGame)
{
Redirector.PerformRedirections((ulong)PathfindingOptions);
}
}
开发者ID:Katalyst6,项目名称:CSL.TransitAddonMod,代码行数:7,代码来源:PathfindingModule.Loading.cs
示例7: OnLevelLoaded
public override void OnLevelLoaded(LoadMode mode)
{
if (!(mode == LoadMode.LoadGame || mode == LoadMode.NewGame))
{
return;
}
try
{
LoadResources();
if (buildTool == null)
{
GameObject gameController = GameObject.FindWithTag("GameController");
buildTool = gameController.AddComponent<InGameTerrainTool>();
Texture2D tex = loadTextureFromAssembly("TerraformTool.builtin_brush_4.png", false);
buildTool.m_atlas = terraform_atlas;
buildTool.CreateButtons();
buildTool.m_brush = tex;
buildTool.m_mode = InGameTerrainTool.Mode.Point;
buildTool.enabled = false;
GameObject.FindObjectOfType<ToolController>().Tools[0].enabled = true;
}
}
catch (Exception e)
{
Debug.Log(e.ToString());
}
}
开发者ID:firefrorefiddle,项目名称:SkylinesTerraform,代码行数:28,代码来源:Mod.cs
示例8: OnLevelLoaded
public override void OnLevelLoaded(LoadMode mode)
{
_mode = mode;
// don't load mod in asset and map editor
if (mode != LoadMode.LoadGame && mode != LoadMode.NewGame)
return;
// attach extended panels
var view = UIView.GetAView();
var goBus = new GameObject("ExtendedBusPanel");
_extendedBusPanel = goBus.AddComponent<UITransportPanel>();
_extendedBusPanel.transform.parent = view.transform;
_extendedBusPanel.Type = TransportInfo.TransportType.Bus;
var goMetro = new GameObject("ExtendedMetroPanel");
_extendedMetroPanel = goMetro.AddComponent<UITransportPanel>();
_extendedMetroPanel.transform.parent = view.transform;
_extendedMetroPanel.Type = TransportInfo.TransportType.Metro;
var goTrain = new GameObject("ExtendedTrainPanel");
_extendedTrainPanel = goTrain.AddComponent<UITransportPanel>();
_extendedTrainPanel.transform.parent = view.transform;
_extendedTrainPanel.Type = TransportInfo.TransportType.Train;
HookIntoNativeUI();
}
开发者ID:asceth,项目名称:Skylines-ExtendedPublicTransport,代码行数:28,代码来源:Mod.cs
示例9: OnLevelLoaded
public override void OnLevelLoaded(LoadMode mode)
{
base.OnLevelLoaded(mode);
Pillars.Initialize();
NoPillarsUI.Initialize();
NoPillarsMonitor.Initialize();
}
开发者ID:earalov,项目名称:Skylines-NoPillars,代码行数:7,代码来源:LoadingExtension.cs
示例10: OnLevelLoaded
public override void OnLevelLoaded(LoadMode mode)
{
if (ThreadingExtension.Instance != null)
{
ThreadingExtension.Instance.OnLevelLoaded(mode);
}
}
开发者ID:EmperorOfDoom,项目名称:change-road-height,代码行数:7,代码来源:LoadingExtension.cs
示例11: OnLevelLoaded
public override void OnLevelLoaded(LoadMode mode)
{
if (mode == LoadMode.LoadAsset || mode == LoadMode.NewAsset)
{
SelectAIPanel.Insert();
}
}
开发者ID:dluechoy,项目名称:BuildingAIChanger,代码行数:7,代码来源:BuildingAIChanger.cs
示例12: OnLevelLoaded
public override void OnLevelLoaded (LoadMode mode) {
// See https://gist.github.com/reima/9ba51c69f65ae2da7909
var ui = UIView.GetAView();
var button = (UIButton) ui.AddUIComponent (typeof(UIButton));
// Set the button's text and size.
button.text = "Deduplicate Trees";
button.width = 200;
button.height = 30;
// Style the button to look like a menu button.
button.normalBgSprite = "ButtonMenu";
button.disabledBgSprite = "ButtonMenuDisabled";
button.hoveredBgSprite = "ButtonMenuHovered";
button.focusedBgSprite = "ButtonMenuFocused";
button.pressedBgSprite = "ButtonMenuPressed";
button.textColor = new Color32(255, 255, 255, 255);
button.disabledTextColor = new Color32(7, 7, 7, 255);
button.hoveredTextColor = new Color32(7, 132, 255, 255);
button.focusedTextColor = new Color32(255, 255, 255, 255);
button.pressedTextColor = new Color32(30, 30, 44, 255);
button.playAudioEvents = true;
// Place the button.
// FIXME: Might overlap some other mods' buttons. (Traffic++?)
button.transformPosition = new Vector3(-1.65f, 0.97f);
// Set the callback for clicks.
button.eventClick += OnButtonClick;
}
开发者ID:WickedA,项目名称:skylines-tree-deduplicator,代码行数:26,代码来源:Main.cs
示例13: CreateToolbars
public static void CreateToolbars(LoadMode loadMode)
{
foreach (var plugin in plugins)
{
plugin.CreateToolbars(loadMode);
}
}
开发者ID:earalov,项目名称:Skylines-NaturalResourcesBrush,代码行数:7,代码来源:Plugins.cs
示例14: OnLevelLoaded
public override sealed void OnLevelLoaded(LoadMode mode)
{
_mode = mode;
// Don't load in asset and map editor
if (mode != LoadMode.LoadGame && mode != LoadMode.NewGame)
return;
try
{
ModLogger.Debug("Creating main window");
// Get a handle to the main game view
UIView aView = UIView.GetAView();
// Create the gameobject and attach a mainwindow instance
GameObject goMainWindow = new GameObject(WorkshopMonitorMainWindowGameObjectName);
_mainWindow = goMainWindow.AddComponent<UIMainWindow>();
_mainWindow.transform.parent = aView.transform;
ModLogger.Debug("Main window created");
}
catch (Exception ex)
{
ModLogger.Error("An error occured while creating the main window");
ModLogger.Exception(ex);
}
}
开发者ID:gertjanstulp,项目名称:CSWorkshopMonitor,代码行数:28,代码来源:UILoader.cs
示例15: ModuleBase
protected ModuleBase(bool iocContainerCanBeNull, LoadMode supportedModes = LoadMode.All, int priority = DefaultModulePriority)
{
_iocContainerCanBeNull = iocContainerCanBeNull;
_priority = priority;
_supportedModes = supportedModes;
_locker = new object();
}
开发者ID:dbeattie71,项目名称:MugenMvvmToolkit,代码行数:7,代码来源:ModuleBase.cs
示例16: ModuleBase
protected ModuleBase(bool iocContainerCanBeNull, LoadMode supportedModes = LoadMode.All, int priority = InitializationModulePriority - 1)
{
_iocContainerCanBeNull = iocContainerCanBeNull;
_priority = priority;
_supportedModes = supportedModes;
_locker = new object();
}
开发者ID:sami1971,项目名称:MugenMvvmToolkit,代码行数:7,代码来源:ModuleBase.cs
示例17: OnLevelLoaded
public override void OnLevelLoaded(LoadMode mode)
{
//Turns out this is the wrong way to do it.
//ReplacePanels();
//And finally with the road options panel.
RoadsOptionPanel[] roadsOptionPanels = UnityEngine.Object.FindObjectsOfType<RoadsOptionPanel>();
foreach (RoadsOptionPanel roadsOptionPanel in roadsOptionPanels)
{
GameObject roadsOptionsPanelObject = roadsOptionPanel.gameObject;
RoadsOptionFinePanel roadsOptionFinePanel = roadsOptionsPanelObject.AddComponent<RoadsOptionFinePanel>();
Object.Destroy(roadsOptionPanel);
}
//Find the tool controller, re-make its tool list, and force a re-make of the ToolsModifierControl tool list.
ToolController toolController = UnityEngine.Object.FindObjectOfType<ToolController>();
if (toolController != null)
{
NetToolFine netToolFine = toolController.gameObject.AddComponent<NetToolFine>();
NetTool netTool = toolController.gameObject.GetComponent<NetTool>();
FieldInfo toolControllerField = typeof(ToolController).GetField("m_tools", BindingFlags.Instance | BindingFlags.NonPublic);
if (toolControllerField != null)
toolControllerField.SetValue(toolController, toolController.GetComponents<ToolBase>());
FieldInfo toolModifierDictionary = typeof(ToolsModifierControl).GetField("m_Tools", BindingFlags.Static | BindingFlags.NonPublic);
if (toolModifierDictionary != null)
toolModifierDictionary.SetValue(null, null);
}
//if(mode == LoadMode.LoadAsset || mode == LoadMode.NewAsset) // || mode == LoadMode.LoadMap || mode == LoadMode.NewMap)
{
GameObject panelReplacer = UnityEngine.Object.Instantiate(new GameObject());
panelReplacer.AddComponent<PanelReplacer>();
panelReplacer.name = "PanelReplacer";
}
}
开发者ID:FIDOCABRA,项目名称:Skylines-FineRoadHeights,代码行数:34,代码来源:FineRoadHeightsLoadingExtension.cs
示例18: OnLevelLoaded
public override void OnLevelLoaded(LoadMode mode)
{
EconomyManager em = Singleton<EconomyManager>.instance;
DifficultyManager d = Singleton<DifficultyManager>.instance;
if (mode == LoadMode.NewGame)
{
int moneyToAdd = (d.InitialMoney.Value - 70) * 100000;
em.AddResource(EconomyManager.Resource.LoanAmount, moneyToAdd, ItemClass.Service.None, ItemClass.SubService.None, ItemClass.Level.None);
}
if (mode == LoadMode.NewGame || mode == LoadMode.LoadGame)
{
for (int i = 0; i < 3; i++)
{
EconomyManager.Bank bank = em.m_properties.m_banks[i];
EconomyManager.LoanInfo li = bank.m_loanOffers[0];
int newAmount = (int)Math.Round(li.m_amount * 0.01f * d.LoanMultiplier.Value);
int newLength = (int)Math.Round(li.m_length * (1 + 0.01f * d.LoanMultiplier.Value) / 2f); // Halve the effect to prevent too long loan length.
Helper.ValueChangedMessage(bank.m_bankName, "Loan amount", li.m_amount, newAmount);
Helper.ValueChangedMessage(bank.m_bankName, "Loan length", li.m_length, newLength);
li.m_amount = newAmount;
li.m_length = newLength;
bank.m_loanOffers[0] = li;
em.m_properties.m_banks[i] = bank;
}
}
Achievements.Update();
PrefabsManager.UpdatePrefabs(false);
NetManager.UpdateSlopes(false);
}
开发者ID:ZenyaIse,项目名称:Cities-Skyline-Difficulty-Tuning-Mod,代码行数:35,代码来源:LoadingExtension.cs
示例19: AddXMLLoader
private void AddXMLLoader(IXMLLoader loader, LoadMode mode)
{
InitXMLLoader(loader);
if (loader.AppliesTo != null && loader.SupportsMode(mode))
{
m_xmlLoaders.Add(loader.AppliesTo, loader);
}
}
开发者ID:JatinR,项目名称:quest,代码行数:8,代码来源:ElementLoaders.cs
示例20: Show
public const Int32 AW_BLEND = 0x00080000; // 使用淡入效果。只有当hWnd为顶层窗口的时候才可以使用此标志
#endregion*************************************************
#region ***********************方 法***********************
/// <summary>
/// 构造方法
/// </summary>
/// <param name="loadMode">加载模式</param>
/// <param name="message">消息正文</param>
public static void Show(LoadMode loadMode, string message)
{
FormMode = loadMode;
ShowMessage = message;
FormMessageBox box = new FormMessageBox();
box.Show();
}
开发者ID:775116851,项目名称:GPSmallTools,代码行数:21,代码来源:FormMessageBox.cs
注:本文中的LoadMode类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论