AR 攝像機自動對焦
阿新 • • 發佈:2019-02-09
將指令碼掛在ARCCamera上
//using Vuforia;
{ void Start () { <span style="color: rgb(51, 51, 51); font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 24px; font-size: 14px; background-color: rgb(245, 245, 245);">bool focusModeSet = CameraDevice.Instance.SetFocusMode( </span><br style="box-sizing: content-box; color: rgb(51, 51, 51); font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 24px; font-size: 14px; background-color: rgb(245, 245, 245);" /><span style="color: rgb(51, 51, 51); font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 24px; font-size: 14px; background-color: rgb(245, 245, 245);"> CameraDevice.FocusMode.FOCUS_MODE_CONTINUOUSAUTO);</span><br style="box-sizing: content-box; color: rgb(51, 51, 51); font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 24px; font-size: 14px; background-color: rgb(245, 245, 245);" /><span style="color: rgb(51, 51, 51); font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 24px; font-size: 14px; background-color: rgb(245, 245, 245);"> </span><br style="box-sizing: content-box; color: rgb(51, 51, 51); font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 24px; font-size: 14px; background-color: rgb(245, 245, 245);" /><span style="color: rgb(51, 51, 51); font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 24px; font-size: 14px; background-color: rgb(245, 245, 245);"> if (!focusModeSet) {</span><br style="box-sizing: content-box; color: rgb(51, 51, 51); font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 24px; font-size: 14px; background-color: rgb(245, 245, 245);" /><span style="color: rgb(51, 51, 51); font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 24px; font-size: 14px; background-color: rgb(245, 245, 245);"> Debug.Log("Failed to set focus mode (unsupported mode).");</span><br style="box-sizing: content-box; color: rgb(51, 51, 51); font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 24px; font-size: 14px; background-color: rgb(245, 245, 245);" /><span style="color: rgb(51, 51, 51); font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 24px; font-size: 14px; background-color: rgb(245, 245, 245);"> }</span> }