Skip to content

Commit

Permalink
for C# style using
Browse files Browse the repository at this point in the history
  • Loading branch information
ikpil committed Dec 27, 2023
1 parent 47f8d51 commit 884201b
Show file tree
Hide file tree
Showing 23 changed files with 118 additions and 167 deletions.
16 changes: 8 additions & 8 deletions Editor/UniRecast.Editor/UniRcConvexVolumeToolEditor.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
namespace UniRecast.Editor
{
using DotRecast.Recast.Toolset.Builder;
using UnityEditor;
using UniRecast.Core;
using UniRecast.Toolsets;
using DotRecast.Recast.Toolset.Builder;
using UnityEditor;
using UniRecast.Core;
using UniRecast.Toolsets;

namespace UniRecast.Editor
{
[CanEditMultipleObjects]
[CustomEditor(typeof(UniRcConvexVolumeTool))]
public class UniRcConvexVolumeToolEditor : UniRcToolEditor
Expand All @@ -20,7 +20,7 @@ private void OnEnable()
_boxHeight = serializedObject.FindPropertySafe(nameof(_boxHeight));
_boxDescent = serializedObject.FindPropertySafe(nameof(_boxDescent));
_polyOffset = serializedObject.FindPropertySafe(nameof(_polyOffset));

_areaTypeValue = serializedObject.FindPropertySafe(nameof(_areaTypeValue));
}

Expand Down Expand Up @@ -64,7 +64,7 @@ protected override void Layout()
// geom.ClearConvexVolumes();
// }
}

