game: fixed stamp problem

This commit is contained in:
kookiekenobi 2025-02-07 02:19:40 +08:00
parent f9402a9d7c
commit 9ea34f58a3
4 changed files with 109 additions and 84 deletions

View file

@ -63,6 +63,7 @@ GameObject:
m_Component: m_Component:
- component: {fileID: 6320572536770142943} - component: {fileID: 6320572536770142943}
- component: {fileID: 7081610126364058223} - component: {fileID: 7081610126364058223}
- component: {fileID: 8868659922623439460}
m_Layer: 0 m_Layer: 0
m_Name: Stamp Area m_Name: Stamp Area
m_TagString: Untagged m_TagString: Untagged
@ -106,6 +107,18 @@ BoxCollider:
serializedVersion: 3 serializedVersion: 3
m_Size: {x: 0.17182535, y: 0.066651165, z: 0.12091601} m_Size: {x: 0.17182535, y: 0.066651165, z: 0.12091601}
m_Center: {x: 0.009468913, y: 0.00025579333, z: -0.012485802} m_Center: {x: 0.009468913, y: 0.00025579333, z: -0.012485802}
--- !u!114 &8868659922623439460
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5866394375878670926}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0aa0987b70e0f9f4a9791204c476099d, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &7579783095933529078 --- !u!1 &7579783095933529078
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

View file

