浏览代码

working input system

/4.1
Alexandra Serralta 4 年前
当前提交
097b0cdd
共有 3 个文件被更改,包括 81 次插入58 次删除
  1. 2
      Assets/Scenes/InputSystem/ARController.inputactions
  2. 129
      Assets/Scenes/InputSystem/InputSystem.unity
  3. 8
      Assets/Scenes/InputSystem/InputSystem_PlaceOnPlane.cs

2
Assets/Scenes/InputSystem/ARController.inputactions


{
"name": "",
"id": "97ce382a-a7cf-43aa-90f7-3f4554ec2f7a",
"path": "<Touchscreen>/primaryTouch",
"path": "<Touchscreen>/primaryTouch/position",
"interactions": "",
"processors": "",
"groups": "",

129
Assets/Scenes/InputSystem/InputSystem.unity


m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
--- !u!1 &99949303
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 99949305}
- component: {fileID: 99949304}
m_Layer: 0
m_Name: InputSystem
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &99949304
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 99949303}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 62899f850307741f2a39c98a8b639597, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Actions: {fileID: -944628639613478452, guid: 91fef793c01e643e0a22041c59decd81,
type: 3}
m_NotificationBehavior: 2
m_UIInputModule: {fileID: 0}
m_DeviceLostEvent:
m_PersistentCalls:
m_Calls: []
m_DeviceRegainedEvent:
m_PersistentCalls:
m_Calls: []
m_ControlsChangedEvent:
m_PersistentCalls:
m_Calls: []
m_ActionEvents:
- m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 762671676}
m_TargetAssemblyTypeName: UnityEngine.XR.ARFoundation.Samples.InputSystem_PlaceOnPlane,
Assembly-CSharp
m_MethodName: AddObject
m_Mode: 0
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
m_ActionId: 887b4a07-8f22-4b39-b134-9af1ffa26013
m_ActionName: ARTouchScreen/AddObject
m_NeverAutoSwitchControlSchemes: 0
m_DefaultControlScheme:
m_DefaultActionMap: ARTouchScreen
m_SplitScreenIndex: -1
m_Camera: {fileID: 0}
--- !u!4 &99949305
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 99949303}
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: 0}
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &327175164
GameObject:
m_ObjectHideFlags: 0

- target: {fileID: 3811591508773167263, guid: 90290c13d4a3d46eea32be3d6a1a14c4,
type: 3}
propertyPath: m_RootOrder
value: 5
value: 6
objectReference: {fileID: 0}
- target: {fileID: 3811591508773167263, guid: 90290c13d4a3d46eea32be3d6a1a14c4,
type: 3}

- component: {fileID: 762671671}
- component: {fileID: 762671670}
- component: {fileID: 762671669}
- component: {fileID: 762671675}
- component: {fileID: 762671676}
m_Layer: 0
m_Name: AR Session Origin

m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &762671675
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 762671668}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 62899f850307741f2a39c98a8b639597, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Actions: {fileID: -944628639613478452, guid: 91fef793c01e643e0a22041c59decd81,
type: 3}
m_NotificationBehavior: 2
m_UIInputModule: {fileID: 0}
m_DeviceLostEvent:
m_PersistentCalls:
m_Calls: []
m_DeviceRegainedEvent:
m_PersistentCalls:
m_Calls: []
m_ControlsChangedEvent:
m_PersistentCalls:
m_Calls: []
m_ActionEvents:
- m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 11500000, guid: 47d91ec5b7feb4c8f8dd9a3f8c7fdc09, type: 3}
m_TargetAssemblyTypeName:
m_MethodName:
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName:
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
m_ActionId: 887b4a07-8f22-4b39-b134-9af1ffa26013
m_ActionName: ARTouchScreen/AddObject
m_NeverAutoSwitchControlSchemes: 0
m_DefaultControlScheme:
m_DefaultActionMap: ARTouchScreen
m_SplitScreenIndex: -1
m_Camera: {fileID: 0}
--- !u!114 &762671676
MonoBehaviour:
m_ObjectHideFlags: 0

8
Assets/Scenes/InputSystem/InputSystem_PlaceOnPlane.cs


public void AddObject(InputAction.CallbackContext context)
{
Debug.Log("Spawn!");
Debug.Log(touchPosition);
if (m_RaycastManager.Raycast(touchPosition, s_Hits, TrackableType.PlaneWithinPolygon))
{
// Raycast hits are sorted by distance, so the first one

spawnedObject.transform.position = hitPose.position;
}
}
}
// Update is called once per frame
void Update()
{
}
static List<ARRaycastHit> s_Hits = new List<ARRaycastHit>();

正在加载...
取消
保存