mirror of
https://projects.caleb-brown.dev/UDRI-XRT/UDRIGEEKCup2024.git
synced 2025-01-22 07:08:51 -05:00
Updated Stencil sample scene
This commit is contained in:
parent
687aca50c1
commit
cd7f9b740e
@ -82,6 +82,10 @@ MonoBehaviour:
|
||||
m_StringArgument:
|
||||
m_BoolArgument: 0
|
||||
m_CallState: 2
|
||||
layerMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 1
|
||||
tagsMask: []
|
||||
--- !u!1 &6121683813469744371
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -188,7 +192,24 @@ MonoBehaviour:
|
||||
invertResult: 1
|
||||
onTrigger:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Calls:
|
||||
- m_Target: {fileID: 11400000, guid: c06694055e7ae4003afe2a672d2eefb0, type: 2}
|
||||
m_TargetAssemblyTypeName: UnityAtoms.AtomVariable`5[[System.Boolean, mscorlib
|
||||
m_MethodName: set_Value
|
||||
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
|
||||
layerMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 1
|
||||
tagsMask:
|
||||
- {fileID: 11400000, guid: 1f557d488f8464000b778362139a0045, type: 2}
|
||||
--- !u!1 &7537082131774610123
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -344,9 +344,80 @@ Transform:
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Children:
|
||||
- {fileID: 396364276}
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &396364275
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 396364276}
|
||||
- component: {fileID: 396364277}
|
||||
m_Layer: 6
|
||||
m_Name: Listener
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &396364276
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 396364275}
|
||||
serializedVersion: 2
|
||||
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_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 304877055}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &396364277
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 396364275}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 9a6ab7cbc45164d19b20476265c251c2, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_developerDescription:
|
||||
_unityEventResponse:
|
||||
m_PersistentCalls:
|
||||
m_Calls:
|
||||
- m_Target: {fileID: 304877052}
|
||||
m_TargetAssemblyTypeName: UnityEngine.Collider, UnityEngine
|
||||
m_MethodName: set_enabled
|
||||
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
|
||||
_actionResponses: []
|
||||
_conditions: []
|
||||
_operator: 0
|
||||
_replayEventBufferOnRegister: 1
|
||||
_eventReference:
|
||||
_usage: 2
|
||||
_event: {fileID: 0}
|
||||
_eventInstancer: {fileID: 0}
|
||||
_variable: {fileID: 11400000, guid: c06694055e7ae4003afe2a672d2eefb0, type: 2}
|
||||
_variableInstancer: {fileID: 0}
|
||||
--- !u!1 &532545311
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -617,9 +688,10 @@ GameObject:
|
||||
- component: {fileID: 1725183272}
|
||||
- component: {fileID: 1725183271}
|
||||
- component: {fileID: 1725183275}
|
||||
- component: {fileID: 1725183276}
|
||||
m_Layer: 0
|
||||
m_Name: Test_Ball
|
||||
m_TagString: Player
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@ -737,6 +809,21 @@ Rigidbody:
|
||||
m_Interpolate: 0
|
||||
m_Constraints: 0
|
||||
m_CollisionDetection: 0
|
||||
--- !u!114 &1725183276
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1725183270}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 3570dca9cf8f40ac9731ef4082c9a4ef, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_tags:
|
||||
- {fileID: 11400000, guid: 1f557d488f8464000b778362139a0045, type: 2}
|
||||
- {fileID: 0}
|
||||
--- !u!1001 &1755602562368970955
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -790,6 +877,17 @@ PrefabInstance:
|
||||
propertyPath: m_Name
|
||||
value: Hole
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7171974296929999656, guid: 67b92308c184e4945a702caf44784747,
|
||||
type: 3}
|
||||
propertyPath: tagsMask.Array.size
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7171974296929999656, guid: 67b92308c184e4945a702caf44784747,
|
||||
type: 3}
|
||||
propertyPath: tagsMask.Array.data[0]
|
||||
value:
|
||||
objectReference: {fileID: 11400000, guid: 1f557d488f8464000b778362139a0045,
|
||||
type: 2}
|
||||
- target: {fileID: 7667432291959775556, guid: 67b92308c184e4945a702caf44784747,
|
||||
type: 3}
|
||||
propertyPath: m_Mesh
|
||||
@ -823,7 +921,7 @@ PrefabInstance:
|
||||
- target: {fileID: 8649987843805268783, guid: 67b92308c184e4945a702caf44784747,
|
||||
type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0
|
||||
value: -0.033
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8649987843805268783, guid: 67b92308c184e4945a702caf44784747,
|
||||
type: 3}
|
||||
|
@ -1,5 +1,8 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityAtoms.BaseAtoms;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
using UnityAtoms.Tags;
|
||||
|
||||
namespace MAVRIC.GEEKCup
|
||||
{
|
||||
@ -10,21 +13,35 @@ namespace MAVRIC.GEEKCup
|
||||
|
||||
// TODO: Update this to use a UnityAtoms BoolReference
|
||||
[SerializeField] private UnityEvent<bool> onTrigger;
|
||||
|
||||
[SerializeField] private LayerMask layerMask = 1 >> 0;
|
||||
[SerializeField] private List<StringConstant> tagsMask = new ();
|
||||
|
||||
private void OnTriggerEnter(Collider other)
|
||||
{
|
||||
// TODO: Update this to a different system
|
||||
if (other.CompareTag("Player"))
|
||||
// if ((1 << other.gameObject.layer & layerMask) == 0) return;
|
||||
|
||||
var hasValidTags = other.gameObject.HasAnyTag(tagsMask);
|
||||
Debug.Log($"HasValidTags: {hasValidTags}");
|
||||
|
||||
if (hasValidTags)
|
||||
{
|
||||
onTrigger?.Invoke(!invertResult);
|
||||
var result = invertResult ? false : true;
|
||||
Debug.Log(result);
|
||||
onTrigger?.Invoke(result);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnTriggerExit(Collider other)
|
||||
{
|
||||
if (other.CompareTag("Player"))
|
||||
var hasValidTags = other.gameObject.HasAnyTag(tagsMask);
|
||||
Debug.Log($"HasValidTags: {hasValidTags}");
|
||||
|
||||
if (hasValidTags)
|
||||
{
|
||||
onTrigger?.Invoke(invertResult);
|
||||
var result = invertResult ? true : false;
|
||||
Debug.Log($"Result: {result}");
|
||||
onTrigger?.Invoke(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ MonoBehaviour:
|
||||
stencilSettings:
|
||||
overrideStencilState: 1
|
||||
stencilReference: 1
|
||||
stencilCompareFunction: 7
|
||||
stencilCompareFunction: 5
|
||||
passOperation: 0
|
||||
failOperation: 0
|
||||
zFailOperation: 0
|
||||
|
Loading…
Reference in New Issue
Block a user