void Start() { remainingLevelTime = levelTime; if (levelTime == 0) { for (int i = 0; i < timeUI.Length; i++) { timeUI[i].SetActive(false); } } if (visionDisabled) { if (GameManager.GM.focusAvailable) { visionDisabled = false; for (int i = 0; i < visionUI.Length; i++) { visionUI[i].SetActive(true); } } else { for (int i = 0; i < visionUI.Length; i++) { visionUI[i].SetActive(false); } } } visionTransform = visionMeter.GetComponent <RectTransform>(); fadeRect = GameObject.Find("HUD/Black").GetComponent <RectTransform>(); FM = GetComponent <FocusMode>(); PC = GameObject.FindGameObjectWithTag("Player").GetComponent <HeroCharacterController>(); updateArmour(PC.health); FadeBlack(false); }
/// <summary> /// Sets the focus mode. /// </summary> /// <param name="paramode">Paramode.</param> public static void setFocusMode(FocusMode paramode) { if (easyWebCamInterface != null) { easyWebCamInterface.setFocusMode((int)paramode); } }
// Set the active focus mode. // Returns false if this mode is not available or can't be activated. public bool SetFocusMode(FocusMode mode) { bool result = cameraDeviceSetFocusMode((int)mode) != 0; Debug.Log("Requested Focus mode " + mode + (result ? " successfully." : ". Not supported on this device.")); return(result); }
// Set the active focus mode. // Returns false if this mode is not available or can't be activated. public override bool SetFocusMode(FocusMode mode) { bool result = QCARWrapper.Instance.CameraDeviceSetFocusMode((int)mode) != 0; Debug.Log("Requested Focus mode " + mode + (result ? " successfully." : ". Not supported on this device.")); return(result); }
/// <summary> /// Start tracking focus gestures on the UI panel that this is attached to /// </summary> /// <param name="focusMode">Focus mode to apply to the camera. Note that this must have /// the FocusMode.TapToFocus bit set for tap to focus to work</param> public void StartTracking(FocusMode focusMode) { if (!NatCam.Camera) { return; } this.focusMode = (NatCam.Camera.FocusMode = focusMode); this.IsTracking = true; }
public void StartTracking(FocusMode focusMode = FocusMode.TapToFocus) { if (!NatCam.Camera) { return; } NatCam.Camera.FocusMode = focusMode; this.IsTracking = true; }
/// <summary> /// Sets the focus mode. /// </summary> /// <param name="paramode">Paramode.</param> public static void setFocusMode(FocusMode paramode) { if (!isPlaying()) { return; } if (easyWebCamInterface != null) { easyWebCamInterface.setFocusMode((int)paramode); } mFocusMode = paramode; }
public void ReceiveAbsoluteFocus(FocusMode mode = FocusMode.Additive) { if (mode == FocusMode.Exclusive) { _absoluteFocused.Clear(); } _focusReceiveMode = FocusReceiveMode.Absolute; if (_absoluteFocused.Contains(this) == false) { _absoluteFocused.Add(this); OnReceiveAbsoluteFocus.Invoke(this); } }
public void Focus(PinouInputReceiver ir, FocusMode mode = FocusMode.Additive) { if (mode == FocusMode.Exclusive) { _focuses.Clear(); } if (_focuses.Contains(ir) == false) { _focuses.Add(ir); ir.ReceiveFocus(this); } }
public override void Focus(FocusMode focusMode = FocusMode.Selected) { if (m_lockInput) { return; } m_autoFocusTransform = null; Transform[] transforms; if (focusMode == FocusMode.Selected || focusMode == FocusMode.Default) { if (Selection.activeTransform == null) { return; } if ((Selection.activeTransform.gameObject.hideFlags & HideFlags.DontSave) != 0 || Selection.activeGameObject.IsPrefab()) { return; } m_autoFocusTransform = Selection.activeTransform; transforms = Selection.gameObjects.Select(go => go.transform).ToArray(); } else { transforms = Editor.Object.Get(true).SelectMany(e => e.GetComponentsInChildren <Renderer>()).Where(r => r.gameObject.activeInHierarchy).Select(r => r.transform).ToArray(); } Bounds bounds = CalculateBounds(transforms); if (bounds.extents == Vector3.zero) { bounds.extents = Vector3.one * 0.5f; } float objSize = Mathf.Max(bounds.extents.y, bounds.extents.x, bounds.extents.z) * 2.0f; Focus(bounds.center, objSize); if (focusMode == FocusMode.Selected || focusMode == FocusMode.Default) { if (Selection.activeTransform != null) { SecondaryPivotTransform.position = Selection.activeTransform.position; } } else { SecondaryPivotTransform.position = bounds.center; } }
public string AsFocusMode() { FocusMode focusMode = (FocusMode)Value; switch (focusMode) { case FocusMode.MF: return("MF"); case FocusMode.AF_SingleShot: return("AF-S"); case FocusMode.AF_Continuous: return("AF-C"); case FocusMode.AF_Automatic: return("AF-A"); case FocusMode.DMF: return("DMF"); default: return("???(" + Value + ")"); } }
public virtual void Awake() { anim = GetComponent <Animator>(); attackMod = GetComponent <AttackModule>(); moveMod = GetComponent <MovementModule>(); aimMod = GetComponent <AimModule>(); specialMod = GetComponent <SpecialModule>(); renderers = GetComponentsInChildren <Renderer>(); maxHealth = (health > 0) ? health : 1; aimMod.Init(); attackMod.Init(); moveMod.Init(); specialMod.Init(); //HCC = GameObject.FindGameObjectWithTag("Player").GetComponent<HeroCharacterController>(); FM = Camera.main.GetComponent <FocusMode>(); }
private void UpdateActiveSliders(FocusMode focusMode) { dofUI.focusDistance.gameObject.SetActive(false); dofUI.nearFocusStart.gameObject.SetActive(false); dofUI.nearFocusEnd.gameObject.SetActive(false); dofUI.farFocusStart.gameObject.SetActive(false); dofUI.farFocusEnd.gameObject.SetActive(false); if (focusMode == FocusMode.Manual) { dofUI.nearFocusStart.gameObject.SetActive(true); dofUI.nearFocusEnd.gameObject.SetActive(true); dofUI.farFocusStart.gameObject.SetActive(true); dofUI.farFocusEnd.gameObject.SetActive(true); } else if (focusMode == FocusMode.PhysicalCamera) { dofUI.focusDistance.gameObject.SetActive(true); } }
private void UpdateDofMode() { var presets = PresetManager.Instance.presets; var presetsWithActiveDof = presets.Where(p => p.volume.isActiveAndEnabled && p.depthOfField.active).ToList(); if (presetsWithActiveDof.Count == 0) { useCustomFocus = false; return; } customFocusMode = presetsWithActiveDof.First().focusMode; if (customFocusMode == FocusMode.Skate || customFocusMode == FocusMode.Player) { useCustomFocus = true; } else { useCustomFocus = false; } }
void picPreview_MouseMove(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.None && (icd.PageTurningDirection == PageTurningDirection.ToLeft ? e.X >= Math.Min(prevMain.ViewPane.ClientSize.Width, prevMain.ClientSize.Width) - prevMain.AutoScrollPosition.X - Properties.Resources.Next.Width : e.X <= Properties.Resources.Next.Width - prevMain.AutoScrollPosition.X)) { focusMode = FocusMode.Next; prevMain.Cursor = Cursors.Default; } else if (e.Button == MouseButtons.None && (icd.PageTurningDirection == PageTurningDirection.ToLeft ? e.X <= Properties.Resources.Previous.Width - prevMain.AutoScrollPosition.X : e.X >= Math.Min(prevMain.ViewPane.ClientSize.Width, prevMain.ClientSize.Width) - prevMain.AutoScrollPosition.X - Properties.Resources.Previous.Width)) { focusMode = FocusMode.Previous; prevMain.Cursor = Cursors.Default; } else if (e.Button == MouseButtons.None && e.Y >= prevMain.ClientSize.Height - closeHeight - prevMain.AutoScrollPosition.Y) { focusMode = FocusMode.Close; prevMain.Cursor = Cursors.Default; } else { focusMode = FocusMode.None; prevMain.Cursor = null; } prevMain.Invalidate(); }
/// <summary> /// Set the active focus mode. /// Returns false if this mode is not available or can't be activated. /// </summary> public abstract bool SetFocusMode(FocusMode mode);
public void SetFocusMode(FocusMode focusMode) { DoSubSettingI16(SettingIds.FocusMode, (short)focusMode); }
public override bool Init(DeviceDescriptor deviceDescriptor) { IsBusy = false; //the device not connected try { ConnectToWiaDevice(deviceDescriptor); } catch (Exception exception) { Log.Error("Unable to connect camera using wia driver", exception); return(false); } DeviceManager = new DeviceManager(); DeviceManager.RegisterEvent(Conts.wiaEventItemCreated, deviceDescriptor.WiaId); DeviceManager.OnEvent += DeviceManager_OnEvent; try { Device = deviceDescriptor.WiaDevice; DeviceName = Device.Properties["Description"].get_Value(); Manufacturer = Device.Properties["Manufacturer"].get_Value(); SerialNumber = StaticHelper.GetSerial(Device.Properties["PnP ID String"].get_Value()); } catch (Exception ex) { Log.Debug("Init error", ex); } IsConnected = true; try { try { Property apertureProperty = Device.Properties[Conts.CONST_PROP_F_Number]; if (apertureProperty != null) { foreach (var subTypeValue in apertureProperty.SubTypeValues) { double d = (int)subTypeValue; string s = (d / 100).ToString("0.0"); FNumber.AddValues(s, (int)d); FNumber.ReloadValues(); if ((int)subTypeValue == (int)apertureProperty.get_Value()) { FNumber.SetValue((int)d); } } } } catch (COMException) { FNumber.IsEnabled = false; } try { Property isoProperty = Device.Properties[Conts.CONST_PROP_ISO_Number]; if (isoProperty != null) { foreach (var subTypeValue in isoProperty.SubTypeValues) { IsoNumber.AddValues(subTypeValue.ToString(), (int)subTypeValue); IsoNumber.ReloadValues(); if ((int)subTypeValue == (int)isoProperty.get_Value()) { IsoNumber.SetValue((int)subTypeValue); } } } } catch (COMException) { IsoNumber.IsEnabled = false; } try { Property shutterProperty = Device.Properties[Conts.CONST_PROP_Exposure_Time]; if (shutterProperty != null) { foreach (int subTypeValue in shutterProperty.SubTypeValues) { if (ShutterTable.ContainsKey((int)subTypeValue)) { ShutterSpeed.AddValues(ShutterTable[(int)subTypeValue], (int)subTypeValue); } } ShutterSpeed.ReloadValues(); ShutterSpeed.SetValue(shutterProperty.get_Value()); } } catch (COMException) { ShutterSpeed.IsEnabled = false; } try { Property wbProperty = Device.Properties[Conts.CONST_PROP_WhiteBalance]; if (wbProperty != null) { foreach (var subTypeValue in wbProperty.SubTypeValues) { if (WbTable.ContainsKey((int)subTypeValue)) { WhiteBalance.AddValues(WbTable[(int)subTypeValue], (int)subTypeValue); } } WhiteBalance.ReloadValues(); WhiteBalance.SetValue(wbProperty.get_Value()); } } catch (COMException) { WhiteBalance.IsEnabled = false; } try { Property modeProperty = Device.Properties[Conts.CONST_PROP_ExposureMode]; if (modeProperty != null) { foreach (var subTypeValue in modeProperty.SubTypeValues) { if (ExposureModeTable.ContainsKey((int)subTypeValue)) { Mode.AddValues(ExposureModeTable[(int)subTypeValue], Convert.ToUInt32(subTypeValue)); } } Mode.ReloadValues(); Mode.SetValue(Convert.ToUInt32(modeProperty.get_Value())); } Mode.IsEnabled = false; } catch (COMException) { Mode.IsEnabled = false; } try { Property ecProperty = Device.Properties[Conts.CONST_PROP_ExposureCompensation]; if (ecProperty != null) { foreach (var subTypeValue in ecProperty.SubTypeValues) { decimal d = (int)subTypeValue; string s = decimal.Round(d / 1000, 1).ToString(); if (d > 0) { s = "+" + s; } ExposureCompensation.AddValues(s, (int)subTypeValue); } ExposureCompensation.ReloadValues(); ExposureCompensation.SetValue(ecProperty.get_Value()); } } catch (COMException) { ExposureCompensation.IsEnabled = false; } try { Property csProperty = Device.Properties[Conts.CONST_PROP_CompressionSetting]; if (csProperty != null) { foreach (var subTypeValue in csProperty.SubTypeValues) { if (CSTable.ContainsKey((int)subTypeValue)) { CompressionSetting.AddValues(CSTable[(int)subTypeValue], (int)subTypeValue); } } CompressionSetting.ReloadValues(); CompressionSetting.SetValue(csProperty.get_Value()); } } catch (COMException) { CompressionSetting.IsEnabled = false; } try { Property emmProperty = Device.Properties[Conts.CONST_PROP_ExposureMeteringMode]; if (emmProperty != null) { foreach (var subTypeValue in emmProperty.SubTypeValues) { if (EMMTable.ContainsKey((int)subTypeValue)) { ExposureMeteringMode.AddValues(EMMTable[(int)subTypeValue], (int)subTypeValue); } } ExposureMeteringMode.ReloadValues(); ExposureMeteringMode.SetValue(emmProperty.get_Value()); } } catch (COMException) { CompressionSetting.IsEnabled = false; } try { Property fmProperty = Device.Properties[Conts.CONST_PROP_FocusMode]; if (fmProperty != null) { foreach (int subTypeValue in fmProperty.SubTypeValues) { uint subval = Convert.ToUInt16(subTypeValue); if (FMTable.ContainsKey(subval)) { FocusMode.AddValues(FMTable[subval], subval); } } FocusMode.ReloadValues(); FocusMode.SetValue(Convert.ToUInt16((int)fmProperty.get_Value())); } } catch (COMException) { FocusMode.IsEnabled = false; } try { Battery = Device.Properties[Conts.CONST_PROP_BatteryStatus].get_Value(); } catch (COMException) { Battery = 0; } IsConnected = true; } catch (Exception exception) { Log.Error(exception); IsConnected = false; } HaveLiveView = true; //Capabilities.Add(CapabilityEnum.LiveView); return(true); }
public FocusEvent(GameObject target, float duration, FocusMode mode) { this.gFocusObject = target; this.Duration = duration; this.Mode = mode; }
public void AddFocusEvent(GameObject target, float duration, FocusMode mode) { FocusEvent fe = new FocusEvent(target, duration, mode); gameEvents.Enqueue(fe); }
public int SetFocusMode(FocusMode mode) { return(sarSmartar_SarCameraDevice_sarSetFocusMode(self_, mode)); }
private static extern int sarSmartar_SarCameraDevice_sarSetFocusMode(IntPtr self, FocusMode mode);
// Set the active focus mode. // Returns false if this mode is not available or can't be activated. public bool SetFocusMode(FocusMode mode) { bool result = cameraDeviceSetFocusMode((int)mode) != 0; Debug.Log("Requested Focus mode " + mode + (result ? " successfully." : ". Not supported on this device.")); return result; }
public void SetFocusPointMm(PointF pointF, FocusMode focusMode) { m_reportPanel.SetFocusPointMm(pointF, focusMode); }
// Set the active focus mode. // Returns false if this mode is not available or can't be activated. public override bool SetFocusMode(FocusMode mode) { bool result = QCARWrapper.Instance.CameraDeviceSetFocusMode((int)mode) != 0; Debug.Log("Requested Focus mode " + mode + (result ? " successfully." : ". Not supported on this device.")); return result; }
// Set an auto focus mode. // Returns false if auto focus is not available or can't be activated. public bool SetAutoFocusMode(FocusMode mode) { return (cameraDeviceSetAutoFocusMode((int)mode) != 0); }
public void SetFocusPoint(Point point, FocusMode focusMode) { m_reportPanel.SetFocusPoint(point, focusMode); }
/// <summary> /// Set camera focus mode /// </summary> /// <param name="focusMode"></param> /// <returns></returns> public bool SetFocusMode(FocusMode focusMode) { return(NativeAPI.CameraDevice_setFocusMode((int)focusMode)); }
public virtual void Focus(FocusMode focusMode = FocusMode.Default) { }