@ -259,7 +259,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 1841405841138988885, guid: 034e45868894ce545ab9c964d1953542, type: 3} - target: {fileID: 1841405841138988885, guid: 034e45868894ce545ab9c964d1953542, type: 3}
propertyPath: m_IsActive propertyPath: m_IsActive
value: 1 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 1841405841138988885, guid: 034e45868894ce545ab9c964d1953542, type: 3} - target: {fileID: 1841405841138988885, guid: 034e45868894ce545ab9c964d1953542, type: 3}
propertyPath: m_StaticEditorFlags propertyPath: m_StaticEditorFlags
@ -437,6 +437,23 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 82586051} m_GameObject: {fileID: 82586051}
m_CullTransparentMesh: 1 m_CullTransparentMesh: 1
--- !u!1 &102489364 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 7579783095933529078, guid: e33418fe190c57c4eb17f4c129f32a02, type: 3}
m_PrefabInstance: {fileID: 775517552}
m_PrefabAsset: {fileID: 0}
--- !u!114 &102489372
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 102489364}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0aa0987b70e0f9f4a9791204c476099d, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &278641001 --- !u!1 &278641001
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -1235,7 +1252,7 @@ Transform:
m_GameObject: {fileID: 402867241} m_GameObject: {fileID: 402867241}
serializedVersion: 2 serializedVersion: 2
m_LocalRotation: {x: 0, y: -0, z: -0, w: 1} m_LocalRotation: {x: 0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0.6778, y: 0.9446, z: 1.389} m_LocalPosition: {x: -0.1705, y: 0.9446, z: 1.4772}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
@ -1913,23 +1930,6 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 543859847} m_GameObject: {fileID: 543859847}
m_CullTransparentMesh: 1 m_CullTransparentMesh: 1
--- !u!1 &651771747 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 7579783095933529078, guid: e33418fe190c57c4eb17f4c129f32a02, type: 3}
m_PrefabInstance: {fileID: 1058119555}
m_PrefabAsset: {fileID: 0}
--- !u!114 &651771755
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 651771747}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0aa0987b70e0f9f4a9791204c476099d, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &655153169 --- !u!1 &655153169
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -2484,6 +2484,75 @@ Transform:
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &775517552
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 5866394375878670926, guid: e33418fe190c57c4eb17f4c129f32a02, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7579783095933529078, guid: e33418fe190c57c4eb17f4c129f32a02, type: 3}
propertyPath: m_Name
value: Stamp
objectReference: {fileID: 0}
- target: {fileID: 7579783095933529078, guid: e33418fe190c57c4eb17f4c129f32a02, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7591921673328099837, guid: e33418fe190c57c4eb17f4c129f32a02, type: 3}
propertyPath: m_LocalPosition.x
value: -0.1751373
objectReference: {fileID: 0}
- target: {fileID: 7591921673328099837, guid: e33418fe190c57c4eb17f4c129f32a02, type: 3}
propertyPath: m_LocalPosition.y
value: 0.8763828
objectReference: {fileID: 0}
- target: {fileID: 7591921673328099837, guid: e33418fe190c57c4eb17f4c129f32a02, type: 3}
propertyPath: m_LocalPosition.z
value: 1.4767569
objectReference: {fileID: 0}
- target: {fileID: 7591921673328099837, guid: e33418fe190c57c4eb17f4c129f32a02, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7591921673328099837, guid: e33418fe190c57c4eb17f4c129f32a02, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7591921673328099837, guid: e33418fe190c57c4eb17f4c129f32a02, type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 7591921673328099837, guid: e33418fe190c57c4eb17f4c129f32a02, type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 7591921673328099837, guid: e33418fe190c57c4eb17f4c129f32a02, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7591921673328099837, guid: e33418fe190c57c4eb17f4c129f32a02, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7591921673328099837, guid: e33418fe190c57c4eb17f4c129f32a02, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects:
- {fileID: 5866394375878670926, guid: e33418fe190c57c4eb17f4c129f32a02, type: 3}
m_AddedGameObjects: []
m_AddedComponents:
- targetCorrespondingSourceObject: {fileID: 7579783095933529078, guid: e33418fe190c57c4eb17f4c129f32a02, type: 3}
insertIndex: -1
addedObject: {fileID: 102489372}
m_SourcePrefab: {fileID: 100100000, guid: e33418fe190c57c4eb17f4c129f32a02, type: 3}
--- !u!1 &802035914 --- !u!1 &802035914
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -3363,66 +3432,6 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1024984818} m_GameObject: {fileID: 1024984818}
m_CullTransparentMesh: 1 m_CullTransparentMesh: 1
--- !u!1001 &1058119555
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 7579783095933529078, guid: e33418fe190c57c4eb17f4c129f32a02, type: 3}
propertyPath: m_Name
value: Stamp
objectReference: {fileID: 0}
- target: {fileID: 7591921673328099837, guid: e33418fe190c57c4eb17f4c129f32a02, type: 3}
propertyPath: m_LocalPosition.x
value: 0.4246627
objectReference: {fileID: 0}
- target: {fileID: 7591921673328099837, guid: e33418fe190c57c4eb17f4c129f32a02, type: 3}
propertyPath: m_LocalPosition.y
value: 0.8763828
objectReference: {fileID: 0}
- target: {fileID: 7591921673328099837, guid: e33418fe190c57c4eb17f4c129f32a02, type: 3}
propertyPath: m_LocalPosition.z
value: 1.3809569
objectReference: {fileID: 0}
- target: {fileID: 7591921673328099837, guid: e33418fe190c57c4eb17f4c129f32a02, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7591921673328099837, guid: e33418fe190c57c4eb17f4c129f32a02, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7591921673328099837, guid: e33418fe190c57c4eb17f4c129f32a02, type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 7591921673328099837, guid: e33418fe190c57c4eb17f4c129f32a02, type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 7591921673328099837, guid: e33418fe190c57c4eb17f4c129f32a02, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7591921673328099837, guid: e33418fe190c57c4eb17f4c129f32a02, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7591921673328099837, guid: e33418fe190c57c4eb17f4c129f32a02, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents:
- targetCorrespondingSourceObject: {fileID: 7579783095933529078, guid: e33418fe190c57c4eb17f4c129f32a02, type: 3}
insertIndex: -1
addedObject: {fileID: 651771755}
m_SourcePrefab: {fileID: 100100000, guid: e33418fe190c57c4eb17f4c129f32a02, type: 3}
--- !u!1 &1071348771 --- !u!1 &1071348771
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -7357,5 +7366,5 @@ SceneRoots:
- {fileID: 732601459} - {fileID: 732601459}
- {fileID: 387192626} - {fileID: 387192626}
- {fileID: 38700534} - {fileID: 38700534}
- {fileID: 1058119555}
- {fileID: 402867245} - {fileID: 402867245}
- {fileID: 775517552}

View file

@ -5,11 +5,15 @@ using UnityEngine;
public class StampInteractor : MonoBehaviour public class StampInteractor : MonoBehaviour
{ {
private void OnCollisionEnter(Collision other) private void OnCollisionEnter(Collision collision)
{ {
if (StampSocketInteractor.isHeld && other.gameObject.CompareTag("Paper")) if (StampSocketInteractor.isHeld && collision.gameObject.CompareTag("Paper"))
{ {
Debug.Log("paper is stamped"); Debug.Log("paper is stamped");
} }
/*else
{
Debug.LogError("something aint right");
}*/
} }
} }

View file

@ -20,8 +20,6 @@ public class StampSocketInteractor : MonoBehaviour
{ {
stampSocket.selectEntered.AddListener(OnStampTable); stampSocket.selectEntered.AddListener(OnStampTable);
stampSocket.selectExited.AddListener(OnStampHeld); stampSocket.selectExited.AddListener(OnStampHeld);
} }
private void OnDisable() private void OnDisable()
@ -35,6 +33,7 @@ public class StampSocketInteractor : MonoBehaviour
{ {
isHeld = true; isHeld = true;
Debug.Log("Stamp is held"); Debug.Log("Stamp is held");
/*Debug.Log(isHeld.ToString());*/
} }
private void OnStampTable(SelectEnterEventArgs args) private void OnStampTable(SelectEnterEventArgs args)