浏览代码

Remove the UX sample

/4.1
Tim Mowrer 4 年前
当前提交
6512c5b0
共有 6 个文件被更改,包括 8 次插入378 次删除
  1. 242
      Assets/Scenes/ARFoundationMenu/Menu.unity
  2. 5
      Assets/Scripts/UX/ARSceneSelectUI.cs
  3. 8
      Assets/Scenes/UX.meta
  4. 120
      Assets/Scripts/UX/UIManager.cs
  5. 11
      Assets/Scripts/UX/UIManager.cs.meta

242
Assets/Scenes/ARFoundationMenu/Menu.unity


m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 199817978}
m_CullTransparentMesh: 0
--- !u!1 &243239067
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 243239068}
- component: {fileID: 243239070}
- component: {fileID: 243239069}
m_Layer: 5
m_Name: Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &243239068
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 243239067}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1783746786}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &243239069
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 243239067}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 14
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 10
m_MaxSize: 40
m_Alignment: 4
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: Sample UX
--- !u!222 &243239070
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 243239067}
m_CullTransparentMesh: 0
--- !u!1 &251164953
GameObject:
m_ObjectHideFlags: 0

m_Children:
- {fileID: 512004587}
m_Father: {fileID: 1569808631}
m_RootOrder: 20
m_RootOrder: 19
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}

m_FixationPoint: {fileID: 375968642}
m_EyePoses: {fileID: 550758920}
m_EyeLasers: {fileID: 1507995259}
m_SampleUX: {fileID: 1783746788}
m_SampleUX: {fileID: 0}
m_CheckSupport: {fileID: 912198813}
m_Depth: {fileID: 251164954}
m_ConfigChooser: {fileID: 2011106401}

m_Children:
- {fileID: 729145962}
m_Father: {fileID: 1569808631}
m_RootOrder: 19
m_RootOrder: 18
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}

- {fileID: 1172329690}
- {fileID: 1466748457}
- {fileID: 1324254625}
- {fileID: 1783746786}
- {fileID: 912198811}
- {fileID: 251164958}
- {fileID: 2011106399}

m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1775769313}
m_CullTransparentMesh: 0
--- !u!1 &1783746785
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1783746786}
- component: {fileID: 1783746790}
- component: {fileID: 1783746789}
- component: {fileID: 1783746788}
- component: {fileID: 1783746787}
m_Layer: 5
m_Name: SampleUX
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1783746786
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1783746785}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 2.8958, y: 2.8958, z: 2.8958}
m_Children:
- {fileID: 243239068}
m_Father: {fileID: 1569808631}
m_RootOrder: 18
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 350, y: -525}
m_SizeDelta: {x: 110, y: 30}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1783746787
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1783746785}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 16733cd6749cf4d96be9df0329c6938a, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Tooltip: {fileID: 2094799242}
--- !u!114 &1783746788
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1783746785}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_SelectedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 0
m_TargetGraphic: {fileID: 1783746789}
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 774532498}
m_TargetAssemblyTypeName:
m_MethodName: SampleUXButtonPressed
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!114 &1783746789
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1783746785}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!222 &1783746790
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1783746785}
m_CullTransparentMesh: 0
--- !u!1 &1790425527
GameObject:
m_ObjectHideFlags: 0

m_Children:
- {fileID: 769789622}
m_Father: {fileID: 1569808631}
m_RootOrder: 22
m_RootOrder: 21
m_AnchoredPosition: {x: -350, y: -650}
m_AnchoredPosition: {x: 350, y: -525}
m_SizeDelta: {x: 110, y: 30}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1868840082

m_HandleRect: {fileID: 1130901185}
m_Direction: 2
m_Value: 1
m_Size: 0.33929503
m_Size: 0.26225123
m_NumberOfSteps: 0
m_OnValueChanged:
m_PersistentCalls:

m_Children:
- {fileID: 1555465366}
m_Father: {fileID: 1569808631}
m_RootOrder: 21
m_RootOrder: 20
m_AnchoredPosition: {x: 0, y: -650}
m_AnchoredPosition: {x: -360, y: -650}
m_SizeDelta: {x: 110, y: 30}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &2011106400

5
Assets/Scripts/UX/ARSceneSelectUI.cs


LoadScene("Scale");
}
public void SampleUXButtonPressed()
{
LoadScene("SampleUXScene");
}
public void ConfigChooserButtonPressed()
{
LoadScene("ConfigurationChooser");

8
Assets/Scenes/UX.meta


fileFormatVersion: 2
guid: 9a6de9d65f4d64509a5280cbe3d2d3af
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

120
Assets/Scripts/UX/UIManager.cs


using System.Collections.Generic;
using UnityEngine;
using UnityEngine.XR.ARFoundation;
namespace UnityEngine.XR.ARFoundation.Samples
{
public class UIManager : MonoBehaviour
{
[SerializeField]
[Tooltip("The ARCameraManager which will produce frame events.")]
ARCameraManager m_CameraManager;
/// <summary>
/// Get or set the <c>ARCameraManager</c>.
/// </summary>
public ARCameraManager cameraManager
{
get { return m_CameraManager; }
set
{
if (m_CameraManager == value)
return;
if (m_CameraManager != null)
m_CameraManager.frameReceived -= FrameChanged;
m_CameraManager = value;
if (m_CameraManager != null & enabled)
m_CameraManager.frameReceived += FrameChanged;
}
}
const string k_FadeOffAnim = "FadeOff";
const string k_FadeOnAnim = "FadeOn";
[SerializeField]
ARPlaneManager m_PlaneManager;
public ARPlaneManager planeManager
{
get { return m_PlaneManager; }
set { m_PlaneManager = value; }
}
[SerializeField]
Animator m_MoveDeviceAnimation;
public Animator moveDeviceAnimation
{
get { return m_MoveDeviceAnimation; }
set { m_MoveDeviceAnimation = value; }
}
[SerializeField]
Animator m_TapToPlaceAnimation;
public Animator tapToPlaceAnimation
{
get { return m_TapToPlaceAnimation; }
set { m_TapToPlaceAnimation = value; }
}
static List<ARPlane> s_Planes = new List<ARPlane>();
bool m_ShowingTapToPlace = false;
bool m_ShowingMoveDevice = true;
void OnEnable()
{
if (m_CameraManager != null)
m_CameraManager.frameReceived += FrameChanged;
PlaceMultipleObjectsOnPlane.onPlacedObject += PlacedObject;
}
void OnDisable()
{
if (m_CameraManager != null)
m_CameraManager.frameReceived -= FrameChanged;
PlaceMultipleObjectsOnPlane.onPlacedObject -= PlacedObject;
}
void FrameChanged(ARCameraFrameEventArgs args)
{
if (PlanesFound() && m_ShowingMoveDevice)
{
if (moveDeviceAnimation)
moveDeviceAnimation.SetTrigger(k_FadeOffAnim);
if (tapToPlaceAnimation)
tapToPlaceAnimation.SetTrigger(k_FadeOnAnim);
m_ShowingTapToPlace = true;
m_ShowingMoveDevice = false;
}
}
bool PlanesFound()
{
if (planeManager == null)
return false;
return planeManager.trackables.count > 0;
}
void PlacedObject()
{
if (m_ShowingTapToPlace)
{
if (tapToPlaceAnimation)
tapToPlaceAnimation.SetTrigger(k_FadeOffAnim);
m_ShowingTapToPlace = false;
}
}
}
}

11
Assets/Scripts/UX/UIManager.cs.meta


fileFormatVersion: 2
guid: 162766bc881294f4b867bd32e1ef2fbe
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存