Skip to content

Commit ceec3be

Browse files
committed
Update Chapter 8
1 parent b7fa465 commit ceec3be

File tree

8 files changed

+126
-107
lines changed

8 files changed

+126
-107
lines changed

Chapter08/Assets/Scenes/NavMesh01-Simple.unity

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ NavMeshSettings:
114114
maxJumpAcrossDistance: 0
115115
minRegionArea: 2
116116
manualCellSize: 0
117-
cellSize: 0.3333333
117+
cellSize: 0.33333334
118118
manualTileSize: 0
119119
tileSize: 256
120120
accuratePlacement: 0
@@ -364,6 +364,7 @@ MonoBehaviour:
364364
m_Name:
365365
m_EditorClassIdentifier:
366366
targetMarker: {fileID: 1288038139}
367+
verticalOffset: 10
367368
--- !u!1 &437517160
368369
GameObject:
369370
m_ObjectHideFlags: 0
@@ -811,7 +812,7 @@ GameObject:
811812
m_TagString: Untagged
812813
m_Icon: {fileID: 0}
813814
m_NavMeshLayer: 1
814-
m_StaticEditorFlags: 4294967295
815+
m_StaticEditorFlags: 2147483647
815816
m_IsActive: 1
816817
--- !u!4 &1377038840
817818
Transform:
Binary file not shown.

Chapter08/Assets/Scripts/Target.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ public class Target : MonoBehaviour
55
{
66
private UnityEngine.AI.NavMeshAgent[] navAgents;
77
public Transform targetMarker;
8+
public float verticalOffset = 10.0f;
89

910
void Start ()
1011
{
@@ -24,16 +25,14 @@ void Update ()
2425
int button = 0;
2526

2627
//Get the point of the hit position when the mouse is being clicked
27-
if(Input.GetMouseButtonDown(button))
28-
{
28+
if (Input.GetMouseButtonDown(button)) {
2929
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
3030
RaycastHit hitInfo;
3131

32-
if (Physics.Raycast(ray.origin, ray.direction, out hitInfo))
33-
{
32+
if (Physics.Raycast(ray.origin, ray.direction, out hitInfo)) {
3433
Vector3 targetPosition = hitInfo.point;
3534
UpdateTargets(targetPosition);
36-
targetMarker.position = targetPosition + new Vector3(0,5,0);
35+
targetMarker.position = targetPosition + new Vector3(0, verticalOffset, 0);
3736
}
3837
}
3938
}

Chapter08/Packages/manifest.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
"com.unity.2d.sprite": "1.0.0",
44
"com.unity.2d.tilemap": "1.0.0",
55
"com.unity.ads": "3.7.5",
6-
"com.unity.analytics": "3.6.11",
7-
"com.unity.collab-proxy": "1.15.1",
6+
"com.unity.analytics": "3.7.1",
7+
"com.unity.collab-proxy": "1.15.4",
88
"com.unity.ide.rider": "3.0.7",
99
"com.unity.ide.visualstudio": "2.0.12",
1010
"com.unity.ide.vscode": "1.2.4",
1111
"com.unity.purchasing": "4.1.1",
12-
"com.unity.test-framework": "1.1.29",
12+
"com.unity.test-framework": "1.1.30",
1313
"com.unity.textmeshpro": "3.0.6",
1414
"com.unity.timeline": "1.7.0-pre.1",
1515
"com.unity.ugui": "1.0.0",

Chapter08/Packages/packages-lock.json

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,17 @@
2222
"url": "https://packages.unity.com"
2323
},
2424
"com.unity.analytics": {
25-
"version": "3.6.11",
25+
"version": "3.7.1",
2626
"depth": 0,
2727
"source": "registry",
2828
"dependencies": {
29+
"com.unity.services.analytics": "1.0.4",
2930
"com.unity.ugui": "1.0.0"
3031
},
3132
"url": "https://packages.unity.com"
3233
},
3334
"com.unity.collab-proxy": {
34-
"version": "1.15.1",
35+
"version": "1.15.4",
3536
"depth": 0,
3637
"source": "registry",
3738
"dependencies": {
@@ -73,7 +74,7 @@
7374
"url": "https://packages.unity.com"
7475
},
7576
"com.unity.nuget.newtonsoft-json": {
76-
"version": "2.0.0",
77+
"version": "2.0.2",
7778
"depth": 1,
7879
"source": "registry",
7980
"dependencies": {},
@@ -93,6 +94,15 @@
9394
},
9495
"url": "https://packages.unity.com"
9596
},
97+
"com.unity.services.analytics": {
98+
"version": "1.0.4",
99+
"depth": 1,
100+
"source": "registry",
101+
"dependencies": {
102+
"com.unity.services.core": "1.0.1"
103+
},
104+
"url": "https://packages.unity.com"
105+
},
96106
"com.unity.services.core": {
97107
"version": "1.0.1",
98108
"depth": 1,
@@ -103,7 +113,7 @@
103113
"url": "https://packages.unity.com"
104114
},
105115
"com.unity.test-framework": {
106-
"version": "1.1.29",
116+
"version": "1.1.30",
107117
"depth": 0,
108118
"source": "registry",
109119
"dependencies": {

Chapter08/ProjectSettings/NavMeshAreas.asset

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ NavMeshProjectSettings:
7373
m_Settings:
7474
- serializedVersion: 2
7575
agentTypeID: 0
76-
agentRadius: 0.5
76+
agentRadius: 10
7777
agentHeight: 2
7878
agentSlope: 45
7979
agentClimb: 0.75
@@ -85,6 +85,8 @@ NavMeshProjectSettings:
8585
manualTileSize: 0
8686
tileSize: 256
8787
accuratePlacement: 0
88+
maxJobWorkers: 0
89+
preserveTilesOutsideBounds: 0
8890
debug:
8991
m_Flags: 0
9092
m_SettingNames:
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
m_EditorVersion: 2022.1.0a15
2-
m_EditorVersionWithRevision: 2022.1.0a15 (49120632d05b)
1+
m_EditorVersion: 2022.1.0b2
2+
m_EditorVersionWithRevision: 2022.1.0b2 (980041f98dd2)

0 commit comments

Comments
 (0)