serializedObject.ApplyModifiedProperties();
}
}
Expand Down
8 changes: 4 additions & 4 deletions Editor/UniRecast.Editor/UniRcCrowdAgentProfilingToolEditor.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
namespace UniRecast.Editor
{
using UnityEditor;
using UniRecast.Toolsets;
using UnityEditor;
using UniRecast.Toolsets;

namespace UniRecast.Editor
{
[CustomEditor(typeof(UniRcCrowdAgentProfilingTool))]
public class UniRcCrowdAgentProfilingToolEditor : UniRcToolEditor
{
Expand Down
12 changes: 6 additions & 6 deletions Editor/UniRecast.Editor/UniRcCrowdToolEditor.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
namespace UniRecast.Editor
{
using DotRecast.Recast.Toolset.Tools;
using UniRecast.Core;
using UniRecast.Toolsets;
using UnityEditor;
using DotRecast.Recast.Toolset.Tools;
using UnityEditor;
using UniRecast.Core;
using UniRecast.Toolsets;

namespace UniRecast.Editor
{
[CanEditMultipleObjects]
[CustomEditor(typeof(UniRcCrowdTool))]
public class UniRcCrowdToolEditor : UniRcToolEditor
Expand Down
8 changes: 4 additions & 4 deletions Editor/UniRecast.Editor/UniRcDynamicUpdateToolEditor.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
namespace UniRecast.Editor
{
using UniRecast.Toolsets;
using UnityEditor;
using UniRecast.Toolsets;
using UnityEditor;

namespace UniRecast.Editor
{
[CustomEditor(typeof(UniRcDynamicUpdateTool))]
public class UniRcDynamicUpdateToolEditor : UniRcToolEditor
{
Expand Down
11 changes: 6 additions & 5 deletions Editor/UniRecast.Editor/UniRcGui.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
namespace UniRecast.Editor
{
using System;
using UnityEditor;
using UnityEngine;
using System;
using UnityEditor;
using UnityEngine;

namespace UniRecast.Editor

{
public static class UniRcGui
{
public static void DrawAgentDiagram(Rect rect, float agentRadius, float agentHeight, float agentClimb, float agentSlope)
Expand Down
11 changes: 11 additions & 0 deletions Editor/UniRecast.Editor/UniRcGuiUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,16 @@ public static GameObject CreateAndSelectGameObject(string suggestedName, GameObj

return child;
}

public static SerializedProperty FindPropertySafe(this SerializedObject serializedObject, string name)
{
string safeName = name;
if (name[0] == '_')
{
safeName = name.Substring(1);
}

return serializedObject.FindProperty(safeName);
}
}
}
9 changes: 4 additions & 5 deletions Editor/UniRecast.Editor/UniRcJumpLinkBuilderToolEditor.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
namespace UniRecast.Editor
{
using UniRecast.Toolsets;
using UnityEditor;
using UniRecast.Toolsets;
using UnityEditor;

namespace UniRecast.Editor
{
[CustomEditor(typeof(UniRcJumpLinkBuilderTool))]
public class UniRcJumpLinkBuilderToolEditor : UniRcToolEditor
{
Expand All @@ -11,6 +11,5 @@ protected override void Layout()
UniRcGui.Text(this.GetType().Name);
UniRcGui.Separator();
}

}
}
15 changes: 7 additions & 8 deletions Editor/UniRecast.Editor/UniRcNavMeshSurfaceEditor.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
using UniRecast.Core;
using DotRecast.Detour;
using DotRecast.Recast.Toolset;
using UnityEditor;
using UnityEngine;
using UnityEngine.Rendering;

namespace UniRecast.Editor
{
using DotRecast.Detour;
using DotRecast.Recast.Toolset;
using UnityEditor;
using UnityEngine;
using UnityEngine.Rendering;

[CanEditMultipleObjects]
[CustomEditor(typeof(UniRcNavMeshSurface))]
public class UniRcNavMeshSurfaceEditor : UniRcToolEditor
Expand Down Expand Up @@ -232,9 +231,9 @@ protected override void Layout()
EditorGUI.ObjectField(rectLabel, _navMeshData, GUIContent.none);
EditorGUI.EndProperty();
}

UniRcGui.NewLine();

serializedObject.ApplyModifiedProperties();

using (new EditorGUI.DisabledScope(Application.isPlaying))
Expand Down
8 changes: 4 additions & 4 deletions Editor/UniRecast.Editor/UniRcObstacleToolEditor.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
namespace UniRecast.Editor
{
using UniRecast.Toolsets;
using UnityEditor;
using UnityEditor;
using UniRecast.Toolsets;

namespace UniRecast.Editor
{
[CustomEditor(typeof(UniRcObstacleTool))]
public class UniRcObstacleToolEditor : UniRcToolEditor
{
Expand Down
10 changes: 5 additions & 5 deletions Editor/UniRecast.Editor/UniRcOffMeshConnectionToolEditor.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
namespace UniRecast.Editor
{
using UniRecast.Core;
using UniRecast.Toolsets;
using UnityEditor;
using UniRecast.Core;
using UniRecast.Toolsets;
using UnityEditor;

namespace UniRecast.Editor
{
[CustomEditor(typeof(UniRcOffMeshConnectionTool))]
public class UniRcOffMeshConnectionToolEditor : UniRcToolEditor
{
Expand Down
18 changes: 9 additions & 9 deletions Editor/UniRecast.Editor/UniRcTestNavMeshToolEditor.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
namespace UniRecast.Editor
using System.Linq;
using DotRecast.Detour;
using DotRecast.Recast.Toolset.Builder;
using DotRecast.Recast.Toolset.Tools;
using UniRecast.Core;
using UniRecast.Toolsets;
using UnityEditor;

namespace UniRecast.Editor
{
using System.Linq;
using DotRecast.Detour;
using DotRecast.Recast.Toolset.Builder;
using DotRecast.Recast.Toolset.Tools;
using UniRecast.Core;
using UniRecast.Toolsets;
using UnityEditor;

[CanEditMultipleObjects]
[CustomEditor(typeof(UniRcTestNavMeshTool))]
public class UniRcTestNavMeshToolEditor : UniRcToolEditor
Expand Down
9 changes: 4 additions & 5 deletions Editor/UniRecast.Editor/UniRcTileToolEditor.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
namespace UniRecast.Editor
{
using UniRecast.Toolsets;
using UnityEditor;
using UniRecast.Toolsets;
using UnityEditor;

namespace UniRecast.Editor
{
[CustomEditor(typeof(UniRcTileTool))]
public class UniRcTileToolEditor : UniRcToolEditor
{
Expand All @@ -11,6 +11,5 @@ protected override void Layout()
UniRcGui.Text(this.GetType().Name);
UniRcGui.Separator();
}

}
}
16 changes: 7 additions & 9 deletions Editor/UniRecast.Editor/UniRcToolEditor.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
namespace UniRecast.Editor
{
using UnityEditor;
using UnityEngine;
using UnityEditor;
using UnityEngine;

public class UniRcToolEditor : Editor
namespace UniRecast.Editor
{
public class UniRcToolEditor : UnityEditor.Editor
{
private void ProcessMouse()
{
Expand All @@ -12,7 +12,7 @@ private void ProcessMouse()
if (Event.current.type == EventType.MouseDown && Event.current.button == 0)
{
Debug.Log("step 1");

// 씬뷰에서의 마우스 위치를 가져옴
Vector2 mousePosition = Event.current.mousePosition;

Expand All @@ -34,7 +34,7 @@ private void OnSceneGUI()
{
ProcessMouse();
}

// tool
public override void OnInspectorGUI()
{
Expand All @@ -44,8 +44,6 @@ public override void OnInspectorGUI()

protected virtual void Layout()
{

}

}
}
13 changes: 6 additions & 7 deletions Editor/UniRecast.Editor/UniRcToolsetEditor.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
namespace UniRecast.Editor
{
using UniRecast.Toolsets;
using UnityEditor;
using UnityEngine;
using UniRecast.Toolsets;
using UnityEditor;
using UnityEngine;

namespace UniRecast.Editor
{
[CanEditMultipleObjects]
[CustomEditor(typeof(UniRcToolset))]
public class UniRcToolsetEditor : Editor
public class UniRcToolsetEditor : UnityEditor.Editor
{
private void OnSceneGUI()
{
Debug.Log("asdf");
}

}
}
4 changes: 2 additions & 2 deletions Runtime/UniRecast.Core/UniRcCamera.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using UnityEngine;

namespace UniRecast.Core
{
using UnityEngine;

public static class KeyModState
{
public const int None = 0;
Expand Down
20 changes: 10 additions & 10 deletions Runtime/UniRecast.Core/UniRcExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
namespace UniRecast.Core
using System.Collections.Generic;
using System.IO;
using DotRecast.Core;
using DotRecast.Core.Numerics;
using DotRecast.Detour;
using DotRecast.Detour.Io;
using UnityEngine;
using UnityEngine.Rendering;

namespace UniRecast.Core
{
using System.Collections.Generic;
using System.IO;
using DotRecast.Core;
using DotRecast.Core.Numerics;
using DotRecast.Detour;
using DotRecast.Detour.Io;
using UnityEngine;
using UnityEngine.Rendering;

// https://github.com/highfidelity/unity-to-hifi-exporter/blob/master/Assets/UnityToHiFiExporter/Editor/TerrainObjExporter.cs
public static class UniRcExtensions
{
Expand Down
8 changes: 4 additions & 4 deletions Runtime/UniRecast.Core/UniRcGameObjectExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
namespace UniRecast.Core
{
using System.Collections.Generic;
using UnityEngine;
using System.Collections.Generic;
using UnityEngine;

namespace UniRecast.Core
{
public static class UniRcGameObjectExtensions
{
public static List<GameObject> ToHierarchyList(this GameObject root)
Expand Down
24 changes: 12 additions & 12 deletions Runtime/UniRecast.Core/UniRcMesh.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
namespace UniRecast.Core
{
using System;
using System.IO;
using System.Text;
using DotRecast.Core;
using DotRecast.Core.Numerics;
using DotRecast.Detour;
using DotRecast.Recast.Toolset;
using DotRecast.Recast.Toolset.Builder;
using DotRecast.Recast.Toolset.Geom;
using UnityEngine;
using System;
using System.IO;
using System.Text;
using DotRecast.Core;
using DotRecast.Core.Numerics;
using DotRecast.Detour;
using DotRecast.Recast.Toolset;
using DotRecast.Recast.Toolset.Builder;
using DotRecast.Recast.Toolset.Geom;
using UnityEngine;

namespace UniRecast.Core
{
public readonly struct UniRcMesh
{
public readonly string Name;
Expand Down
15 changes: 0 additions & 15 deletions Runtime/UniRecast.Core/UniRcNavMesh.cs

This file was deleted.

Loading

0 comments on commit 884201b

Please sign in to comment.