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


C# GameScenes.Equals方法代码示例

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


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

示例1: onLevelWasLoaded

        void onLevelWasLoaded(GameScenes data)
        {
            bool bTreatBodyAsNullForStatics = true;
            DeletePreviewObject();

            staticDB.ToggleActiveAllStatics(false);

            if (selectedObject != null)
            {
                deselectObject(false, true);
                camControl.active = false;
            }

            if (!data.Equals(GameScenes.FLIGHT))
            {
                DownlinkGUI.DisAudio.Stop();
            }

            if (data.Equals(GameScenes.FLIGHT))
            {
                bTreatBodyAsNullForStatics = false;

                InputLockManager.RemoveControlLock("KKEditorLock");
                InputLockManager.RemoveControlLock("KKEditorLock2");

                PersistenceUtils.savePersistenceBackup();

                if (FlightGlobals.ActiveVessel != null)
                {
                    staticDB.ToggleActiveStaticsOnPlanet(FlightGlobals.ActiveVessel.mainBody, true, true);
                    currentBody = FlightGlobals.ActiveVessel.mainBody;
                    staticDB.onBodyChanged(FlightGlobals.ActiveVessel.mainBody);
                    DoHangaredCraftCheck();
                }
                else
                {
                    if (DebugMode) Debug.Log("KK: Flight scene load. No activevessel. Activating all statics.");

                    staticDB.ToggleActiveAllStatics(true);
                }

                InvokeRepeating("updateCache", 0, 1);
            }
            else
            {
                CancelInvoke("updateCache");
            }

            if (data.Equals(GameScenes.SPACECENTER))
            {
                InputLockManager.RemoveControlLock("KKEditorLock");

                // Tighter control over what statics are active
                bTreatBodyAsNullForStatics = false;
                currentBody = KKAPI.getCelestialBody("Kerbin");
                //staticDB.onBodyChanged(KKAPI.getCelestialBody("Kerbin"));
                //staticDB.onBodyChanged(null);
                staticDB.ToggleActiveStaticsInGroup("KSCUpgrades", true);
                staticDB.ToggleActiveStaticsInGroup("KSCRace", true);
                // *********

                if (MiscUtils.CareerStrategyEnabled(HighLogic.CurrentGame))
                {
                    if (DebugMode) Debug.Log("KK: Load launchsite openclose states for career game");
                    PersistenceFile<LaunchSite>.LoadList(LaunchSiteManager.AllLaunchSites, "LAUNCHSITES", "KK");
                }
            }

            if (data.Equals(GameScenes.MAINMENU))
            {
                if (!bImportedCustom)
                {
                    bImportedCustom = true;
                }
                // Close all the launchsite objects
                LaunchSiteManager.setAllLaunchsitesClosed();
                atMainMenu = true;
                // CHANGED 19082015
                bTreatBodyAsNullForStatics = false;
                //currentBody = KKAPI.getCelestialBody("Kerbin");
                //staticDB.onBodyChanged(KKAPI.getCelestialBody("Kerbin"));
                iMenuCount = iMenuCount + 1;
                InitialisedFacilities = false;
            }

            if (data.Equals(GameScenes.EDITOR))
            {
                // Prevent abuse if selector left open when switching to from VAB and SPH
                GUI_LaunchSiteSelector.Close();

                // Default selected launchsite when switching between save games
                switch (EditorDriver.editorFacility)
                {
                    case EditorFacility.SPH:
                        GUI_LaunchSiteSelector.setEditorType(SiteType.SPH);
                        if (atMainMenu)
                        {
                            LaunchSiteManager.setLaunchSite(LaunchSiteManager.runway);
                            atMainMenu = false;
                        }
//.........这里部分代码省略.........
开发者ID:Kerbas-ad-astra,项目名称:Kerbal-Konstructs_DEV,代码行数:101,代码来源:KerbalKonstructs.cs

示例2: onGameSceneLoadRequested

        private void onGameSceneLoadRequested(GameScenes scene)
        {
            //Utils.Log("Changing scene: " + scene);
            if (!SoundtrackEditor.InitialLoadingComplete && scene.Equals(GameScenes.MAINMENU))
                SoundtrackEditor.InitialLoadingComplete = true;

            SoundtrackEditor.CurrentSituation.scene = Enums.ConvertScene(scene);
            if (MonitorScene)
                SoundtrackEditor.Instance.OnSituationChanged();
        }
开发者ID:pizzaoverhead,项目名称:SoundtrackEditor,代码行数:10,代码来源:EventManager.cs

示例3: onLevelWasLoaded

		void onLevelWasLoaded(GameScenes data)
		{
			// Debug.Log("KK: onLevelWasLoaded");
			bool something = true;
			
			if (selectedObject != null)
			{
				// Debug.Log("KK: Deselecting an object.");
				deselectObject(false);
				camControl.active = false;
			}

			// ASH 01112014 Toggle invoking of updateCache on and off for the flight scene only
			if (data.Equals(GameScenes.FLIGHT))
			{
				// ASH 04112014 Likely responsible for camera locks in the flight and space centre scenes
				InputLockManager.RemoveControlLock("KKEditorLock");
				// updateCache();
				InvokeRepeating("updateCache", 0, 1);
				something = false;
			}
			else
			{
				CancelInvoke("updateCache");
			}

			if (data.Equals(GameScenes.SPACECENTER))
			{
				// ASH 04112014 Likely responsible for camera locks in the flight and space centre scenes
				InputLockManager.RemoveControlLock("KKEditorLock");
				currentBody = KKAPI.getCelestialBody("Kerbin");
				staticDB.onBodyChanged(KKAPI.getCelestialBody("Kerbin"));
				updateCache();

				if (CareerStrategyEnabled(HighLogic.CurrentGame))
				{
					Debug.Log("KK: Load launchsite openclose states for career game");
					PersistenceFile<LaunchSite>.LoadList(LaunchSiteManager.AllLaunchSites, "LAUNCHSITES", "KK");
				}
				
				something = false;
				//InitialisedFacilities = false;
			}

			if (data.Equals(GameScenes.MAINMENU))
			{
				// Close all the launchsite objects
				// Debug.Log("KK: Closing all launchsites");
				LaunchSiteManager.setAllLaunchsitesClosed();
				atMainMenu = true;
				something = false;
				iMenuCount = iMenuCount + 1;
				InitialisedFacilities = false;
				// Debug.Log("KK: Reset InitialisedFacilities check");
			}
			
			if (data.Equals(GameScenes.EDITOR))
			{
				// Prevent abuse if selector left open when switching to from VAB and SPH
				selector.Close();

				// Default selected launchsite when switching between save games
				switch (EditorDriver.editorFacility)
				{
					case EditorFacility.SPH:
						selector.setEditorType(SiteType.SPH);
						if (atMainMenu)
						{
							// Debug.Log("KK: First visit to SPH");
							LaunchSiteManager.setLaunchSite(LaunchSiteManager.runway);
							atMainMenu = false;
						}
						break;
					case EditorFacility.VAB:
						selector.setEditorType(SiteType.VAB);
						if (atMainMenu)
						{
							// Debug.Log("KK: First visit to VAB");
							LaunchSiteManager.setLaunchSite(LaunchSiteManager.launchpad);
							atMainMenu = false;
						}
						break;
					default:
						selector.setEditorType(SiteType.Any);
						break;
				}
			}

			if (something)
			{
				staticDB.onBodyChanged(null);
			}
		}
开发者ID:CliftonMarien,项目名称:Kerbal-Konstructs,代码行数:93,代码来源:KerbalKonstructs.cs


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