本文整理汇总了C#中LoadMode类的典型用法代码示例。如果您正苦于以下问题:C# LoadMode类的具体用法?C# LoadMode怎么用?C# LoadMode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LoadMode类属于命名空间,在下文中一共展示了LoadMode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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.");
}
}
}
示例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); }
}
示例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);
}
示例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;
}
示例6: OnLevelLoaded
public override void OnLevelLoaded(LoadMode mode)
{
if (mode == LoadMode.NewGame || mode == LoadMode.LoadGame)
{
Redirector.PerformRedirections((ulong)PathfindingOptions);
}
}
示例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());
}
}
示例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();
}
示例9: OnLevelLoaded
public override void OnLevelLoaded(LoadMode mode)
{
base.OnLevelLoaded(mode);
Pillars.Initialize();
NoPillarsUI.Initialize();
NoPillarsMonitor.Initialize();
}
示例10: OnLevelLoaded
public override void OnLevelLoaded(LoadMode mode)
{
if (ThreadingExtension.Instance != null)
{
ThreadingExtension.Instance.OnLevelLoaded(mode);
}
}
示例11: OnLevelLoaded
public override void OnLevelLoaded(LoadMode mode)
{
if (mode == LoadMode.LoadAsset || mode == LoadMode.NewAsset)
{
SelectAIPanel.Insert();
}
}
示例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;
}
示例13: CreateToolbars
public static void CreateToolbars(LoadMode loadMode)
{
foreach (var plugin in plugins)
{
plugin.CreateToolbars(loadMode);
}
}
示例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);
}
}
示例15: ModuleBase
protected ModuleBase(bool iocContainerCanBeNull, LoadMode supportedModes = LoadMode.All, int priority = DefaultModulePriority)
{
_iocContainerCanBeNull = iocContainerCanBeNull;
_priority = priority;
_supportedModes = supportedModes;
_locker = new object();
}