Skip to content

Commit a620824

Browse files
committed
Correction following Alexandre review
1 parent 087f4b8 commit a620824

File tree

7 files changed

+21
-102
lines changed

7 files changed

+21
-102
lines changed

UOP1_Project/Assets/Prefabs/Gameplay/Pathway.meta

Lines changed: 0 additions & 8 deletions
This file was deleted.

UOP1_Project/Assets/Prefabs/Gameplay/Pathway/Pathway.prefab

Lines changed: 0 additions & 53 deletions
This file was deleted.

UOP1_Project/Assets/Prefabs/Gameplay/Pathway/Pathway.prefab.meta

Lines changed: 0 additions & 7 deletions
This file was deleted.

UOP1_Project/Assets/ScriptableObjects/StateMachine/Config/NPCPathwayConfig.asset

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,35 +14,29 @@ MonoBehaviour:
1414
m_EditorClassIdentifier:
1515
_stopDuration: 0.5
1616
_speed: 1
17-
waypoints:
18-
- {x: 0, y: 0.033730388, z: 0}
19-
- {x: 0, y: 0.033730388, z: 0}
20-
- {x: 0, y: 0.033730388, z: 0}
21-
- {x: 0, y: 0.033730388, z: 0}
22-
- {x: 0, y: 0.033730388, z: 0}
23-
- {x: 0, y: 0.033730388, z: 0}
24-
- {x: 0, y: 0.033730388, z: 0}
25-
HidePathway: 0
2617
_lineColor: {r: 0, g: 0.19270587, b: 1, a: 1}
2718
_textSize: 20
2819
_textColor: {r: 1, g: 1, b: 1, a: 1}
29-
_probeRadius: 13.2
20+
_probeRadius: 5
3021
DisplayProbes: 0
31-
ToggledNavMeshDisplay: 0
22+
ToggledNavMeshDisplay: 1
3223
RealTimeEnabled: 1
3324
Waypoints:
34-
- waypoint: {x: -8.50028, y: 0.033730388, z: 1.5602589}
25+
- waypoint: {x: -12.400441, y: 0.2169903, z: 14.62578}
3526
corners:
36-
- {x: -8.50028, y: 0.033730388, z: 1.5602589}
37-
- {x: 2.6641674, y: 0.033730388, z: -8.3147135}
38-
- waypoint: {x: 2.6641674, y: 0.033730388, z: -8.3147135}
27+
- {x: -12.400441, y: 0.2169903, z: 14.62578}
28+
- {x: -10.209248, y: 0.033730388, z: -9.870466}
29+
- waypoint: {x: -10.209248, y: 0.033730388, z: -9.870466}
3930
corners:
40-
- {x: 2.6641674, y: 0.033730388, z: -8.3147135}
41-
- {x: 4, y: 0.033730388, z: -6.799999}
42-
- {x: 10.939352, y: 0.15480933, z: -0.32895184}
43-
- waypoint: {x: 10.939352, y: 0.15480933, z: -0.32895184}
31+
- {x: -10.209248, y: 0.033730388, z: -9.870466}
32+
- {x: -4.5, y: 0.033730388, z: -9}
33+
- {x: -0.8999996, y: 0.033730388, z: -8.5}
34+
- {x: 11.389833, y: 0.18379807, z: 0.2561388}
35+
- waypoint: {x: 11.389833, y: 0.18379807, z: 0.2561388}
4436
corners:
45-
- {x: 10.939352, y: 0.15480933, z: -0.32895184}
46-
- {x: 5.6, y: 0.033730388, z: -0.8999996}
47-
- {x: 4.8, y: 0.033730388, z: -0.8999996}
48-
- {x: -8.50028, y: 0.033730388, z: 1.5602589}
37+
- {x: 11.389833, y: 0.18379807, z: 0.2561388}
38+
- {x: 7.3375273, y: 0.2178752, z: 16.793528}
39+
- waypoint: {x: 7.3375273, y: 0.2178752, z: 16.793528}
40+
corners:
41+
- {x: 7.3375273, y: 0.2178752, z: 16.793528}
42+
- {x: -12.400441, y: 0.2169903, z: 14.62578}

UOP1_Project/Assets/Scripts/Characters/Config/PathwayConfigSO.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,9 @@
44
[CreateAssetMenu(fileName = "PathwayConfig", menuName = "EntityConfig/Pathway Config")]
55
public class PathwayConfigSO : NPCMovementConfigSO
66
{
7-
[HideInInspector]
8-
public Vector3[] waypoints;
97

108
#if UNITY_EDITOR
119

12-
public bool HidePathway;
13-
1410
[SerializeField]
1511
private Color _lineColor = Color.black;
1612

UOP1_Project/Assets/Scripts/Editor/Pathway/PathwayEditor.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public void OnSceneGUI(SceneView sceneView)
1818
{
1919
int index = _pathwayHandles.DisplayHandles();
2020
_pathWayNavMeshUI.RealTime(index);
21-
PathwayGizmos.DrawGizmosSelected(_pathway, GizmoType.Active);
21+
PathwayGizmos.DrawGizmosSelected(_pathway);
2222
}
2323

2424
public override void OnInspectorGUI()
@@ -27,7 +27,6 @@ public override void OnInspectorGUI()
2727
serializedObject.Update();
2828
_reorderableList.DoLayoutList();
2929
_pathWayNavMeshUI.OnInspectorGUI();
30-
Tools.hidden = _pathway.HidePathway;
3130
serializedObject.ApplyModifiedProperties();
3231
}
3332

@@ -57,7 +56,6 @@ private void OnDisable()
5756
_reorderableList.onRemoveCallback -= RemoveItem;
5857
_reorderableList.onChangedCallback -= ListModified;
5958
_reorderableList.onMouseDragCallback -= DragItem;
60-
_pathway.waypoints = _pathway.Waypoints.Select(x => x.waypoint).ToArray();
6159
SceneView.duringSceneGui -= this.OnSceneGUI;
6260
}
6361

UOP1_Project/Assets/Scripts/Editor/Pathway/PathwayGizmos.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44

55
public class PathwayGizmos
66
{
7-
[DrawGizmo(GizmoType.Selected)]
8-
public static void DrawGizmosSelected(PathwayConfigSO pathway, GizmoType gizmoType)
7+
public static void DrawGizmosSelected(PathwayConfigSO pathway)
98
{
109
if (!pathway.ToggledNavMeshDisplay)
1110
{
@@ -81,12 +80,12 @@ private static void DrawHitPoints(PathwayConfigSO pathway)
8180
if (pathway.Hits[i])
8281
{
8382
Handles.color = new Color(0, 255, 0, 0.1f);
84-
Handles.SphereCap(0, pathway.Waypoints[i].waypoint, Quaternion.identity, sphereRadius);
83+
Handles.SphereHandleCap(0, pathway.Waypoints[i].waypoint, Quaternion.identity, sphereRadius, EventType.Repaint);
8584
}
8685
else
8786
{
8887
Handles.color = new Color(255, 0, 0, 0.1f);
89-
Handles.SphereCap(0, pathway.Waypoints[i].waypoint, Quaternion.identity, sphereRadius);
88+
Handles.SphereHandleCap(0, pathway.Waypoints[i].waypoint, Quaternion.identity, sphereRadius, EventType.Repaint);
9089
}
9190
}
9291
}

0 commit comments

Comments
 (0)