Minifix for better client navigation near seats

This commit is contained in:
Antoine H 2021-01-04 15:59:58 +01:00
parent 8ba1513020
commit 1c8711561b
3 changed files with 15 additions and 14 deletions

View file

@ -117,7 +117,7 @@ BoxCollider2D:
m_Enabled: 1 m_Enabled: 1
m_Density: 1 m_Density: 1
m_Material: {fileID: 0} m_Material: {fileID: 0}
m_IsTrigger: 1 m_IsTrigger: 0
m_UsedByEffector: 0 m_UsedByEffector: 0
m_UsedByComposite: 0 m_UsedByComposite: 0
m_Offset: {x: 0.0008151531, y: 0.09807843} m_Offset: {x: 0.0008151531, y: 0.09807843}
@ -178,10 +178,10 @@ NavMeshObstacle:
m_GameObject: {fileID: 5304524770463492230} m_GameObject: {fileID: 5304524770463492230}
m_Enabled: 0 m_Enabled: 0
serializedVersion: 3 serializedVersion: 3
m_Shape: 1 m_Shape: 0
m_Extents: {x: 0.15, y: 0.1, z: 0.00001} m_Extents: {x: 0.25, y: 0.275, z: 0.25}
m_MoveThreshold: 0.1 m_MoveThreshold: 0.1
m_Carve: 1 m_Carve: 1
m_CarveOnlyStationary: 1 m_CarveOnlyStationary: 1
m_Center: {x: 0, y: 0.1, z: 0} m_Center: {x: 0, y: 0.2, z: 0}
m_TimeToStationary: 0.5 m_TimeToStationary: 0.1

View file

@ -3122,7 +3122,7 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 380775747} m_GameObject: {fileID: 380775747}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -4.09, y: -0.31, z: 2.5482712} m_LocalPosition: {x: -4.113, y: -0.325, z: 2.5482712}
m_LocalScale: {x: 0.1, y: 0.1, z: 0.1} m_LocalScale: {x: 0.1, y: 0.1, z: 0.1}
m_Children: [] m_Children: []
m_Father: {fileID: 1863361785} m_Father: {fileID: 1863361785}
@ -3558,7 +3558,7 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 837069666} m_GameObject: {fileID: 837069666}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -0.83, y: -0.76, z: 2.5482712} m_LocalPosition: {x: -0.878, y: -0.784, z: 2.5482712}
m_LocalScale: {x: 0.1, y: 0.1, z: 0.1} m_LocalScale: {x: 0.1, y: 0.1, z: 0.1}
m_Children: [] m_Children: []
m_Father: {fileID: 1863361785} m_Father: {fileID: 1863361785}
@ -3588,7 +3588,7 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 885015723} m_GameObject: {fileID: 885015723}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -4.63, y: -0.74, z: 2.5482712} m_LocalPosition: {x: -4.63, y: -0.815, z: 2.5482712}
m_LocalScale: {x: 0.1, y: 0.1, z: 0.1} m_LocalScale: {x: 0.1, y: 0.1, z: 0.1}
m_Children: [] m_Children: []
m_Father: {fileID: 1863361785} m_Father: {fileID: 1863361785}
@ -32709,7 +32709,7 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1756509214} m_GameObject: {fileID: 1756509214}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -3.4, y: -2.64, z: 2.5482712} m_LocalPosition: {x: -3.4, y: -2.6, z: 2.5482712}
m_LocalScale: {x: 0.1, y: 0.1, z: 0.1} m_LocalScale: {x: 0.1, y: 0.1, z: 0.1}
m_Children: [] m_Children: []
m_Father: {fileID: 1863361785} m_Father: {fileID: 1863361785}
@ -32728,12 +32728,12 @@ NavMeshObstacle:
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1810629360} m_GameObject: {fileID: 1810629360}
m_Enabled: 0 m_Enabled: 1
serializedVersion: 3 serializedVersion: 3
m_Shape: 0 m_Shape: 0
m_Extents: {x: 0.2, y: 0.2, z: 0.2} m_Extents: {x: 0.2, y: 0.2, z: 0.2}
m_MoveThreshold: 0.1 m_MoveThreshold: 0.1
m_Carve: 0 m_Carve: 1
m_CarveOnlyStationary: 1 m_CarveOnlyStationary: 1
m_Center: {x: 0, y: 0.2, z: 0} m_Center: {x: 0, y: 0.2, z: 0}
m_TimeToStationary: 0.5 m_TimeToStationary: 0.5

View file

@ -25,6 +25,7 @@ public class Client_controller : MonoBehaviour, IUsable
//Switch Agent to obstacle if waiting //Switch Agent to obstacle if waiting
if(value=="waiting") if(value=="waiting")
{ {
agent.Warp(agent.destination); //Make sure agent become static at right position
agent.enabled = false; agent.enabled = false;
navObstacle.enabled = true; navObstacle.enabled = true;
} }
@ -100,7 +101,7 @@ public class Client_controller : MonoBehaviour, IUsable
agent.updateRotation = false; agent.updateRotation = false;
agent.updateUpAxis = false; agent.updateUpAxis = false;
//Get target //Get target
agent.destination = ClientManager.Instance.assignTarget(); agent.SetDestination(ClientManager.Instance.assignTarget());
//Assign Random priority to prevent two agent blocking each other //Assign Random priority to prevent two agent blocking each other
agent.avoidancePriority=Random.Range(0, 99); agent.avoidancePriority=Random.Range(0, 99);
@ -126,7 +127,7 @@ public class Client_controller : MonoBehaviour, IUsable
{ {
//Leave tavern //Leave tavern
status = "leaving"; status = "leaving";
agent.destination = ClientManager.Instance.assignTarget(agent.destination); //Request next target agent.SetDestination(ClientManager.Instance.assignTarget(agent.destination)); //Request next target
} }
} }
@ -148,7 +149,7 @@ public class Client_controller : MonoBehaviour, IUsable
//Leave tavern //Leave tavern
status = "leaving"; status = "leaving";
agent.destination = ClientManager.Instance.assignTarget(agent.destination); //Request next target agent.SetDestination(ClientManager.Instance.assignTarget(agent.destination)); //Request next target
} }
} }