本文整理汇总了C#中GameScenes类的典型用法代码示例。如果您正苦于以下问题:C# GameScenes类的具体用法?C# GameScenes怎么用?C# GameScenes使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GameScenes类属于命名空间,在下文中一共展示了GameScenes类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ChangeScene
private void ChangeScene(GameScenes pNewScene)
{
for (int i = 0; i < Cameras.Count; ++i)
{
Cameras[i].gameObject.SetActive(false);
if (i == (int)pNewScene)
{
Cameras[i].gameObject.SetActive(true);
}
}
switch (pNewScene)
{
case GameScenes.LOGO:
break;
case GameScenes.MAIN_MENU:
break;
case GameScenes.OPTIONS:
break;
case GameScenes.CREDITS:
break;
case GameScenes.GAME:
GameObject.Find("GameManager").GetComponent<GameManager>().Initialize();
break;
}
mCurrentGameScene = pNewScene;
}
示例2: gameSceneEvent
public void gameSceneEvent(GameScenes scene)
{
if (!KCT_GameStates.settings.enabledForSave) return;
List<GameScenes> validScenes = new List<GameScenes> { GameScenes.SPACECENTER, GameScenes.TRACKSTATION, GameScenes.SPH, GameScenes.EDITOR };
if (validScenes.Contains(scene))
{
//Check for simulation save and load it.
if (System.IO.File.Exists(KSPUtil.ApplicationRootPath + "saves/" + HighLogic.SaveFolder + "/KCT_simulation_backup.sfs"))
{
KCT_Utilities.LoadSimulationSave();
}
}
if (!HighLogic.LoadedSceneIsFlight && scene == GameScenes.FLIGHT && KCT_GameStates.flightSimulated) //Backup save at simulation start
{
KCT_Utilities.MakeSimulationSave();
}
if (HighLogic.LoadedScene == scene && (scene == GameScenes.EDITOR || scene == GameScenes.SPH)) //Fix for null reference when using new or load buttons in editor
{
GamePersistence.SaveGame("persistent", HighLogic.SaveFolder, SaveMode.OVERWRITE);
}
if (scene == GameScenes.MAINMENU)
{
KCT_GameStates.reset();
KCT_GameStates.firstStart = true;
KCT_Utilities.disableSimulationLocks();
InputLockManager.RemoveControlLock("KCTLaunchLock");
}
}
示例3: SetTargetScene
private static void SetTargetScene(ProtoScenarioModule psm, GameScenes scene)
{
if (!psm.targetScenes.Any(s => s == scene))
{
psm.targetScenes.Add(scene);
}
}
示例4: OnGameSceneLoadRequested
void OnGameSceneLoadRequested(GameScenes scene)
{
if (scene == GameScenes.SPACECENTER)
{
if (Planetarium.GetUniversalTime() > 300)
{
DefaultSystem();
showGUI = false;
}
else if (File.Exists(KSPUtil.ApplicationRootPath + "/saves/" + HighLogic.SaveFolder + "/PlanetRandomizer.cfg"))
{
print("Loading System");
PlanetSettings.Load(KSPUtil.ApplicationRootPath + "/saves/" + HighLogic.SaveFolder + "/PlanetRandomizer.cfg");
RebuildSystem();
}
else if (!File.Exists(KSPUtil.ApplicationRootPath + "/saves/" + HighLogic.SaveFolder + "/PlanetRandomizer.cfg"))
{
DefaultSystem();
print("Showing GUI");
showGUI = true;
}
}
/*if (scene == GameScenes.MAINMENU)
{
PlanetSettings.Load(KSPUtil.ApplicationRootPath + "/GameData/PlanetRandomizer/Resources/PlanetRandomizer.cfg");
DefaultSystem();
}*/
}
示例5: GameSceneLoadRequested
private void GameSceneLoadRequested(GameScenes scene)
{
if (scene != GameScenes.MAINMENU) {
GameEvents.onGameSceneLoadRequested.Remove(GameSceneLoadRequested);
mainMenu.envLogic.GoToStage(0);
}
}
示例6: OnLevelLoaded
private void OnLevelLoaded(GameScenes scene)
{
//call this every scene that needs BetterTimeWarp
if (scene == GameScenes.FLIGHT || scene == GameScenes.SPACECENTER || scene == GameScenes.TRACKSTATION)
{
BetterTimeWarp.Instance = gameObject.AddComponent<BetterTimeWarp> ();
}
}
示例7: removeButton
private void removeButton(GameScenes scene)
{
if (stockToolbarButton != null)
{
ApplicationLauncher.Instance.RemoveModApplication(stockToolbarButton);
stockToolbarButton = null;
}
}
示例8: onGameSceneLoadRequested
public void onGameSceneLoadRequested(GameScenes GameScene)
{
if (GameScene == GameScenes.MAINMENU)
{
setIcon(Utilities.getTexture("FPSLimiter", "SmallUtilities/FPSLimiter/Textures"));
GameEvents.onGameSceneLoadRequested.Remove(onGameSceneLoadRequested);
}
}
示例9: removeButton
private void removeButton(GameScenes scene)
{
if (SCANappLauncherButton != null)
{
ApplicationLauncher.Instance.RemoveModApplication(SCANappLauncherButton);
SCANappLauncherButton = null;
}
}
示例10: Event_OnGameSceneLoadRequested
public void Event_OnGameSceneLoadRequested(GameScenes scene)
{
Log("Destroying Flight HUD");
hud.Shutdown();
Destroy(hud);
hud = null;
Log("Unhooking event");
GameEvents.onGameSceneLoadRequested.Remove(Event_OnGameSceneLoadRequested);
}
示例11: dEstroy
public void dEstroy(GameScenes g)
{
GameEvents.onGUIApplicationLauncherReady.Remove(OnGUIReady);
if (appButton != null)
{
ApplicationLauncher.Instance.RemoveModApplication(appButton);
}
}
示例12: DisableMapSO
private void DisableMapSO(GameScenes scene)
{
if (!isHomeworld && isLoaded)
{
if (OnDemandStorage.DisableBody(base.sphere.name))
{
Debug.Log("[OD]: Disabled Body " + base.sphere.name);
isLoaded = false;
}
}
}
示例13: onLevelWasLoaded
// Note: KSP's GameEvents.onLevelWasLoaded has the lower-case 'on' instead of usual 'On'
private void onLevelWasLoaded(GameScenes scene)
{
if (scene != GameScenes.SPACECENTER)
return;
if (!RTSettings.Instance.FirstStart)
return;
// open here the option dialog for the first start
RTLog.Notify("First start of RemoteTech!");
_optionWindow.Show();
RTSettings.Instance.FirstStart = false;
}
示例14: onSceneChange
private void onSceneChange(GameScenes g)
{
switch (g)
{
case GameScenes.LOADING:
case GameScenes.CREDITS:
case GameScenes.LOADINGBUFFER:
case GameScenes.MAINMENU:
case GameScenes.PSYSTEM:
case GameScenes.SETTINGS:
case GameScenes.EDITOR:
return;
}
progressParser.Loaded = false;
Debug.Log("[Progress Tracking Parser] Initializing Progress Parser...");
progressParser.initialize();
}
示例15: OnLevelLoaded
private void OnLevelLoaded(GameScenes scene)
{
if (Settings.AllowEditors)
{
foreach (var editor in editorTypes.Where(e => e.Value.Contains(scene)))
{
try
{
GameObject obj = new GameObject (editor.Key.Name);
obj.AddComponent (editor.Key);
obj.SetActive (true);
Utils.Log ("IngameEditor " + editor.Key.Name + " created");
}
catch(Exception e)
{
Utils.LogError ("Failed to load editor: " + editor.Key.Name);
Debug.LogException (e);
}
}
}
}