This commit is contained in:
Alexander Filippov 2022-03-02 01:12:44 +01:00
parent 963d166bff
commit 029e02fd2f
8 changed files with 18 additions and 35 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "Agoxandr.Utils.Editor", "name": "Agoxandr.Utils.Editor",
"rootNamespace": "", "rootNamespace": "Utils",
"references": [ "references": [
"GUID:80ed647da8ce73c45b66c239eba0365a" "GUID:80ed647da8ce73c45b66c239eba0365a"
], ],

View File

@ -8,13 +8,13 @@ namespace Utils
{ {
public override void OnInspectorGUI() public override void OnInspectorGUI()
{ {
EventManager eventManager = (EventManager)target; var eventManager = (EventManager)target;
GUILayout.BeginHorizontal(); GUILayout.BeginHorizontal();
GUILayout.Label("Update"); GUILayout.Label("Update");
if (Application.isPlaying) if (Application.isPlaying)
{ {
GUILayout.FlexibleSpace(); GUILayout.FlexibleSpace();
GUILayout.Label(eventManager.UpdateLength.ToString()); GUILayout.Label(EventManager.UpdateLength.ToString());
} }
GUILayout.EndHorizontal(); GUILayout.EndHorizontal();
GUILayout.BeginHorizontal(); GUILayout.BeginHorizontal();
@ -22,7 +22,7 @@ namespace Utils
if (Application.isPlaying) if (Application.isPlaying)
{ {
GUILayout.FlexibleSpace(); GUILayout.FlexibleSpace();
GUILayout.Label(eventManager.FixedUpdateLength.ToString()); GUILayout.Label(EventManager.FixedUpdateLength.ToString());
} }
GUILayout.EndHorizontal(); GUILayout.EndHorizontal();
GUILayout.BeginHorizontal(); GUILayout.BeginHorizontal();
@ -30,7 +30,7 @@ namespace Utils
if (Application.isPlaying) if (Application.isPlaying)
{ {
GUILayout.FlexibleSpace(); GUILayout.FlexibleSpace();
GUILayout.Label(eventManager.LateUpdateLength.ToString()); GUILayout.Label(EventManager.LateUpdateLength.ToString());
} }
GUILayout.EndHorizontal(); GUILayout.EndHorizontal();
} }

View File

@ -1,5 +1,6 @@
{ {
"name": "Agoxandr.Utils", "name": "Agoxandr.Utils",
"rootNamespace": "Utils",
"references": [], "references": [],
"includePlatforms": [], "includePlatforms": [],
"excludePlatforms": [], "excludePlatforms": [],

View File

@ -9,8 +9,8 @@ namespace Utils
return new T[] { item }; return new T[] { item };
} }
T[] result = new T[array.Length + 1]; var result = new T[array.Length + 1];
for (int i = 0; i < array.Length; i++) for (var i = 0; i < array.Length; i++)
{ {
result[i] = array[i]; result[i] = array[i];
} }

View File

@ -28,51 +28,30 @@ namespace Utils
OnLateUpdated?.Invoke(); OnLateUpdated?.Invoke();
} }
public int UpdateLength public static int UpdateLength
{ {
get get
{ {
var list = OnUpdated?.GetInvocationList(); var list = OnUpdated?.GetInvocationList();
if (list != null) return list?.Length ?? 0;
{
return list.Length;
}
else
{
return 0;
}
} }
} }
public int FixedUpdateLength public static int FixedUpdateLength
{ {
get get
{ {
var list = OnFixedUpdated?.GetInvocationList(); var list = OnFixedUpdated?.GetInvocationList();
if (list != null) return list?.Length ?? 0;
{
return list.Length;
}
else
{
return 0;
}
} }
} }
public int LateUpdateLength public static int LateUpdateLength
{ {
get get
{ {
var list = OnLateUpdated?.GetInvocationList(); var list = OnLateUpdated?.GetInvocationList();
if (list != null) return list?.Length ?? 0;
{
return list.Length;
}
else
{
return 0;
}
} }
} }
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "cyou.shazbot.utils", "name": "cyou.shazbot.utils",
"version": "3.0.0", "version": "3.0.1",
"displayName": "Utils", "displayName": "Utils",
"description": "Utility useful for almost any project.", "description": "Utility useful for almost any project.",
"licensesUrl": "https://github.com/Agoxandr/Utils/blob/master/LICENSE.md", "licensesUrl": "https://github.com/Agoxandr/Utils/blob/master/LICENSE.md",
@ -11,5 +11,8 @@
"name": "Alexander Filippov", "name": "Alexander Filippov",
"email": "a.filippov@shazbot.cyou", "email": "a.filippov@shazbot.cyou",
"url": "https://shazbot.cyou/" "url": "https://shazbot.cyou/"
},
"dependencies": {
"com.unity.modules.physics": "1.0.0"
} }
} }