Skip to content
This repository was archived by the owner on May 9, 2023. It is now read-only.

Commit 274352d

Browse files
committed
fix ParameterHandler parsing Types
1 parent 7b477a8 commit 274352d

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

src/Core/Tests/TestClass.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,18 @@ public static void TestComponent<T>() where T : Component
8080
ExplorerCore.Log($"Test3 {typeof(T).FullName}");
8181
}
8282

83-
public static void TestArgumentParse(string s, int i, Color color, CameraClearFlags flags, Vector3 vector, Quaternion quaternion, object obj)
83+
public static void TestArgumentParse(string _string,
84+
int integer,
85+
Color color,
86+
CameraClearFlags flags,
87+
Vector3 vector,
88+
Quaternion quaternion,
89+
object obj,
90+
Type type)
8491
{
85-
ExplorerCore.Log($"{s}, {i}, {color.ToString()}, {flags}, {vector.ToString()}, {quaternion.ToString()}, {obj?.ToString() ?? "null"}");
92+
ExplorerCore.Log($"_string: {_string}, integer: {integer}, color: {color.ToString()}, flags: {flags}, " +
93+
$"vector: {vector.ToString()}, quaternion: {quaternion.ToString()}, obj: {obj?.ToString() ?? "null"}," +
94+
$"type: {type?.FullName ?? "null"}");
8695
}
8796

8897
private static void Init_Mono()

src/UI/Widgets/EvaluateWidget/ParameterHandler.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ public object Evaluate()
9797
{
9898
var input = this.inputField.Text;
9999

100+
if (typeof(Type).IsAssignableFrom(paramType))
101+
return ReflectionUtility.GetTypeByName(input);
102+
100103
if (paramType == typeof(string))
101104
return input;
102105

0 commit comments

Comments
 (0)