Log in or register to post comments

device camera focus mode

August 1, 2015 - 11:30am #1

Sorry to ask this thread again, I allready see this topic but I still don't understand how it works. I want to make camera application where it go FOCUS_MODE_CONTINUOUSAUTO at start then when I click somewhere at the screen that activated FOCUS_MODE_TRIGGERAUTO  like usually camera application. Can some1 explain me and put the code to make me understand how it works. Here my C# script to have the texture to my plane object. Is that focus mode script attach and become 1 to this script or make a new script and attach it to my object. 

using UnityEngine;
using System.Collections;

public class CameraController : MonoBehaviour
{
	public WebCamTexture mCamera = null;
	public GameObject plane;
	
	void Start ()
	{
		Debug.Log ("Script has been started");
		plane = GameObject.FindWithTag ("Player");
		
		mCamera = new WebCamTexture ();
		plane.renderer.material.mainTexture = mCamera;
		mCamera.Play ();
		
	}
	
	void Update ()
	{
		
	}
}

 

device camera focus mode

August 6, 2015 - 2:06am #5

ok, I'll check it

 

device camera focus mode

August 5, 2015 - 11:58am #4

Check ImageTargets sample for you to see the implementation.

device camera focus mode

August 4, 2015 - 6:03pm #3

any suggest application for this focus mode ??

device camera focus mode

August 4, 2015 - 1:25pm #2

Hi,

You should check any sample app. For instance ImageTarget sample has this behavior implemented in ImageTargetUIEventHandler.cs. Look for TriggerAutoFocusAndEnableContinuousFocusIfSet() method. There you will see how to implement focus which would be called by you when you receive a tap event.

Log in or register to post comments