浏览代码

Correction following Alexandre review

/main
Yohann Puyhaubert 3 年前
当前提交
b1d0c051
共有 6 个文件被更改,包括 21 次插入42 次删除
  1. 40
      UOP1_Project/Assets/ScriptableObjects/StateMachine/Config/NPCPathwayConfig.asset
  2. 4
      UOP1_Project/Assets/Scripts/Characters/Config/PathwayConfigSO.cs
  3. 4
      UOP1_Project/Assets/Scripts/Editor/Pathway/PathwayEditor.cs
  4. 7
      UOP1_Project/Assets/Scripts/Editor/Pathway/PathwayGizmos.cs
  5. 8
      UOP1_Project/Assets/Prefabs/Gameplay/Pathway.meta

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


m_EditorClassIdentifier:
_stopDuration: 0.5
_speed: 1
waypoints:
- {x: 0, y: 0.033730388, z: 0}
- {x: 0, y: 0.033730388, z: 0}
- {x: 0, y: 0.033730388, z: 0}
- {x: 0, y: 0.033730388, z: 0}
- {x: 0, y: 0.033730388, z: 0}
- {x: 0, y: 0.033730388, z: 0}
- {x: 0, y: 0.033730388, z: 0}
HidePathway: 0
_probeRadius: 13.2
_probeRadius: 5
ToggledNavMeshDisplay: 0
ToggledNavMeshDisplay: 1
- waypoint: {x: -8.50028, y: 0.033730388, z: 1.5602589}
- waypoint: {x: -12.400441, y: 0.2169903, z: 14.62578}
- {x: -8.50028, y: 0.033730388, z: 1.5602589}
- {x: 2.6641674, y: 0.033730388, z: -8.3147135}
- waypoint: {x: 2.6641674, y: 0.033730388, z: -8.3147135}
- {x: -12.400441, y: 0.2169903, z: 14.62578}
- {x: -10.209248, y: 0.033730388, z: -9.870466}
- waypoint: {x: -10.209248, y: 0.033730388, z: -9.870466}
- {x: 2.6641674, y: 0.033730388, z: -8.3147135}
- {x: 4, y: 0.033730388, z: -6.799999}
- {x: 10.939352, y: 0.15480933, z: -0.32895184}
- waypoint: {x: 10.939352, y: 0.15480933, z: -0.32895184}
- {x: -10.209248, y: 0.033730388, z: -9.870466}
- {x: -4.5, y: 0.033730388, z: -9}
- {x: -0.8999996, y: 0.033730388, z: -8.5}
- {x: 11.389833, y: 0.18379807, z: 0.2561388}
- waypoint: {x: 11.389833, y: 0.18379807, z: 0.2561388}
- {x: 10.939352, y: 0.15480933, z: -0.32895184}
- {x: 5.6, y: 0.033730388, z: -0.8999996}
- {x: 4.8, y: 0.033730388, z: -0.8999996}
- {x: -8.50028, y: 0.033730388, z: 1.5602589}
- {x: 11.389833, y: 0.18379807, z: 0.2561388}
- {x: 7.3375273, y: 0.2178752, z: 16.793528}
- waypoint: {x: 7.3375273, y: 0.2178752, z: 16.793528}
corners:
- {x: 7.3375273, y: 0.2178752, z: 16.793528}
- {x: -12.400441, y: 0.2169903, z: 14.62578}

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


[CreateAssetMenu(fileName = "PathwayConfig", menuName = "EntityConfig/Pathway Config")]
public class PathwayConfigSO : NPCMovementConfigSO
{
[HideInInspector]
public Vector3[] waypoints;
public bool HidePathway;
[SerializeField]
private Color _lineColor = Color.black;

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


{
int index = _pathwayHandles.DisplayHandles();
_pathWayNavMeshUI.RealTime(index);
PathwayGizmos.DrawGizmosSelected(_pathway, GizmoType.Active);
PathwayGizmos.DrawGizmosSelected(_pathway);
}
public override void OnInspectorGUI()

_reorderableList.DoLayoutList();
_pathWayNavMeshUI.OnInspectorGUI();
Tools.hidden = _pathway.HidePathway;
serializedObject.ApplyModifiedProperties();
}

_reorderableList.onRemoveCallback -= RemoveItem;
_reorderableList.onChangedCallback -= ListModified;
_reorderableList.onMouseDragCallback -= DragItem;
_pathway.waypoints = _pathway.Waypoints.Select(x => x.waypoint).ToArray();
SceneView.duringSceneGui -= this.OnSceneGUI;
}

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


public class PathwayGizmos
{
[DrawGizmo(GizmoType.Selected)]
public static void DrawGizmosSelected(PathwayConfigSO pathway, GizmoType gizmoType)
public static void DrawGizmosSelected(PathwayConfigSO pathway)
{
if (!pathway.ToggledNavMeshDisplay)
{

if (pathway.Hits[i])
{
Handles.color = new Color(0, 255, 0, 0.1f);
Handles.SphereCap(0, pathway.Waypoints[i].waypoint, Quaternion.identity, sphereRadius);
Handles.SphereHandleCap(0, pathway.Waypoints[i].waypoint, Quaternion.identity, sphereRadius, EventType.Repaint);
Handles.SphereCap(0, pathway.Waypoints[i].waypoint, Quaternion.identity, sphereRadius);
Handles.SphereHandleCap(0, pathway.Waypoints[i].waypoint, Quaternion.identity, sphereRadius, EventType.Repaint);
}
}
}

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


fileFormatVersion: 2
guid: 40e40b1ee07a76f46bd4bdb320066635
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存