Unity3D Vuforia Android 相机聚焦模式设置

使用了EasyTouch插件

using UnityEngine;
using System.Collections;

public class InputController : MonoBehaviour
{

    // Use this for initialization
    void Start()
    {

    }

    // Update is called once per frame
    void Update()
    {

    }

    // Subscribe to events
    void OnEnable()
    {
        EasyTouch.On_SimpleTap += On_SimpleTap;
        EasyTouch.On_DoubleTap += On_DoubleTap;
    }

    void OnDisable()
    {
        UnsubscribeEvent();
    }

    void OnDestroy()
    {
        UnsubscribeEvent();
    }

    void UnsubscribeEvent()
    {
        EasyTouch.On_SimpleTap -= On_SimpleTap;
        EasyTouch.On_DoubleTap -= On_DoubleTap;
    }

    // Simple tap
    private void On_SimpleTap(Gesture gesture)
    {
        CameraDevice.Instance.SetFocusMode(CameraDevice.FocusMode.FOCUS_MODE_CONTINUOUSAUTO);
    }
    private void On_DoubleTap(Gesture gesture)
    {
        CameraDevice.Instance.SetFocusMode(CameraDevice.FocusMode.FOCUS_MODE_NORMAL);
    }
}

你可能感兴趣的:(unity3d,vuforia)