/// <summary> /// Gets all the image property values. /// </summary> private void GetAllImagePropertyValues() { try { this.cameraMake = GetCameraMake(); this.cameraModel = GetCameraSpecificModel(); this.aperture = GetApertureData(); this.shutterSpeed = GetExposureTime(); this.iso = GetISOInformation(); this.focalLength = GetFocalLengthInformation(); this.pixelXDimension = GetPixelDimension(Dimension.X); this.pixelYDimension = GetPixelDimension(Dimension.Y); this.imageFileSource = GetImageFileSource(); this.flash = GetFlashInformation(); this.createdDateTimeStamp = GetImageDateTimeStamps(ImageTimeStamps.Created); this.modifiedDateTimeStamp = GetImageDateTimeStamps(ImageTimeStamps.Modified); this.exposureCompensation = GetExposureCompensation(); this.imageSceneMode = GetImageSceneMode(); this.meteringMode = GetMeteringModeInfo(); this.imageExposureMode = GetImageExposureMode(); this.imageWhiteBalance = GetImageWhiteBalance(); this.imageSubjectDistanceRange = GetImageSubjectDistanceInformation(); this.focalLength35mmEquivalent = GetFocalLength35mmEquivalent(); } catch (Exception) { } }
void OnEnable() { sceneMode = SceneMode.Edit; script = target as WaypointManager; if (script.pathList == null) { script.pathList = new List <PathData>(); } for (int i = 0; i < script.pathList.Count; i++) { if (script.pathList[i] == null) { script.pathList.RemoveAt(i); } } script.selected = null; foreach (var path in script.pathList) { if (path != null) { String strAssetPath = AssetDatabase.GetAssetPath(path); int startIndex = strAssetPath.LastIndexOf("/") + 1; int length = strAssetPath.LastIndexOf(".") - startIndex; path.pathName = "SRPath"; } } }
private IEnumerator LoadStage(int stageNum) { sceneMode = SceneMode.Stage; stageNumber = stageNum; if (CheckIfSceneIsLoaded(splashSceneName)) { SceneManager.SetActiveScene(SceneManager.GetSceneByBuildIndex(0)); AsyncOperation asyncUnload = SceneManager.UnloadSceneAsync(splashSceneName); while (!asyncUnload.isDone) { yield return(null); } } AsyncOperation asyncLoad = SceneManager.LoadSceneAsync($"Stage{stageNum}", LoadSceneMode.Additive); while (!asyncLoad.isDone) { yield return(null); } SceneManager.SetActiveScene(SceneManager.GetSceneByName($"Stage{stageNum}")); GameController.Instance.PauseGame(false); yield return(new WaitForSeconds(loadingDelay)); loadingCanvas.SetActive(false); }
private IEnumerator UnloadStage(int stageNum) { sceneMode = SceneMode.MainScene; stageNumber = 0; SceneManager.SetActiveScene(SceneManager.GetSceneByBuildIndex(0)); AsyncOperation asyncUnload = SceneManager.UnloadSceneAsync($"Stage{stageNum}"); while (!asyncUnload.isDone) { yield return(null); } AsyncOperation asyncLoad = SceneManager.LoadSceneAsync(splashSceneName, LoadSceneMode.Additive); while (!asyncLoad.isDone) { yield return(null); } GameController.Instance.PauseGame(false); yield return(new WaitForSeconds(loadingDelay)); // mainMenuCanvas.SetActive(true); loadingCanvas.SetActive(false); }
public SceneBase(SceneMode sceneMode) { this.m_sceneMode = sceneMode; GameEvents.SceneEvents.AddLazyEffectToScene += AddLazyEffect; GameEvents.SceneEvents.RemoveEntity += RemoveSceneEntity; }
private void Start() { #if UNITY_EDITOR if (SceneManager.sceneCount == 2) { mainMenuCanvas.SetActive(false); loadingCanvas.SetActive(false); if (CheckIfSceneIsLoaded("SplashScreen")) { sceneMode = SceneMode.MainScene; } else { foreach (int stageNum in new[] { 1, 2, 3 }) { if (CheckIfSceneIsLoaded($"Stage{stageNum}")) { sceneMode = SceneMode.Stage; stageNumber = stageNum; break; } } } } #else // This is a fail-safe thing in case someone disables the main menu mainMenuCanvas.SetActive(true); #endif }
void OnEnable() { sceneMode = SceneMode.Edit; script = target as WaypointManager; if (script == null) return; if (script.pathList == null) script.pathList = new List<PathData>(); for (int i = 0; i < script.pathList.Count; i++) { if (script.pathList[i] == null) script.pathList.RemoveAt(i); } script.selected = null; foreach (var path in script.pathList) { if (path != null) { String strAssetPath = AssetDatabase.GetAssetPath(path); int startIndex = strAssetPath.LastIndexOf("/") + 1; int length = strAssetPath.LastIndexOf(".") - startIndex; path.pathName = strAssetPath.Substring(startIndex, length); } } }
void DoWaypointWindow(int windowID) { EditorGUILayout.BeginVertical(); sceneMode = (SceneMode)GUILayout.SelectionGrid((int)sceneMode, System.Enum.GetNames(typeof(SceneMode)), 1); if (GUILayout.Button("Del")) { DeleteWaypoint(); } if (GUILayout.Button("Clear")) { ClearWaypoint(); } GUI.color = Color.green; script.selected.lineType = (PathLineType)EditorGUILayout.EnumPopup(script.selected.lineType); GUI.color = Color.white; EditorGUILayout.EndVertical(); if (GUI.changed) { SetLinePoints(); } //GUI.DragWindow(); }
/// <summary> /// Gets image scene mode information. /// </summary> /// <returns></returns> private SceneMode GetImageSceneMode() { SceneMode sceneModeInfo = new SceneMode(); try { PropertyItem piSceneModeInfo = GetImageProperty(Constants.SceneCaptureType); if (piSceneModeInfo != null && piSceneModeInfo.Type == 3) { double sceneInfoValue = 0.00; for (int count = 0; count < piSceneModeInfo.Value.Length; count++) { sceneInfoValue += piSceneModeInfo.Value[count] * Math.Pow(256, count); } int sceneInfoData = Convert.ToInt32(sceneInfoValue); sceneModeInfo = (SceneMode)sceneInfoData; } else { sceneModeInfo = SceneMode.NotAvailable; } } catch (Exception) { sceneModeInfo = SceneMode.NotAvailable; } return(sceneModeInfo); }
public GameSceneBase(SceneMode sceneMode, int sceneId) : base(sceneMode) { this.m_sceneId = sceneId; MessageHandler.RegisterMessageHandler(MessageDefine.SCSceneReconnectResponse, OnReconnectResponse); GameEvents.NetworkWatchEvents.NetPass += OnReconnectResponse; }
void Update() { if (Input.GetKey(KeyCode.Escape)) { Application.Quit(); } if (Vector3.Equals(_oldMousePos, Input.mousePosition)) { Game.isMove = false; OnUp(); } else { _oldMousePos = Input.mousePosition; Game.isMove = true; OnDown(); } // if (Input.GetMouseButton (0)) { // }else{ // } if (_oldMode != mode) { _oldMode = mode; if (mode != SceneMode.STANDBY) { _lastGameMode = mode; } foreach (KeyValuePair <SceneMode, MonoBehaviour> item in _allImageEffects) { if (item.Key == mode) { item.Value.enabled = true; } else { item.Value.enabled = false; } } switch (mode) { case SceneMode.RECT: break; case SceneMode.COL: break; default: break; } } }
private void ResetMode() { m_Mode = SceneMode.Default; Tools.current = Tool.Move; if (Repaint != null) { Repaint(); } }
/// QPathFinder modified /// <summary> /// Method running when object is Enable /// </summary> void OnEnable() { sceneMode = SceneMode.None; script = FindObjectOfType <PathFinder>(); if (script.save) { EditorApplication.playModeStateChanged -= OnPlayModeStateChanged; EditorApplication.playModeStateChanged += OnPlayModeStateChanged; } }
public void Initialize(GEMSProject project, SceneMode mode) { Reset( ); //Data source m_project = project; m_project.DataChanged += new GEMSProject.DataChangedEventHandler(OnGEMSProjectDataChanged); currentMode = mode; //Create the renders Initialize( ); }
void OnUp() { if (_isDown) { _isDown = false; } _totalNoTouchFrame++; if (_totalNoTouchFrame >= _delayTime * 60) { _totalNoTouchFrame = 0; mode = SceneMode.STANDBY; } }
public static SceneModeData ToViewData(this SceneMode node, CategoryDictionary suffix = CategoryDictionary.None) { if (node == null) { return(null); } return(new SceneModeData() { Id = node.Id, ConfigTypeId = node.ConfigTypeId, Name = node.Name, Description = node.Description, }); }
private void UpdateToolsCurrent(SceneMode oldMode, SceneMode newMode) { if (newMode != SceneMode.Default) { Tools.current = Tool.None; } else { if (Tools.current == Tool.None) { Tools.current = Tool.Move; } } }
/// <summary> /// Selects the appropriate comparer depending on the specified scene mode. /// </summary> /// <returns>The chosen comparer.</returns> /// <param name="mode">Scene mode.</param> private IResolutionComparer GetComparer(SceneMode mode) { if (mode == SceneMode.Fill) { return(this.FillComparer); } if (mode == SceneMode.Fit) { return(this.FitComparer); } return(null); }
/// <summary> /// Obtient la phase actuelle du jeu : Pick (=> phase de picks) ou Game (phase de jeu). /// </summary> public SceneMode GetMode() { System.IO.MemoryStream s = new System.IO.MemoryStream(); System.IO.StreamWriter output = new System.IO.StreamWriter(s, BOMLESS_UTF8); output.NewLine = "\n"; output.WriteLine(((int)41).ToString()); output.Close(); TCPHelper.Send(s.ToArray()); byte[] response = TCPHelper.Receive(); s = new System.IO.MemoryStream(response); System.IO.StreamReader input = new System.IO.StreamReader(s, BOMLESS_UTF8); SceneMode returnValue = (SceneMode)Int32.Parse(input.ReadLine()); return((SceneMode)returnValue); }
private void OnModeChange(SceneMode oldMode, SceneMode newMode) { UpdateToolsCurrent(oldMode, newMode); if (newMode == SceneMode.ReplaceColor) { OnEnterColorReplacerMode(); } if (oldMode == SceneMode.ReplaceColor) { OnExitColorReplacerMode(); } SceneView.RepaintAll(); }
private IEnumerator LoadSplashScreen() { sceneMode = SceneMode.MainScene; stageNumber = 0; AsyncOperation asyncLoad = SceneManager.LoadSceneAsync(splashSceneName, LoadSceneMode.Additive); while (!asyncLoad.isDone) { yield return(null); } yield return(new WaitForSeconds(loadingDelay)); loadingCanvas.SetActive(false); }
public void LoadScene(string name, SceneMode mode = SceneMode.Only) { if (mode == SceneMode.Only) { UnloadAll(); } int clusterCount = asset.res.GetClusterCount(name); frustumCulling.LoadScene(name, clusterCount); matManager.LoadScene(name); ClusterRendering renderer = new ClusterRendering(); renderer.Init(asset); renderer.LoadScene(name, clusterCount); dicRenderer.Add(name, renderer); }
public void SetSceneMode(SceneMode s) { switch (s) { case SceneMode.eFADEIN: fadeTimeScr.SetFadeType(FadeTime.FadeType.FADEIN); break; case SceneMode.eFADEOUT: fadeTimeScr.SetFadeType(FadeTime.FadeType.FADEOUT); break; default: break; } sceneMode = s; }
public async Task StartNewBattleAsync(SceneMode mode, IEnumerable <UserInQueue> users) { var battleHub = _serviceProvider.GetRequiredService <IHubContext <ArenaHub.ArenaHub> >(); var gameContext = _serviceProvider.GetRequiredService <GameContext>(); var registryContext = _serviceProvider.GetRequiredService <RegistryContext>(); var userIds = users.Select(x => x.UserId).ToList(); var tempSceneId = Guid.NewGuid(); var players = new List <IPlayer>(users.Count()); var rosters = await gameContext.Rosters.GetAsync(x => userIds.Contains(x.UserId)); var rosterIds = rosters.Select(x => x.Id).ToList(); var characters = await gameContext.Characters.GetAsync(x => rosterIds.Contains(x.RosterId) && !x.Deleted); var allTalentIds = characters.SelectMany(x => x.ChosenTalents).ToList(); var allTalents = await registryContext.TalentMap.GetAsync(x => allTalentIds.Contains(x.Position)); foreach (string id in userIds) { var playerRosters = rosters.Where(x => x.UserId == id).ToList(); var roster = playerRosters[_random.Next(playerRosters.Count * RandomModifier) % playerRosters.Count]; var playerCharacters = characters.Where(x => x.RosterId == roster.Id).ToList(); var playerActors = characters .Where(x => x.RosterId == roster.Id) .Select(x => { var talents = allTalents.Where(t => x.ChosenTalents.Contains(t.Position)).ToList(); return(GenerateActor(x, talents)); }) .ToList(); players.Add(EngineHelper.CreatePlayerForGeneration(Guid.NewGuid().ToString(), id, null, playerActors)); } var scene = EngineHelper.CreateNewScene(tempSceneId, players, mode.Generator, _nativeManager, mode.VarManager, _random.Next(), 180, SynchronizationInfoEventHandler); lock (_locker) { _scenes = _scenes.Append(scene).ToHashSet(); } }
//SCENE FUNCTION static public void LaunchMenu() { if (Social.Active.localUser.authenticated) { GooglePlayServiceManager.UnlockAchievement(5); } mode = SceneMode.Menu; stageID = 0; whistleList = new List <Whistle>(); maxWhistle = 1; bgColor = stageColor[0]; floorColor = stageFloorColor[0]; g = 0.4f; kickZone = stageKickZone[0]; level = 1; ballCt = 1; GameObject newBall = Instantiate(startBallPref, new Vector3(0, 7.25f, 0), Quaternion.identity) as GameObject; ballList.Add(newBall); }
/// <summary> /// 创建指定类型的Scene /// </summary> /// <param name="sceneMode"></param> public SceneBase CreateScene(SceneMode sceneMode, int sceneId = -1) { Type targetSceneType = null; if (this.m_sceneDict.TryGetValue(sceneMode, out targetSceneType)) { SceneBase scene = null; if (sceneId != -1) { scene = Activator.CreateInstance(targetSceneType, sceneId) as SceneBase; } else { scene = Activator.CreateInstance(targetSceneType) as SceneBase; } return(scene); } return(null); }
private Transform cameraPos; //to keep track of camera // Use this for initialization void Start() { //at start we get all the necesary values i = Random.Range(0, 2); rotateSpeed = Random.Range(minRotateSpeed, maxRotateSpeed); moveSpeed = Random.Range(minMoveSpeed, maxMoveSpeed); direction = new Vector3(Random.Range(-1.0f, 1.0f), Random.Range(-1.0f, 1.0f), 0.0f).normalized; cameraPos = Camera.main.gameObject.transform; //here we get the scene name and depending on that we decide the behaviour of meteor Scene sceneName = SceneManager.GetActiveScene(); if (sceneName.name == "MainMenu") { sceneMode = SceneMode.mainMenu; } else { sceneMode = SceneMode.gamePlay; } }
public void SetSceneMode(SceneMode s) { switch (s) { case SceneMode.eFADEIN: fadeTimeScr.SetFadeType(FadeTime.FadeType.FADEIN); break; case SceneMode.eWIRELESS: wirelessManagerScr.SetWirelessMode(WirelessManager.WirelessMode.STAGECLEAR_1); break; case SceneMode.eFADEOUT: fadeTimeScr.SetFadeType(FadeTime.FadeType.FADEOUT); break; default: break; } sceneMode = s; }
void OnDown() { _totalNoTouchFrame = 0; if (!_isDown) { if (mode == SceneMode.STANDBY) { if (_lastGameMode == SceneMode.COL) { mode = SceneMode.RECT; } else if (_lastGameMode == SceneMode.RECT) { mode = SceneMode.COL; } else { mode = SceneMode.RECT; } } } _isDown = true; }
void Start() { _chargeLScale = new Vector3(); _chargeRScale = new Vector3(); if (SceneModeHandler.instance) { mode = SceneModeHandler.instance.mode; } if (mode == SceneMode.VR) { _rig = inputRigVR; } else { _rig = inputRigMockup; } _chargeSpeed = Config.active.chargeSpeedFactor; _defaultCharge = Config.active.defaultCharge; _rig.SetOnResetAction(spawner.ResetPools); }
private static extern int sarSmartar_SarCameraDevice_sarSetSceneMode(IntPtr self, SceneMode mode);
void DoWaypointWindow(int windowID) { EditorGUILayout.BeginVertical(); sceneMode = (SceneMode)GUILayout.SelectionGrid((int)sceneMode, System.Enum.GetNames(typeof(SceneMode)), 1); if (GUILayout.Button("Del")) DeleteWaypoint(); if (GUILayout.Button("Clear")) ClearWaypoint(); GUI.color = Color.green; script.selected.lineType = (PathLineType)EditorGUILayout.EnumPopup(script.selected.lineType); GUI.color = Color.white; EditorGUILayout.EndVertical(); if (GUI.changed) { SetLinePoints(); } //GUI.DragWindow(); }