game: door open and close
player trigger slightly buggy
This commit is contained in:
parent
c1f11e3852
commit
8bc67d4904
7 changed files with 603 additions and 2 deletions
|
@ -240,6 +240,38 @@ MonoBehaviour:
|
|||
m_LightCookieSize: {x: 1, y: 1}
|
||||
m_LightCookieOffset: {x: 0, y: 0}
|
||||
m_SoftShadowQuality: 0
|
||||
--- !u!1 &331300392
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 331300393}
|
||||
m_Layer: 0
|
||||
m_Name: RightPivot
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &331300393
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 331300392}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 1.879}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 1318173677}
|
||||
m_Father: {fileID: 1298003772}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1001 &441087506
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -268,6 +300,10 @@ PrefabInstance:
|
|||
propertyPath: m_Name
|
||||
value: XR Origin (XR Rig)
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1717954561962503725, guid: f6336ac4ac8b4d34bc5072418cdc62a0, type: 3}
|
||||
propertyPath: m_TagString
|
||||
value: Player
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1717954561962503726, guid: f6336ac4ac8b4d34bc5072418cdc62a0, type: 3}
|
||||
propertyPath: m_RootOrder
|
||||
value: 1
|
||||
|
@ -317,6 +353,51 @@ PrefabInstance:
|
|||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: f6336ac4ac8b4d34bc5072418cdc62a0, type: 3}
|
||||
--- !u!1 &520849214
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 520849215}
|
||||
- component: {fileID: 520849216}
|
||||
m_Layer: 0
|
||||
m_Name: Game Manager
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &520849215
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 520849214}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0.46573007, y: 1.0118064, z: 10.831885}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &520849216
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 520849214}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: e6811c2cb7e863c47867526938ecf072, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
dayEnded: 0
|
||||
--- !u!1 &624452548
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -330,6 +411,7 @@ GameObject:
|
|||
- component: {fileID: 624452550}
|
||||
- component: {fileID: 624452553}
|
||||
- component: {fileID: 624452554}
|
||||
- component: {fileID: 624452555}
|
||||
m_Layer: 0
|
||||
m_Name: NPC_Test
|
||||
m_TagString: NPC
|
||||
|
@ -419,7 +501,7 @@ MonoBehaviour:
|
|||
- {fileID: 2036976913}
|
||||
- {fileID: 1263378068}
|
||||
- {fileID: 1919983111}
|
||||
movementSpeed: 10
|
||||
movementSpeed: 5
|
||||
turnSpeed: 5
|
||||
--- !u!65 &624452554
|
||||
BoxCollider:
|
||||
|
@ -442,6 +524,33 @@ BoxCollider:
|
|||
serializedVersion: 3
|
||||
m_Size: {x: 1.0000001, y: 2.0000002, z: 1.0000001}
|
||||
m_Center: {x: 0, y: 0, z: 0}
|
||||
--- !u!54 &624452555
|
||||
Rigidbody:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 624452548}
|
||||
serializedVersion: 4
|
||||
m_Mass: 1
|
||||
m_Drag: 0
|
||||
m_AngularDrag: 0.05
|
||||
m_CenterOfMass: {x: 0, y: 0, z: 0}
|
||||
m_InertiaTensor: {x: 1, y: 1, z: 1}
|
||||
m_InertiaRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_IncludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ImplicitCom: 1
|
||||
m_ImplicitTensor: 1
|
||||
m_UseGravity: 1
|
||||
m_IsKinematic: 0
|
||||
m_Interpolate: 0
|
||||
m_Constraints: 0
|
||||
m_CollisionDetection: 0
|
||||
--- !u!1 &711059148
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -554,6 +663,143 @@ Transform:
|
|||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &816321262
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 816321263}
|
||||
m_Layer: 0
|
||||
m_Name: LeftPivot
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &816321263
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 816321262}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: -0.629}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 1227598784}
|
||||
m_Father: {fileID: 1298003772}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1227598780
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1227598784}
|
||||
- component: {fileID: 1227598783}
|
||||
- component: {fileID: 1227598782}
|
||||
- component: {fileID: 1227598781}
|
||||
m_Layer: 0
|
||||
m_Name: Door_L
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!65 &1227598781
|
||||
BoxCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1227598780}
|
||||
m_Material: {fileID: 0}
|
||||
m_IncludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_LayerOverridePriority: 0
|
||||
m_IsTrigger: 0
|
||||
m_ProvidesContacts: 0
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_Size: {x: 1, y: 1, z: 1}
|
||||
m_Center: {x: 0, y: 0, z: 0}
|
||||
--- !u!23 &1227598782
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1227598780}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 1
|
||||
m_DynamicOccludee: 1
|
||||
m_StaticShadowCaster: 0
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 2
|
||||
m_RayTraceProcedural: 0
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, type: 2}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_ReceiveGI: 1
|
||||
m_PreserveUVs: 0
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_StitchLightmapSeams: 1
|
||||
m_SelectedEditorRenderState: 3
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
m_AdditionalVertexStreams: {fileID: 0}
|
||||
--- !u!33 &1227598783
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1227598780}
|
||||
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!4 &1227598784
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1227598780}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0.629}
|
||||
m_LocalScale: {x: 0.076874, y: 2.7486115, z: 1.2618}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 816321263}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1230849064
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -808,6 +1054,181 @@ Transform:
|
|||
m_Children: []
|
||||
m_Father: {fileID: 1230849065}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1298003770
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1298003772}
|
||||
- component: {fileID: 1298003771}
|
||||
- component: {fileID: 1298003773}
|
||||
m_Layer: 0
|
||||
m_Name: Door
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!65 &1298003771
|
||||
BoxCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1298003770}
|
||||
m_Material: {fileID: 0}
|
||||
m_IncludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_LayerOverridePriority: 0
|
||||
m_IsTrigger: 1
|
||||
m_ProvidesContacts: 0
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_Size: {x: 0.76613146, y: 2.8170369, z: 2.598607}
|
||||
m_Center: {x: 0.29234776, y: 0.043456674, z: 0.63151026}
|
||||
--- !u!4 &1298003772
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1298003770}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 2.246, y: 1.383286, z: 9.38}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 331300393}
|
||||
- {fileID: 816321263}
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &1298003773
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1298003770}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 26c9348b92318d54799101fe69d795b6, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
doorLeft: {fileID: 816321262}
|
||||
doorRight: {fileID: 331300392}
|
||||
--- !u!1 &1318173673
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1318173677}
|
||||
- component: {fileID: 1318173676}
|
||||
- component: {fileID: 1318173675}
|
||||
- component: {fileID: 1318173674}
|
||||
m_Layer: 0
|
||||
m_Name: Door_R
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!65 &1318173674
|
||||
BoxCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1318173673}
|
||||
m_Material: {fileID: 0}
|
||||
m_IncludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_LayerOverridePriority: 0
|
||||
m_IsTrigger: 0
|
||||
m_ProvidesContacts: 0
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_Size: {x: 1, y: 1, z: 1}
|
||||
m_Center: {x: 0, y: 0, z: 0}
|
||||
--- !u!23 &1318173675
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1318173673}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 1
|
||||
m_DynamicOccludee: 1
|
||||
m_StaticShadowCaster: 0
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 2
|
||||
m_RayTraceProcedural: 0
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, type: 2}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_ReceiveGI: 1
|
||||
m_PreserveUVs: 0
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_StitchLightmapSeams: 1
|
||||
m_SelectedEditorRenderState: 3
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
m_AdditionalVertexStreams: {fileID: 0}
|
||||
--- !u!33 &1318173676
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1318173673}
|
||||
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!4 &1318173677
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1318173673}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: -0.62899995}
|
||||
m_LocalScale: {x: 0.076874, y: 2.7486115, z: 1.2618}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 331300393}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1521924625
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -992,6 +1413,7 @@ SceneRoots:
|
|||
m_ObjectHideFlags: 0
|
||||
m_Roots:
|
||||
- {fileID: 299639869}
|
||||
- {fileID: 520849215}
|
||||
- {fileID: 441087506}
|
||||
- {fileID: 756192408}
|
||||
- {fileID: 2092139010}
|
||||
|
@ -999,3 +1421,4 @@ SceneRoots:
|
|||
- {fileID: 624452552}
|
||||
- {fileID: 1230849065}
|
||||
- {fileID: 711059150}
|
||||
- {fileID: 1298003772}
|
||||
|
|
|
@ -12,14 +12,19 @@ using UnityEngine;
|
|||
|
||||
public class Despawn : MonoBehaviour
|
||||
{
|
||||
/// <summary>
|
||||
/// Destroy NPC object on trigger enter
|
||||
/// </summary>
|
||||
/// <param name="other"></param>
|
||||
public void OnTriggerEnter(Collider other)
|
||||
{
|
||||
Debug.Log(other.name);
|
||||
/*Debug.Log(other.name);*/
|
||||
|
||||
if (other.CompareTag("NPC"))
|
||||
{
|
||||
other.gameObject.SetActive(false);
|
||||
Destroy(other.gameObject);
|
||||
/*Debug.Log("NPC left");*/
|
||||
}
|
||||
}
|
||||
|
||||
|
|
100
SSLR/Assets/Scripts/Door.cs
Normal file
100
SSLR/Assets/Scripts/Door.cs
Normal file
|
@ -0,0 +1,100 @@
|
|||
/*
|
||||
* Author: Livinia Poo
|
||||
* Date: 24/1/25
|
||||
* Description:
|
||||
* Door opening for certain objects/conditions
|
||||
*/
|
||||
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Door : MonoBehaviour
|
||||
{
|
||||
/// <summary>
|
||||
/// References and variables
|
||||
/// </summary>
|
||||
private GameManager gm;
|
||||
|
||||
[SerializeField] private GameObject doorLeft;
|
||||
[SerializeField] private GameObject doorRight;
|
||||
|
||||
private bool doorOpened = false;
|
||||
|
||||
/// <summary>
|
||||
/// Assigning Objects to variables
|
||||
/// </summary>
|
||||
void Start()
|
||||
{
|
||||
gm = FindObjectOfType<GameManager>();
|
||||
if (gm == null)
|
||||
{
|
||||
Debug.LogError("GameManager not found!");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Open door based on certain conditions
|
||||
/// </summary>
|
||||
/// <param name="other"></param>
|
||||
void OnTriggerEnter(Collider other)
|
||||
{
|
||||
if (other.CompareTag("Player"))
|
||||
{
|
||||
if (!doorOpened)
|
||||
{
|
||||
if (!gm.dayEnded)
|
||||
{
|
||||
Debug.Log("Day hasn't ended!");
|
||||
}
|
||||
else
|
||||
{
|
||||
OpenDoor();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (other.CompareTag("NPC") && !doorOpened)
|
||||
{
|
||||
OpenDoor();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Rotating door meshes
|
||||
/// </summary>
|
||||
void OpenDoor()
|
||||
{
|
||||
if (doorOpened) return;
|
||||
|
||||
Vector3 currentLeftRotation = doorLeft.transform.eulerAngles;
|
||||
currentLeftRotation.y += 90;
|
||||
doorLeft.transform.eulerAngles = currentLeftRotation;
|
||||
|
||||
Vector3 currentRightRotation = doorRight.transform.eulerAngles;
|
||||
currentRightRotation.y -= 90;
|
||||
doorRight.transform.eulerAngles = currentRightRotation;
|
||||
|
||||
doorOpened = true;
|
||||
StartCoroutine(CloseDoorAfterDelay(0.75f));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Close door after .75f delay
|
||||
/// </summary>
|
||||
/// <param name="delay"></param>
|
||||
/// <returns></returns>
|
||||
IEnumerator CloseDoorAfterDelay(float delay)
|
||||
{
|
||||
yield return new WaitForSeconds(delay);
|
||||
|
||||
Vector3 currentLeftRotation = doorLeft.transform.eulerAngles;
|
||||
currentLeftRotation.y -= 90;
|
||||
doorLeft.transform.eulerAngles = currentLeftRotation;
|
||||
|
||||
Vector3 currentRightRotation = doorRight.transform.eulerAngles;
|
||||
currentRightRotation.y += 90;
|
||||
doorRight.transform.eulerAngles = currentRightRotation;
|
||||
|
||||
doorOpened = false;
|
||||
}
|
||||
}
|
11
SSLR/Assets/Scripts/Door.cs.meta
Normal file
11
SSLR/Assets/Scripts/Door.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 26c9348b92318d54799101fe69d795b6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
40
SSLR/Assets/Scripts/GameManager.cs
Normal file
40
SSLR/Assets/Scripts/GameManager.cs
Normal file
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* Author: Livinia Poo
|
||||
* Date: 24/1/25
|
||||
* Description:
|
||||
* Game Manager
|
||||
*/
|
||||
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class GameManager : MonoBehaviour
|
||||
{
|
||||
/// <summary>
|
||||
/// Assign GM instance
|
||||
/// </summary>
|
||||
public static GameManager instance;
|
||||
|
||||
/// <summary>
|
||||
/// References and Variables
|
||||
/// </summary>
|
||||
[SerializeField]
|
||||
public bool dayEnded = false;
|
||||
|
||||
/// <summary>
|
||||
/// Do Not Destroy on Load
|
||||
/// </summary>
|
||||
private void Awake()
|
||||
{
|
||||
if (instance == null)
|
||||
{
|
||||
instance = this;
|
||||
DontDestroyOnLoad(gameObject);
|
||||
}
|
||||
else
|
||||
{
|
||||
Destroy(gameObject);
|
||||
}
|
||||
}
|
||||
}
|
11
SSLR/Assets/Scripts/GameManager.cs.meta
Normal file
11
SSLR/Assets/Scripts/GameManager.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: e6811c2cb7e863c47867526938ecf072
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -11,16 +11,26 @@ using UnityEngine;
|
|||
|
||||
public class NPCMovement : MonoBehaviour
|
||||
{
|
||||
/// <summary>
|
||||
/// References and Variables
|
||||
/// </summary>
|
||||
public Transform[] walkPoints;
|
||||
public float movementSpeed = 10.0f;
|
||||
public float turnSpeed = 5.0f;
|
||||
private int currentPtIndex = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Start the coroutine
|
||||
/// </summary>
|
||||
void Start()
|
||||
{
|
||||
StartCoroutine(Walking());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Coroutine for NPC to walk to each point
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
IEnumerator Walking()
|
||||
{
|
||||
while (currentPtIndex < walkPoints.Length)
|
||||
|
@ -40,6 +50,7 @@ public class NPCMovement : MonoBehaviour
|
|||
|
||||
if (Vector3.Distance(transform.position, targetPt.position) < 0.1f)
|
||||
{
|
||||
/*Debug.Log($"Reached {currentPtIndex}");*/
|
||||
currentPtIndex++;
|
||||
|
||||
if (currentPtIndex >= walkPoints.Length)
|
||||
|
|
Loading…
Add table
Reference in a new issue