/// <summary> /// change an active camera /// </summary> /// <param name="name">name</param> /// <remarks> /// name is parameter of RegisterCamera() /// </remarks> public void ActivateCamera(string name) { ICamera camera = null; if (!m_cameraTable.TryGetValue(name, out camera)) { Debug.Fail("not found camera : " + name); return; } if (camera == m_camera) { // same camera return; } var oldCamera = m_camera; if (oldCamera != null) { oldCamera.Deactivate(); } m_camera = camera; m_camera.Activate(oldCamera); }
internal ActionResult TakePicture(CameraPosition camPosition) { ICamera camera = GetCamera(camPosition); ActionResult result = camera.Activate(); if (result.Success) { Photo photo = camera.TakeSnap(); return(new ActionResult(true, "Photo successfully taken")); } else { return(new ActionResult(false, "No photo was taken. Camera is not active")); } }
internal ActionResult ActivateCamera(CameraPosition camPosition) { ICamera camera = GetCamera(camPosition); return(camera.Activate()); }