浏览代码

updated scene camera and removed touch phase

/1.5-preview
Dan 6 年前
当前提交
9c02746c
共有 2 个文件被更改,包括 19 次插入18 次删除
  1. 16
      Assets/Scenes/SampleScene.unity
  2. 21
      Assets/Scripts/PlaceOnPlane.cs

16
Assets/Scenes/SampleScene.unity


m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1}
m_IndirectSpecularColor: {r: 0.44657898, g: 0.49641287, b: 0.5748173, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:

y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 25.3
near clip plane: 0.1
far clip plane: 20
field of view: 60
m_Depth: -1
m_Depth: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295

m_TargetEye: 3
m_HDR: 1
m_AllowMSAA: 0
m_AllowMSAA: 1
m_ForceIntoRT: 1
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022

m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1335839533}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1, z: -18}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 282840814}

21
Assets/Scripts/PlaceOnPlane.cs


set { m_PlacedPrefab = value; }
}
static List<ARRaycastHit> s_Hits;
GameObject m_SpawnedObject;
/// <summary>
/// The object instantiated as a result of a successful raycast intersection with a plane.
/// </summary>
public GameObject spawnedObject { get; private set; }
static List<ARRaycastHit> s_Hits = new List<ARRaycastHit>();
s_Hits = new List<ARRaycastHit>();
}
void Update()

{
Pose hitPose = s_Hits[0].pose;
if (m_SpawnedObject == null)
if (spawnedObject == null)
if (touch.phase == TouchPhase.Began)
{
m_SpawnedObject = Instantiate(m_PlacedPrefab, hitPose.position, hitPose.rotation);
}
spawnedObject = Instantiate(m_PlacedPrefab, hitPose.position, hitPose.rotation);
m_SpawnedObject.transform.position = hitPose.position;
spawnedObject.transform.position = hitPose.position;
}
}
}
正在加载...
取消
保存