本文整理汇总了C#中GameScenes.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# GameScenes.ToString方法的具体用法?C# GameScenes.ToString怎么用?C# GameScenes.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GameScenes
的用法示例。
在下文中一共展示了GameScenes.ToString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LateUpdate
public void LateUpdate()
{
try
{
if (HighLogic.LoadedScene != _lastScene)
{
_lastScene = HighLogic.LoadedScene;
Util.Log("Saw scene switch to {0}", _lastScene.ToString());
}
_expController.Update();
}
catch (Exception ex)
{
Util.Log("{0}: {1}\n{2}", ex.GetType(), ex.Message, ex.StackTrace);
}
}
示例2: onGameSceneLoadRequestedForAppLauncher
void onGameSceneLoadRequestedForAppLauncher(GameScenes SceneToLoad)
{
if (DistantObjectSettings.debugMode)
{
Debug.Log(Constants.DistantObject + " -- onGameSceneLoadRequestedForAppLauncher: " + SceneToLoad.ToString() + " - " + this.GetInstanceID() + " AppLauncher.Ready = " + ApplicationLauncher.Ready.ToString());
}
}
示例3: saveSettings
internal void saveSettings(ConfigNode parentNode, GameScenes scene)
{
ConfigNode toolbarNode = parentNode.getOrCreateNode("toolbar");
ConfigNode settingsNode = toolbarNode.getOrCreateNode(scene.ToString());
settingsNode.overwrite("x", rect.x.ToString("F0"));
settingsNode.overwrite("y", rect.y.ToString("F0"));
settingsNode.overwrite("width", savedMaxWidth.ToString("F0"));
settingsNode.overwrite("height", rect.height.ToString("F0"));
settingsNode.overwrite("autoHide", autoHide.ToString());
settingsNode.overwrite("drawBorder", showBorder.ToString());
settingsNode.overwrite("useKSPSkin", UseKSPSkin.ToString());
settingsNode.overwrite("buttonOrder", string.Join(",", savedButtonOrder.ToArray()));
settingsNode.overwrite("visibleButtons", string.Join(",", savedVisibleButtons.ToArray()));
ConfigNode foldersNode = settingsNode.overwriteNode("folders");
foreach (KeyValuePair<string, FolderSettings> entry in savedFolderSettings) {
ConfigNode folderNode = foldersNode.getOrCreateNode(entry.Key);
folderNode.overwrite("toolTip", entry.Value.toolTip ?? "");
folderNode.overwrite("buttons", string.Join(",", entry.Value.buttons.ToArray()));
}
if (foldersNode.CountNodes == 0) {
settingsNode.RemoveNode("folders");
}
}
示例4: loadSettings
internal void loadSettings(ConfigNode parentNode, GameScenes scene)
{
// hide these
WindowList.Instance.destroyDialogs();
dropdownMenu = null;
// deactivate these
rectLocked = true;
buttonOrderLocked = true;
draggable.Enabled = false;
resizable.Enabled = false;
// pretend we're not auto-hidden right now
displayMode = DisplayMode.VISIBLE;
// enable ourselves
Enabled = true;
// hide folders
foreach (Toolbar folder in folders.Values) {
folder.Visible = false;
}
// pretend that nothing was visible until now
visibleButtonIds.Clear();
if (parentNode.HasNode("toolbar")) {
foreach (Toolbar folder in new List<Toolbar>(folders.Values)) {
removeFolder(folder);
}
savedFolderSettings.Clear();
ConfigNode toolbarNode = parentNode.GetNode("toolbar");
ConfigNode settingsNode = toolbarNode.HasNode(scene.ToString()) ? toolbarNode.GetNode(scene.ToString()) : toolbarNode;
rect.x = settingsNode.get("x", DEFAULT_X);
rect.y = settingsNode.get("y", DEFAULT_Y);
rect.width = settingsNode.get("width", DEFAULT_WIDTH);
rect.height = settingsNode.get("height", 0f);
autoHide = settingsNode.get("autoHide", false);
showBorder = settingsNode.get("drawBorder", true);
UseKSPSkin = settingsNode.get("useKSPSkin", false);
savedButtonOrder = settingsNode.get("buttonOrder", "").Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries).ToList();
savedVisibleButtons = new HashSet<string>(settingsNode.get("visibleButtons", "").Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries));
if (settingsNode.HasNode("folders")) {
foreach (ConfigNode folderNode in settingsNode.GetNode("folders").nodes) {
string folderId = folderNode.name;
string toolTip = folderNode.get("toolTip", "");
HashSet<string> buttonIds = new HashSet<string>(folderNode.get("buttons", "").Split(new char[] { ',' }));
Toolbar folder = createFolder(folderId, toolTip, false);
savedFolderSettings[folderId].buttons = buttonIds;
}
}
// show/hide buttons according to saved settings
foreach (Button button in buttons.Where(b => (b.ns != Button.NAMESPACE_INTERNAL) && !b.Equals(dropdownMenuButton))) {
button.UserVisible = savedVisibleButtons.Contains(button.ns + "." + button.id);
}
// move existing buttons according to saved folder contents
foreach (Button button in new List<Button>(buttons)) {
string buttonId = button.ns + "." + button.id;
string folderId = savedFolderSettings.SingleOrDefault(kv => kv.Value.buttons.Contains(buttonId)).Key;
if (folderId != null) {
moveButtonToFolder(button, folders[folderId]);
}
}
}
savedMaxWidth = rect.width;
sortButtons(buttons, compareButtonsUserOrder);
}