Dan
4 年前
当前提交
43b2ef13
共有 8 个文件被更改,包括 169 次插入 和 11 次删除
-
2Assets/AR Sample Objects/CoffeeMaker/Materials/CoffeeMaker_Kettle.mat
-
2Assets/Shaders/Materials/CameraGrainMat.mat
-
7Assets/Shaders/Materials/OldCameraGrain.mat
-
100Assets/Shaders/Prefabs/CoffeeMakerDouble.prefab
-
19Assets/UX/Scenes/UXManagerScene.unity
-
8UserSettings/EditorUserSettings.asset
-
31Assets/Common/Scripts/ProbePlacement.cs
-
11Assets/Common/Scripts/ProbePlacement.cs.meta
|
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
using UnityEngine.XR.ARFoundation; |
|||
|
|||
public class ProbePlacement : MonoBehaviour |
|||
{ |
|||
[SerializeField] |
|||
AREnvironmentProbeManager m_ProbeManager; |
|||
|
|||
[SerializeField] |
|||
ARRaycastManager m_RaycastManager; |
|||
|
|||
List<ARRaycastHit> k_Hits = new List<ARRaycastHit>(); |
|||
|
|||
void Update() |
|||
{ |
|||
if (Input.touchCount > 0) |
|||
{ |
|||
Touch touch = Input.GetTouch(0); |
|||
|
|||
if (touch.phase == TouchPhase.Began) |
|||
{ |
|||
if (m_RaycastManager.Raycast(new Vector2(Screen.width / 2, Screen.height / 2), k_Hits)) |
|||
{ |
|||
Pose hitPose = k_Hits[0].pose; |
|||
m_ProbeManager.AddEnvironmentProbe(hitPose, Vector3.one, Vector3.one); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 863a70230e6b84d53bf526189f949eef |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
撰写
预览
正在加载...
取消
保存
Reference in new issue