public static GetCamera ( int index ) : Camera | ||
index | int | |
return | Camera |
public override void OnEnter() { store.Value = EasyTouch.GetCamera(index.Value).gameObject; if (!everyFrame) { Finish(); } }
/// <summary> /// 重置EasyTouch的摄像机 /// </summary> private void ResetEasyTouchCameras() { for (int i = 0; i < EasyTouch.instance.touchCameras.Count; ++i) { EasyTouch.RemoveCamera(EasyTouch.GetCamera(i)); } EasyTouch.AddCamera(Camera.main, false); }
/// <summary> /// Transforms touch position into world space, or the center position between the two touches for a two fingers gesture. /// </summary> /// <returns> /// The touch to wordl point. /// </returns> /// <param name='z'> /// The z position in world units from the camera or in world depending on worldZ value /// </param> /// <param name='worldZ'> /// true = r /// </param> public Vector3 GetTouchToWordlPoint(float z, bool worldZ = false) { if (!worldZ) { return(EasyTouch.GetCamera().ScreenToWorldPoint(new Vector3(position.x, position.y, z))); } else { return(EasyTouch.GetCamera().ScreenToWorldPoint(new Vector3(position.x, position.y, z - EasyTouch.GetCamera().transform.position.z))); } }
/// <summary> /// Transforms touch position into world space, or the center position between the two touches for a two fingers gesture. /// </summary> /// <returns> /// Vector3 : world position /// </returns> /// <param name='z'> /// The z position in world units from the camera /// </param> public Vector3 GetTouchToWordlPoint(float z){ return EasyTouch.GetCamera().ScreenToWorldPoint( new Vector3( position.x, position.y,z)); }
public override void OnUpdate() { store.Value = EasyTouch.GetCamera(index.Value).gameObject; }