First client navigation
This commit is contained in:
parent
57088cfd12
commit
2db3e27a47
10 changed files with 493 additions and 12 deletions
|
@ -13,6 +13,7 @@ GameObject:
|
||||||
- component: {fileID: 5304524770463492229}
|
- component: {fileID: 5304524770463492229}
|
||||||
- component: {fileID: 5304524770463492234}
|
- component: {fileID: 5304524770463492234}
|
||||||
- component: {fileID: 5304524770463492233}
|
- component: {fileID: 5304524770463492233}
|
||||||
|
- component: {fileID: 8842024822361446808}
|
||||||
m_Layer: 8
|
m_Layer: 8
|
||||||
m_Name: Oldman
|
m_Name: Oldman
|
||||||
m_TagString: Usable
|
m_TagString: Usable
|
||||||
|
@ -27,7 +28,7 @@ Transform:
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 5304524770463492230}
|
m_GameObject: {fileID: 5304524770463492230}
|
||||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
m_LocalPosition: {x: -1.584, y: -1.731, z: 0}
|
m_LocalPosition: {x: -1.584, y: -1.731, z: 0}
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_Children: []
|
m_Children: []
|
||||||
|
@ -145,3 +146,25 @@ MonoBehaviour:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
consumeTime: 3
|
consumeTime: 3
|
||||||
waitingTime: 10
|
waitingTime: 10
|
||||||
|
--- !u!195 &8842024822361446808
|
||||||
|
NavMeshAgent:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 5304524770463492230}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_AgentTypeID: 0
|
||||||
|
m_Radius: 0.32
|
||||||
|
m_Speed: 1
|
||||||
|
m_Acceleration: 8
|
||||||
|
avoidancePriority: 50
|
||||||
|
m_AngularSpeed: 120
|
||||||
|
m_StoppingDistance: 0
|
||||||
|
m_AutoTraverseOffMeshLink: 1
|
||||||
|
m_AutoBraking: 1
|
||||||
|
m_AutoRepath: 1
|
||||||
|
m_Height: 1.28
|
||||||
|
m_BaseOffset: 0.64
|
||||||
|
m_WalkableMask: 4294967295
|
||||||
|
m_ObstacleAvoidanceType: 4
|
||||||
|
|
8
Assets/Scenes/Tests/SampleScene.meta
Normal file
8
Assets/Scenes/Tests/SampleScene.meta
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 56d8194ea8c43424b9195430d7c9a086
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -124,6 +124,80 @@ NavMeshSettings:
|
||||||
debug:
|
debug:
|
||||||
m_Flags: 0
|
m_Flags: 0
|
||||||
m_NavMeshData: {fileID: 0}
|
m_NavMeshData: {fileID: 0}
|
||||||
|
--- !u!1001 &47257443
|
||||||
|
PrefabInstance:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Modification:
|
||||||
|
m_TransformParent: {fileID: 0}
|
||||||
|
m_Modifications:
|
||||||
|
- target: {fileID: 5304524770463492230, guid: 2dde00c8c5857d2438fd92435d8c3abb,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_Name
|
||||||
|
value: Oldman
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 5304524770463492230, guid: 2dde00c8c5857d2438fd92435d8c3abb,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_IsActive
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 5304524770463492235, guid: 2dde00c8c5857d2438fd92435d8c3abb,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_RootOrder
|
||||||
|
value: 1
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 5304524770463492235, guid: 2dde00c8c5857d2438fd92435d8c3abb,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_LocalPosition.x
|
||||||
|
value: 2.64
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 5304524770463492235, guid: 2dde00c8c5857d2438fd92435d8c3abb,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_LocalPosition.y
|
||||||
|
value: 0.39
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 5304524770463492235, guid: 2dde00c8c5857d2438fd92435d8c3abb,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_LocalPosition.z
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 5304524770463492235, guid: 2dde00c8c5857d2438fd92435d8c3abb,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_LocalRotation.w
|
||||||
|
value: 1
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 5304524770463492235, guid: 2dde00c8c5857d2438fd92435d8c3abb,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_LocalRotation.x
|
||||||
|
value: -0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 5304524770463492235, guid: 2dde00c8c5857d2438fd92435d8c3abb,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_LocalRotation.y
|
||||||
|
value: -0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 5304524770463492235, guid: 2dde00c8c5857d2438fd92435d8c3abb,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_LocalRotation.z
|
||||||
|
value: -0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 5304524770463492235, guid: 2dde00c8c5857d2438fd92435d8c3abb,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_LocalEulerAnglesHint.x
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 5304524770463492235, guid: 2dde00c8c5857d2438fd92435d8c3abb,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_LocalEulerAnglesHint.y
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 5304524770463492235, guid: 2dde00c8c5857d2438fd92435d8c3abb,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_LocalEulerAnglesHint.z
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
m_RemovedComponents: []
|
||||||
|
m_SourcePrefab: {fileID: 100100000, guid: 2dde00c8c5857d2438fd92435d8c3abb, type: 3}
|
||||||
--- !u!1 &268005788
|
--- !u!1 &268005788
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
@ -135,6 +209,8 @@ GameObject:
|
||||||
- component: {fileID: 268005789}
|
- component: {fileID: 268005789}
|
||||||
- component: {fileID: 268005791}
|
- component: {fileID: 268005791}
|
||||||
- component: {fileID: 268005790}
|
- component: {fileID: 268005790}
|
||||||
|
- component: {fileID: 268005792}
|
||||||
|
- component: {fileID: 268005793}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: Meubles
|
m_Name: Meubles
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
|
@ -2807,6 +2883,102 @@ Tilemap:
|
||||||
e31: 0
|
e31: 0
|
||||||
e32: 0
|
e32: 0
|
||||||
e33: 1
|
e33: 1
|
||||||
|
--- !u!19719996 &268005792
|
||||||
|
TilemapCollider2D:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 268005788}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_Density: 1
|
||||||
|
m_Material: {fileID: 0}
|
||||||
|
m_IsTrigger: 0
|
||||||
|
m_UsedByEffector: 0
|
||||||
|
m_UsedByComposite: 0
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
m_MaximumTileChangeCount: 1000
|
||||||
|
m_ExtrusionFactor: 0.00001
|
||||||
|
--- !u!114 &268005793
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 268005788}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 1e3fdca004f2d45fe8abbed571a8abd5, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_OverrideArea: 1
|
||||||
|
m_Area: 1
|
||||||
|
m_IgnoreFromBuild: 0
|
||||||
|
m_AffectedAgents: ffffffff
|
||||||
|
--- !u!1 &322056902
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 322056904}
|
||||||
|
- component: {fileID: 322056903}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: NavMesh
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!114 &322056903
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 322056902}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 148387606d0ccd84fa326ca211f274ba, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_AgentTypeID: 0
|
||||||
|
m_CollectObjects: 0
|
||||||
|
m_Size: {x: 10, y: 10, z: 10}
|
||||||
|
m_Center: {x: 0, y: 2, z: 0}
|
||||||
|
m_LayerMask:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 4294967295
|
||||||
|
m_UseGeometry: 1
|
||||||
|
m_OverrideByGrid: 0
|
||||||
|
m_UseMeshPrefab: {fileID: 0}
|
||||||
|
m_CompressBounds: 0
|
||||||
|
m_OverrideVector: {x: 1, y: 1, z: 1}
|
||||||
|
m_DefaultArea: 0
|
||||||
|
m_IgnoreNavMeshAgent: 1
|
||||||
|
m_IgnoreNavMeshObstacle: 1
|
||||||
|
m_OverrideTileSize: 0
|
||||||
|
m_TileSize: 256
|
||||||
|
m_OverrideVoxelSize: 0
|
||||||
|
m_VoxelSize: 0.033333335
|
||||||
|
m_BuildHeightMesh: 0
|
||||||
|
m_NavMeshData: {fileID: 23800000, guid: cc7937d7981ac7544ad06b3b6e620754, type: 2}
|
||||||
|
--- !u!4 &322056904
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 322056902}
|
||||||
|
m_LocalRotation: {x: -0.7071068, y: 0, z: 0, w: 0.7071068}
|
||||||
|
m_LocalPosition: {x: 6.17, y: -0.66, z: -2.4934947}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 0}
|
||||||
|
m_RootOrder: 9
|
||||||
|
m_LocalEulerAnglesHint: {x: -90, y: 0, z: 0}
|
||||||
--- !u!1 &519420028
|
--- !u!1 &519420028
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
@ -2888,7 +3060,7 @@ Transform:
|
||||||
m_LocalScale: {x: 0.5, y: 0.5, z: 1}
|
m_LocalScale: {x: 0.5, y: 0.5, z: 1}
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_RootOrder: 1
|
m_RootOrder: 3
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
--- !u!1 &698542424
|
--- !u!1 &698542424
|
||||||
GameObject:
|
GameObject:
|
||||||
|
@ -2998,7 +3170,7 @@ Transform:
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_RootOrder: 3
|
m_RootOrder: 4
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
--- !u!1 &706948613
|
--- !u!1 &706948613
|
||||||
GameObject:
|
GameObject:
|
||||||
|
@ -3121,7 +3293,7 @@ Transform:
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_RootOrder: 5
|
m_RootOrder: 6
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
--- !u!1 &966209153
|
--- !u!1 &966209153
|
||||||
GameObject:
|
GameObject:
|
||||||
|
@ -3168,7 +3340,7 @@ Transform:
|
||||||
- {fileID: 268005789}
|
- {fileID: 268005789}
|
||||||
- {fileID: 2115704629}
|
- {fileID: 2115704629}
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_RootOrder: 7
|
m_RootOrder: 8
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
--- !u!1 &1145481934
|
--- !u!1 &1145481934
|
||||||
GameObject:
|
GameObject:
|
||||||
|
@ -3181,6 +3353,8 @@ GameObject:
|
||||||
- component: {fileID: 1145481935}
|
- component: {fileID: 1145481935}
|
||||||
- component: {fileID: 1145481937}
|
- component: {fileID: 1145481937}
|
||||||
- component: {fileID: 1145481936}
|
- component: {fileID: 1145481936}
|
||||||
|
- component: {fileID: 1145481938}
|
||||||
|
- component: {fileID: 1145481939}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: "Murs et Portes/fen\xEAtres"
|
m_Name: "Murs et Portes/fen\xEAtres"
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
|
@ -6783,6 +6957,38 @@ Tilemap:
|
||||||
e31: 0
|
e31: 0
|
||||||
e32: 0
|
e32: 0
|
||||||
e33: 1
|
e33: 1
|
||||||
|
--- !u!19719996 &1145481938
|
||||||
|
TilemapCollider2D:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1145481934}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_Density: 1
|
||||||
|
m_Material: {fileID: 0}
|
||||||
|
m_IsTrigger: 0
|
||||||
|
m_UsedByEffector: 0
|
||||||
|
m_UsedByComposite: 0
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
m_MaximumTileChangeCount: 1000
|
||||||
|
m_ExtrusionFactor: 0.00001
|
||||||
|
--- !u!114 &1145481939
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1145481934}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 1e3fdca004f2d45fe8abbed571a8abd5, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_OverrideArea: 1
|
||||||
|
m_Area: 1
|
||||||
|
m_IgnoreFromBuild: 0
|
||||||
|
m_AffectedAgents: ffffffff
|
||||||
--- !u!1 &1160225020
|
--- !u!1 &1160225020
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
@ -6822,7 +7028,9 @@ Transform:
|
||||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||||
m_LocalPosition: {x: -0.21348187, y: 4.0925093, z: -2.1510859}
|
m_LocalPosition: {x: -0.21348187, y: 4.0925093, z: -2.1510859}
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_Children: []
|
m_Children:
|
||||||
|
- {fileID: 1863361785}
|
||||||
|
- {fileID: 1486551544}
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_RootOrder: 0
|
m_RootOrder: 0
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
@ -6921,7 +7129,7 @@ Transform:
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_RootOrder: 4
|
m_RootOrder: 5
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
--- !u!61 &1163880825
|
--- !u!61 &1163880825
|
||||||
BoxCollider2D:
|
BoxCollider2D:
|
||||||
|
@ -7075,7 +7283,37 @@ Transform:
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_RootOrder: 6
|
m_RootOrder: 7
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!1 &1486551543
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 1486551544}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: ClientSpawn
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: -5487077368411116049, guid: 0000000000000000d000000000000000, type: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!4 &1486551544
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1486551543}
|
||||||
|
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||||
|
m_LocalPosition: {x: 4.963482, y: -3.7325091, z: -3.6281848}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 1160225022}
|
||||||
|
m_RootOrder: 1
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
--- !u!1 &1520733216
|
--- !u!1 &1520733216
|
||||||
GameObject:
|
GameObject:
|
||||||
|
@ -7088,6 +7326,7 @@ GameObject:
|
||||||
- component: {fileID: 1520733217}
|
- component: {fileID: 1520733217}
|
||||||
- component: {fileID: 1520733219}
|
- component: {fileID: 1520733219}
|
||||||
- component: {fileID: 1520733218}
|
- component: {fileID: 1520733218}
|
||||||
|
- component: {fileID: 1520733220}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: Sols
|
m_Name: Sols
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
|
@ -31829,6 +32068,136 @@ Tilemap:
|
||||||
e31: 0
|
e31: 0
|
||||||
e32: 0
|
e32: 0
|
||||||
e33: 1
|
e33: 1
|
||||||
|
--- !u!114 &1520733220
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1520733216}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 1e3fdca004f2d45fe8abbed571a8abd5, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_OverrideArea: 0
|
||||||
|
m_Area: 0
|
||||||
|
m_IgnoreFromBuild: 0
|
||||||
|
m_AffectedAgents: ffffffff
|
||||||
|
--- !u!1 &1678986451
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 1678986453}
|
||||||
|
- component: {fileID: 1678986452}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: Chair 1
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 6519382022992737161, guid: 0000000000000000d000000000000000, type: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!212 &1678986452
|
||||||
|
SpriteRenderer:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1678986451}
|
||||||
|
m_Enabled: 0
|
||||||
|
m_CastShadows: 0
|
||||||
|
m_ReceiveShadows: 0
|
||||||
|
m_DynamicOccludee: 1
|
||||||
|
m_MotionVectors: 1
|
||||||
|
m_LightProbeUsage: 1
|
||||||
|
m_ReflectionProbeUsage: 1
|
||||||
|
m_RayTracingMode: 0
|
||||||
|
m_RayTraceProcedural: 0
|
||||||
|
m_RenderingLayerMask: 1
|
||||||
|
m_RendererPriority: 0
|
||||||
|
m_Materials:
|
||||||
|
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
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: 0
|
||||||
|
m_MinimumChartSize: 4
|
||||||
|
m_AutoUVMaxDistance: 0.5
|
||||||
|
m_AutoUVMaxAngle: 89
|
||||||
|
m_LightmapParameters: {fileID: 0}
|
||||||
|
m_SortingLayerID: 0
|
||||||
|
m_SortingLayer: 0
|
||||||
|
m_SortingOrder: 0
|
||||||
|
m_Sprite: {fileID: -1209127185579228243, guid: bfabe3920bf35724b9a95bf95f5431a9,
|
||||||
|
type: 3}
|
||||||
|
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
m_FlipX: 0
|
||||||
|
m_FlipY: 0
|
||||||
|
m_DrawMode: 0
|
||||||
|
m_Size: {x: 0.175, y: 0.2}
|
||||||
|
m_AdaptiveModeThreshold: 0.5
|
||||||
|
m_SpriteTileMode: 0
|
||||||
|
m_WasSpriteAssigned: 1
|
||||||
|
m_MaskInteraction: 0
|
||||||
|
m_SpriteSortPoint: 0
|
||||||
|
--- !u!4 &1678986453
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1678986451}
|
||||||
|
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||||
|
m_LocalPosition: {x: -6.6, y: -2.112, z: 2.5482712}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 1863361785}
|
||||||
|
m_RootOrder: 0
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!1 &1863361784
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 1863361785}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: Targets
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!4 &1863361785
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1863361784}
|
||||||
|
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||||
|
m_LocalPosition: {x: 4.208972, y: -3.622787, z: -3.5789394}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_Children:
|
||||||
|
- {fileID: 1678986453}
|
||||||
|
m_Father: {fileID: 1160225022}
|
||||||
|
m_RootOrder: 0
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
--- !u!1 &2115704628
|
--- !u!1 &2115704628
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
BIN
Assets/Scenes/Tests/SampleScene/NavMesh-NavMesh.asset
Normal file
BIN
Assets/Scenes/Tests/SampleScene/NavMesh-NavMesh.asset
Normal file
Binary file not shown.
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: cc7937d7981ac7544ad06b3b6e620754
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 0
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -1,9 +1,11 @@
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using UnityEngine.AI;
|
||||||
|
|
||||||
//Define the behavior of a client
|
//Define the behavior of a client
|
||||||
[RequireComponent(typeof(Collider2D))]
|
[RequireComponent(typeof(Collider2D))]
|
||||||
|
[RequireComponent(typeof(NavMeshAgent))]
|
||||||
public class Client_controller : MonoBehaviour, IUsable
|
public class Client_controller : MonoBehaviour, IUsable
|
||||||
{
|
{
|
||||||
public float consumeTime = 3.0f; //Time to consume currentMug
|
public float consumeTime = 3.0f; //Time to consume currentMug
|
||||||
|
@ -12,6 +14,10 @@ public class Client_controller : MonoBehaviour, IUsable
|
||||||
float consumeTimer;
|
float consumeTimer;
|
||||||
GameObject currentMug = null; //Mug currently held by the client
|
GameObject currentMug = null; //Mug currently held by the client
|
||||||
|
|
||||||
|
Transform target;
|
||||||
|
Vector2 destination;
|
||||||
|
NavMeshAgent agent;
|
||||||
|
|
||||||
//Handle objects interactions w/ Workshop
|
//Handle objects interactions w/ Workshop
|
||||||
//Return wether the object is taken from tavernkeeper
|
//Return wether the object is taken from tavernkeeper
|
||||||
public bool use(GameObject object_used)
|
public bool use(GameObject object_used)
|
||||||
|
@ -55,11 +61,26 @@ public class Client_controller : MonoBehaviour, IUsable
|
||||||
Debug.LogWarning(gameObject.name+" layer should be set to 'Interactions' to work properly");
|
Debug.LogWarning(gameObject.name+" layer should be set to 'Interactions' to work properly");
|
||||||
if(gameObject.tag != "Usable")
|
if(gameObject.tag != "Usable")
|
||||||
Debug.LogWarning(gameObject.name+" tag should be set to 'Usable' to work properly");
|
Debug.LogWarning(gameObject.name+" tag should be set to 'Usable' to work properly");
|
||||||
|
|
||||||
|
// Navigation //
|
||||||
|
agent = GetComponent<NavMeshAgent>();
|
||||||
|
//Prevent rotation of the ground at movement
|
||||||
|
agent.updateRotation = false;
|
||||||
|
agent.updateUpAxis = false;
|
||||||
|
//Get target
|
||||||
|
agent.destination = ClientManager.Instance.assignTarget().position;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update is called once per frame
|
// Update is called once per frame
|
||||||
void Update()
|
void Update()
|
||||||
{
|
{
|
||||||
|
//Navigation
|
||||||
|
// if (Vector2.Distance(destination, target.position) > 1.0f)
|
||||||
|
// {
|
||||||
|
// destination = target.position;
|
||||||
|
// agent.destination = destination;
|
||||||
|
// }
|
||||||
|
|
||||||
//Timer
|
//Timer
|
||||||
if (currentMug!= null) //Consuming mug if there's one
|
if (currentMug!= null) //Consuming mug if there's one
|
||||||
{
|
{
|
||||||
|
|
|
@ -9,18 +9,20 @@ public sealed class ClientManager : MonoBehaviour
|
||||||
int currentNbClient = 0;
|
int currentNbClient = 0;
|
||||||
int nbMaxClients = 1;
|
int nbMaxClients = 1;
|
||||||
bool clientSpawnReady = false;
|
bool clientSpawnReady = false;
|
||||||
float clientSpawnTimer = 2.0f; //Intial time before first spawn (pseudo-random after that)
|
float clientSpawnTimer = 0.5f; //Intial time before first spawn (pseudo-random after that)
|
||||||
float maxTimeNewClients = 10.0f;
|
float maxTimeNewClients = 10.0f;
|
||||||
|
|
||||||
string ClientRessourceFolder = "Clients";
|
string ClientRessourceFolder = "Clients";
|
||||||
Vector3 spawnPosition = new Vector3(0, 0, 0);
|
|
||||||
private Object[] clients;
|
private Object[] clients;
|
||||||
|
|
||||||
|
Vector3 spawnPosition = new Vector3(0, 0, 0); //TODO : Use gameObject
|
||||||
|
Dictionary<Transform, bool> targets_dict; //Dict with target and wether they're taken by a client
|
||||||
|
|
||||||
//Request new client
|
//Request new client
|
||||||
//Return wether a new client was created
|
//Return wether a new client was created
|
||||||
public bool clientRequest()
|
public bool clientRequest()
|
||||||
{
|
{
|
||||||
if(clientSpawnReady && currentNbClient<nbMaxClients)
|
if(clientSpawnReady && currentNbClient<nbMaxClients && targets_dict.ContainsValue(false))
|
||||||
{
|
{
|
||||||
GameObject newClient = (GameObject)clients[Random.Range(0, clients.Length)];
|
GameObject newClient = (GameObject)clients[Random.Range(0, clients.Length)];
|
||||||
// Debug.Log("Spawning "+clientPrefab.name+" at "+spawnPosition);
|
// Debug.Log("Spawning "+clientPrefab.name+" at "+spawnPosition);
|
||||||
|
@ -34,9 +36,24 @@ public sealed class ClientManager : MonoBehaviour
|
||||||
return false; //No new client
|
return false; //No new client
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Assign a random available target
|
||||||
|
public Transform assignTarget()
|
||||||
|
{
|
||||||
|
List<Transform> avail_tgt = new List<Transform>();
|
||||||
|
foreach(KeyValuePair<Transform, bool> tgt in targets_dict)
|
||||||
|
if(tgt.Value is false)
|
||||||
|
avail_tgt.Add(tgt.Key);
|
||||||
|
|
||||||
|
Transform target = avail_tgt[Random.Range(0, avail_tgt.Count)];
|
||||||
|
targets_dict[target]=true;
|
||||||
|
return target;
|
||||||
|
}
|
||||||
|
|
||||||
// Start is called before the first frame update
|
// Start is called before the first frame update
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
|
// Load clients prefabs //
|
||||||
|
|
||||||
// Find all assets labelled with 'usable' :
|
// Find all assets labelled with 'usable' :
|
||||||
// string[] guids = AssetDatabase.FindAssets("", new string[] {"Assets/Prefabs/Characters/Clients"});
|
// string[] guids = AssetDatabase.FindAssets("", new string[] {"Assets/Prefabs/Characters/Clients"});
|
||||||
|
|
||||||
|
@ -52,6 +69,31 @@ public sealed class ClientManager : MonoBehaviour
|
||||||
{
|
{
|
||||||
Debug.Log(gameObject.name+" : "+c.name + " loaded");
|
Debug.Log(gameObject.name+" : "+c.name + " loaded");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Load Client spawn point //
|
||||||
|
GameObject spawnObj = GameObject.Find("/GameSystem/ClientSpawn");
|
||||||
|
if (spawnObj is null)
|
||||||
|
throw new System.Exception("No ClientSpawn GameObject found under GameSystem");
|
||||||
|
spawnPosition = spawnObj.transform.position;
|
||||||
|
|
||||||
|
// Load Client targets //
|
||||||
|
targets_dict = new Dictionary<Transform, bool>();
|
||||||
|
GameObject targetsObj = GameObject.Find("/GameSystem/Targets");
|
||||||
|
if (targetsObj is null)
|
||||||
|
throw new System.Exception("No Targets GameObject found under GameSystem");
|
||||||
|
|
||||||
|
Component[] targets = targetsObj.GetComponentsInChildren<Transform>();
|
||||||
|
if(targets != null)
|
||||||
|
{
|
||||||
|
foreach(Transform target in targets)
|
||||||
|
{
|
||||||
|
if(target.gameObject.name != "Targets")
|
||||||
|
{
|
||||||
|
targets_dict.Add(target, false);
|
||||||
|
Debug.Log("Client target : "+ target.gameObject.name + target.position);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update is called once per frame
|
// Update is called once per frame
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"com.h8man.2d.navmeshplus": "https://github.com/h8man/NavMeshPlus.git#master",
|
||||||
"com.unity.2d.animation": "4.2.6",
|
"com.unity.2d.animation": "4.2.6",
|
||||||
"com.unity.2d.pixel-perfect": "3.0.2",
|
"com.unity.2d.pixel-perfect": "3.0.2",
|
||||||
"com.unity.2d.psdimporter": "3.1.6",
|
"com.unity.2d.psdimporter": "3.1.6",
|
||||||
|
|
|
@ -1,5 +1,12 @@
|
||||||
{
|
{
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"com.h8man.2d.navmeshplus": {
|
||||||
|
"version": "https://github.com/h8man/NavMeshPlus.git#master",
|
||||||
|
"depth": 0,
|
||||||
|
"source": "git",
|
||||||
|
"dependencies": {},
|
||||||
|
"hash": "86ceea0dfe7bcd8db2a486bd68c4c095ae4299e0"
|
||||||
|
},
|
||||||
"com.unity.2d.animation": {
|
"com.unity.2d.animation": {
|
||||||
"version": "4.2.6",
|
"version": "4.2.6",
|
||||||
"depth": 0,
|
"depth": 0,
|
||||||
|
|
|
@ -73,7 +73,7 @@ NavMeshProjectSettings:
|
||||||
m_Settings:
|
m_Settings:
|
||||||
- serializedVersion: 2
|
- serializedVersion: 2
|
||||||
agentTypeID: 0
|
agentTypeID: 0
|
||||||
agentRadius: 0.5
|
agentRadius: 0.1
|
||||||
agentHeight: 2
|
agentHeight: 2
|
||||||
agentSlope: 45
|
agentSlope: 45
|
||||||
agentClimb: 0.75
|
agentClimb: 0.75
|
||||||
|
@ -85,6 +85,8 @@ NavMeshProjectSettings:
|
||||||
manualTileSize: 0
|
manualTileSize: 0
|
||||||
tileSize: 256
|
tileSize: 256
|
||||||
accuratePlacement: 0
|
accuratePlacement: 0
|
||||||
|
maxJobWorkers: 0
|
||||||
|
preserveTilesOutsideBounds: 0
|
||||||
debug:
|
debug:
|
||||||
m_Flags: 0
|
m_Flags: 0
|
||||||
m_SettingNames:
|
m_SettingNames:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue