diff --git a/Packages/com.varneon.vudon.logger/Editor/UdonConsoleEditor.cs b/Packages/com.varneon.vudon.logger/Editor/UdonConsoleEditor.cs index fd3399b..44eb820 100644 --- a/Packages/com.varneon.vudon.logger/Editor/UdonConsoleEditor.cs +++ b/Packages/com.varneon.vudon.logger/Editor/UdonConsoleEditor.cs @@ -5,7 +5,7 @@ using Varneon.VInspector; using Varneon.VUdon.Logger.Abstract; -namespace Varneon.UdonPrefabs.RuntimeTools.Editor +namespace Varneon.VUdon.Logger.Editor { /// /// Custom inspector for UdonConsole prefab @@ -25,6 +25,7 @@ protected override void OnInspectorVisualTreeAssetCloned(VisualElement root) VisualElement inspectorPanel = root.Q("InspectorPanel"); inspectorPanel.Add(new Foldout() { name = "Foldout_Settings", text = "Settings" }); + inspectorPanel.Add(new Foldout() { name = "Foldout_Advanced", text = "Advanced" }); inspectorPanel.Add(new Foldout() { name = "Foldout_References", text = "References" }); inspectorPanel.Add(new Foldout() { name = "Foldout_API", text = "API" }); diff --git a/Packages/com.varneon.vudon.logger/Runtime/Prefabs/Console.prefab b/Packages/com.varneon.vudon.logger/Runtime/Prefabs/UdonConsole.prefab similarity index 99% rename from Packages/com.varneon.vudon.logger/Runtime/Prefabs/Console.prefab rename to Packages/com.varneon.vudon.logger/Runtime/Prefabs/UdonConsole.prefab index af75558..b276945 100644 --- a/Packages/com.varneon.vudon.logger/Runtime/Prefabs/Console.prefab +++ b/Packages/com.varneon.vudon.logger/Runtime/Prefabs/UdonConsole.prefab @@ -2846,6 +2846,9 @@ MonoBehaviour: maxLogEntriesStep: 50 fontSize: 24 proxyEntriesToLogs: 0 + systemPrefix: '[UdonConsole]:' + playerJoinPrefix: '[JOIN]:' + playerleavePrefix: '[LEAVE]:' logWindow: {fileID: 3718074137844359835} logItem: {fileID: 3718074138163775205} logToggle: {fileID: 3718074138598075316} diff --git a/Packages/com.varneon.vudon.logger/Runtime/Prefabs/Console.prefab.meta b/Packages/com.varneon.vudon.logger/Runtime/Prefabs/UdonConsole.prefab.meta similarity index 100% rename from Packages/com.varneon.vudon.logger/Runtime/Prefabs/Console.prefab.meta rename to Packages/com.varneon.vudon.logger/Runtime/Prefabs/UdonConsole.prefab.meta diff --git a/Packages/com.varneon.vudon.logger/Runtime/Udon Programs/UdonConsole.asset b/Packages/com.varneon.vudon.logger/Runtime/Udon Programs/UdonConsole.asset index 955e072..6b5b6c1 100644 --- a/Packages/com.varneon.vudon.logger/Runtime/Udon Programs/UdonConsole.asset +++ b/Packages/com.varneon.vudon.logger/Runtime/Udon Programs/UdonConsole.asset @@ -21,7 +21,7 @@ MonoBehaviour: compiledVersion: 2 behaviourSyncMode: 1 hasInteractEvent: 0 - scriptID: -7447683245188945609 + scriptID: -6656267593177957094 serializationData: SerializedFormat: 2 SerializedBytes: @@ -44,7 +44,7 @@ MonoBehaviour: Data: - Name: Entry: 12 - Data: 16 + Data: 20 - Name: Entry: 7 Data: @@ -86,7 +86,7 @@ MonoBehaviour: Data: 4|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 - Data: 3 + Data: 4 - Name: Entry: 7 Data: 5|UnityEngine.HeaderAttribute, UnityEngine.CoreModule @@ -104,7 +104,16 @@ MonoBehaviour: Data: - Name: Entry: 7 - Data: 7|Varneon.VInspector.FieldParentElementAttribute, Varneon.V-Inspector.Runtime + Data: 7|UnityEngine.TooltipAttribute, UnityEngine.CoreModule + - Name: tooltip + Entry: 1 + Data: Should the timestamps be displayed on log entries by default + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 8|Varneon.VInspector.FieldParentElementAttribute, Varneon.V-Inspector.Runtime - Name: ParentName Entry: 1 Data: Foldout_Settings @@ -131,13 +140,13 @@ MonoBehaviour: Data: minLogEntries - Name: $v Entry: 7 - Data: 8|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 9|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: minLogEntries - Name: k__BackingField Entry: 7 - Data: 9|System.RuntimeType, mscorlib + Data: 10|System.RuntimeType, mscorlib - Name: Entry: 1 Data: System.Int32, mscorlib @@ -146,7 +155,7 @@ MonoBehaviour: Data: - Name: k__BackingField Entry: 9 - Data: 9 + Data: 10 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -161,28 +170,28 @@ MonoBehaviour: Data: true - Name: _fieldAttributes Entry: 7 - Data: 10|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 11|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 3 - Name: Entry: 7 - Data: 11|UnityEngine.SerializeField, UnityEngine.CoreModule + Data: 12|UnityEngine.SerializeField, UnityEngine.CoreModule - Name: Entry: 8 Data: - Name: Entry: 7 - Data: 12|UnityEngine.TooltipAttribute, UnityEngine.CoreModule + Data: 13|UnityEngine.TooltipAttribute, UnityEngine.CoreModule - Name: tooltip Entry: 1 - Data: How many entries are ensured to always be visible in the console + Data: How many log entries are ensured to always be visible in the console - Name: Entry: 8 Data: - Name: Entry: 7 - Data: 13|Varneon.VInspector.FieldParentElementAttribute, Varneon.V-Inspector.Runtime + Data: 14|Varneon.VInspector.FieldParentElementAttribute, Varneon.V-Inspector.Runtime - Name: ParentName Entry: 1 Data: Foldout_Settings @@ -209,16 +218,16 @@ MonoBehaviour: Data: maxLogEntries - Name: $v Entry: 7 - Data: 14|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 15|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: maxLogEntries - Name: k__BackingField Entry: 9 - Data: 9 + Data: 10 - Name: k__BackingField Entry: 9 - Data: 9 + Data: 10 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -233,19 +242,28 @@ MonoBehaviour: Data: true - Name: _fieldAttributes Entry: 7 - Data: 15|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 16|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 - Data: 2 + Data: 3 - Name: Entry: 7 - Data: 16|UnityEngine.SerializeField, UnityEngine.CoreModule + Data: 17|UnityEngine.SerializeField, UnityEngine.CoreModule - Name: Entry: 8 Data: - Name: Entry: 7 - Data: 17|Varneon.VInspector.FieldParentElementAttribute, Varneon.V-Inspector.Runtime + Data: 18|UnityEngine.TooltipAttribute, UnityEngine.CoreModule + - Name: tooltip + Entry: 1 + Data: How many log entries can the console display simultaneously + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 19|Varneon.VInspector.FieldParentElementAttribute, Varneon.V-Inspector.Runtime - Name: ParentName Entry: 1 Data: Foldout_Settings @@ -272,16 +290,16 @@ MonoBehaviour: Data: maxLogEntriesStep - Name: $v Entry: 7 - Data: 18|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 20|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: maxLogEntriesStep - Name: k__BackingField Entry: 9 - Data: 9 + Data: 10 - Name: k__BackingField Entry: 9 - Data: 9 + Data: 10 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -296,19 +314,19 @@ MonoBehaviour: Data: true - Name: _fieldAttributes Entry: 7 - Data: 19|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 21|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 3 - Name: Entry: 7 - Data: 20|UnityEngine.SerializeField, UnityEngine.CoreModule + Data: 22|UnityEngine.SerializeField, UnityEngine.CoreModule - Name: Entry: 8 Data: - Name: Entry: 7 - Data: 21|UnityEngine.TooltipAttribute, UnityEngine.CoreModule + Data: 23|UnityEngine.TooltipAttribute, UnityEngine.CoreModule - Name: tooltip Entry: 1 Data: How many entries should be incremented/decremented from MaxLogEntries @@ -318,7 +336,7 @@ MonoBehaviour: Data: - Name: Entry: 7 - Data: 22|Varneon.VInspector.FieldParentElementAttribute, Varneon.V-Inspector.Runtime + Data: 24|Varneon.VInspector.FieldParentElementAttribute, Varneon.V-Inspector.Runtime - Name: ParentName Entry: 1 Data: Foldout_Settings @@ -345,16 +363,16 @@ MonoBehaviour: Data: fontSize - Name: $v Entry: 7 - Data: 23|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 25|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: fontSize - Name: k__BackingField Entry: 9 - Data: 9 + Data: 10 - Name: k__BackingField Entry: 9 - Data: 9 + Data: 10 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -369,19 +387,19 @@ MonoBehaviour: Data: true - Name: _fieldAttributes Entry: 7 - Data: 24|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 26|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 - Data: 3 + Data: 4 - Name: Entry: 7 - Data: 25|UnityEngine.SerializeField, UnityEngine.CoreModule + Data: 27|UnityEngine.SerializeField, UnityEngine.CoreModule - Name: Entry: 8 Data: - Name: Entry: 7 - Data: 26|UnityEngine.RangeAttribute, UnityEngine.CoreModule + Data: 28|UnityEngine.RangeAttribute, UnityEngine.CoreModule - Name: min Entry: 4 Data: 8 @@ -393,7 +411,16 @@ MonoBehaviour: Data: - Name: Entry: 7 - Data: 27|Varneon.VInspector.FieldParentElementAttribute, Varneon.V-Inspector.Runtime + Data: 29|UnityEngine.TooltipAttribute, UnityEngine.CoreModule + - Name: tooltip + Entry: 1 + Data: Font size + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 30|Varneon.VInspector.FieldParentElementAttribute, Varneon.V-Inspector.Runtime - Name: ParentName Entry: 1 Data: Foldout_Settings @@ -420,7 +447,7 @@ MonoBehaviour: Data: proxyEntriesToLogs - Name: $v Entry: 7 - Data: 28|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 31|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: proxyEntriesToLogs @@ -444,19 +471,28 @@ MonoBehaviour: Data: true - Name: _fieldAttributes Entry: 7 - Data: 29|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 32|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 - Data: 2 + Data: 3 - Name: Entry: 7 - Data: 30|UnityEngine.SerializeField, UnityEngine.CoreModule + Data: 33|UnityEngine.SerializeField, UnityEngine.CoreModule - Name: Entry: 8 Data: - Name: Entry: 7 - Data: 31|Varneon.VInspector.FieldParentElementAttribute, Varneon.V-Inspector.Runtime + Data: 34|UnityEngine.TooltipAttribute, UnityEngine.CoreModule + - Name: tooltip + Entry: 1 + Data: Should the log entries be sent to the default logs as well + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 35|Varneon.VInspector.FieldParentElementAttribute, Varneon.V-Inspector.Runtime - Name: ParentName Entry: 1 Data: Foldout_Settings @@ -478,18 +514,294 @@ MonoBehaviour: - Name: Entry: 7 Data: + - Name: $k + Entry: 1 + Data: timestampFormat + - Name: $v + Entry: 7 + Data: 36|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: timestampFormat + - Name: k__BackingField + Entry: 7 + Data: 37|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.String, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 37 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 38|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 4 + - Name: + Entry: 7 + Data: 39|UnityEngine.SpaceAttribute, UnityEngine.CoreModule + - Name: height + Entry: 4 + Data: 8 + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 40|UnityEngine.HeaderAttribute, UnityEngine.CoreModule + - Name: header + Entry: 1 + Data: Advanced + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 41|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 42|Varneon.VInspector.FieldParentElementAttribute, Varneon.V-Inspector.Runtime + - Name: ParentName + Entry: 1 + Data: Foldout_Advanced + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: systemPrefix + - Name: $v + Entry: 7 + Data: 43|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: systemPrefix + - Name: k__BackingField + Entry: 9 + Data: 37 + - Name: k__BackingField + Entry: 9 + Data: 37 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 44|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 45|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 46|Varneon.VInspector.FieldParentElementAttribute, Varneon.V-Inspector.Runtime + - Name: ParentName + Entry: 1 + Data: Foldout_Advanced + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: playerJoinPrefix + - Name: $v + Entry: 7 + Data: 47|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: playerJoinPrefix + - Name: k__BackingField + Entry: 9 + Data: 37 + - Name: k__BackingField + Entry: 9 + Data: 37 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 48|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 49|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 50|Varneon.VInspector.FieldParentElementAttribute, Varneon.V-Inspector.Runtime + - Name: ParentName + Entry: 1 + Data: Foldout_Advanced + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: playerLeavePrefix + - Name: $v + Entry: 7 + Data: 51|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: playerLeavePrefix + - Name: k__BackingField + Entry: 9 + Data: 37 + - Name: k__BackingField + Entry: 9 + Data: 37 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 52|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 53|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 54|Varneon.VInspector.FieldParentElementAttribute, Varneon.V-Inspector.Runtime + - Name: ParentName + Entry: 1 + Data: Foldout_Advanced + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: - Name: $k Entry: 1 Data: logWindow - Name: $v Entry: 7 - Data: 32|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 55|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: logWindow - Name: k__BackingField Entry: 7 - Data: 33|System.RuntimeType, mscorlib + Data: 56|System.RuntimeType, mscorlib - Name: Entry: 1 Data: UnityEngine.RectTransform, UnityEngine.CoreModule @@ -498,7 +810,7 @@ MonoBehaviour: Data: - Name: k__BackingField Entry: 9 - Data: 33 + Data: 56 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -513,13 +825,13 @@ MonoBehaviour: Data: true - Name: _fieldAttributes Entry: 7 - Data: 34|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 57|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 4 - Name: Entry: 7 - Data: 35|UnityEngine.SpaceAttribute, UnityEngine.CoreModule + Data: 58|UnityEngine.SpaceAttribute, UnityEngine.CoreModule - Name: height Entry: 4 Data: 8 @@ -528,7 +840,7 @@ MonoBehaviour: Data: - Name: Entry: 7 - Data: 36|UnityEngine.HeaderAttribute, UnityEngine.CoreModule + Data: 59|UnityEngine.HeaderAttribute, UnityEngine.CoreModule - Name: header Entry: 1 Data: References @@ -537,13 +849,13 @@ MonoBehaviour: Data: - Name: Entry: 7 - Data: 37|UnityEngine.SerializeField, UnityEngine.CoreModule + Data: 60|UnityEngine.SerializeField, UnityEngine.CoreModule - Name: Entry: 8 Data: - Name: Entry: 7 - Data: 38|Varneon.VInspector.FieldParentElementAttribute, Varneon.V-Inspector.Runtime + Data: 61|Varneon.VInspector.FieldParentElementAttribute, Varneon.V-Inspector.Runtime - Name: ParentName Entry: 1 Data: Foldout_References @@ -570,13 +882,13 @@ MonoBehaviour: Data: logItem - Name: $v Entry: 7 - Data: 39|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 62|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: logItem - Name: k__BackingField Entry: 7 - Data: 40|System.RuntimeType, mscorlib + Data: 63|System.RuntimeType, mscorlib - Name: Entry: 1 Data: UnityEngine.GameObject, UnityEngine.CoreModule @@ -585,7 +897,7 @@ MonoBehaviour: Data: - Name: k__BackingField Entry: 9 - Data: 40 + Data: 63 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -600,19 +912,19 @@ MonoBehaviour: Data: true - Name: _fieldAttributes Entry: 7 - Data: 41|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 64|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 2 - Name: Entry: 7 - Data: 42|UnityEngine.SerializeField, UnityEngine.CoreModule + Data: 65|UnityEngine.SerializeField, UnityEngine.CoreModule - Name: Entry: 8 Data: - Name: Entry: 7 - Data: 43|Varneon.VInspector.FieldParentElementAttribute, Varneon.V-Inspector.Runtime + Data: 66|Varneon.VInspector.FieldParentElementAttribute, Varneon.V-Inspector.Runtime - Name: ParentName Entry: 1 Data: Foldout_References @@ -639,13 +951,13 @@ MonoBehaviour: Data: logToggle - Name: $v Entry: 7 - Data: 44|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 67|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: logToggle - Name: k__BackingField Entry: 7 - Data: 45|System.RuntimeType, mscorlib + Data: 68|System.RuntimeType, mscorlib - Name: Entry: 1 Data: UnityEngine.UI.Toggle, UnityEngine.UI @@ -654,7 +966,7 @@ MonoBehaviour: Data: - Name: k__BackingField Entry: 9 - Data: 45 + Data: 68 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -669,19 +981,19 @@ MonoBehaviour: Data: true - Name: _fieldAttributes Entry: 7 - Data: 46|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 69|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 2 - Name: Entry: 7 - Data: 47|UnityEngine.SerializeField, UnityEngine.CoreModule + Data: 70|UnityEngine.SerializeField, UnityEngine.CoreModule - Name: Entry: 8 Data: - Name: Entry: 7 - Data: 48|Varneon.VInspector.FieldParentElementAttribute, Varneon.V-Inspector.Runtime + Data: 71|Varneon.VInspector.FieldParentElementAttribute, Varneon.V-Inspector.Runtime - Name: ParentName Entry: 1 Data: Foldout_References @@ -708,16 +1020,16 @@ MonoBehaviour: Data: warningToggle - Name: $v Entry: 7 - Data: 49|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 72|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: warningToggle - Name: k__BackingField Entry: 9 - Data: 45 + Data: 68 - Name: k__BackingField Entry: 9 - Data: 45 + Data: 68 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -732,19 +1044,19 @@ MonoBehaviour: Data: true - Name: _fieldAttributes Entry: 7 - Data: 50|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 73|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 2 - Name: Entry: 7 - Data: 51|UnityEngine.SerializeField, UnityEngine.CoreModule + Data: 74|UnityEngine.SerializeField, UnityEngine.CoreModule - Name: Entry: 8 Data: - Name: Entry: 7 - Data: 52|Varneon.VInspector.FieldParentElementAttribute, Varneon.V-Inspector.Runtime + Data: 75|Varneon.VInspector.FieldParentElementAttribute, Varneon.V-Inspector.Runtime - Name: ParentName Entry: 1 Data: Foldout_References @@ -771,16 +1083,16 @@ MonoBehaviour: Data: errorToggle - Name: $v Entry: 7 - Data: 53|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 76|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: errorToggle - Name: k__BackingField Entry: 9 - Data: 45 + Data: 68 - Name: k__BackingField Entry: 9 - Data: 45 + Data: 68 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -795,19 +1107,19 @@ MonoBehaviour: Data: true - Name: _fieldAttributes Entry: 7 - Data: 54|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 77|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 2 - Name: Entry: 7 - Data: 55|UnityEngine.SerializeField, UnityEngine.CoreModule + Data: 78|UnityEngine.SerializeField, UnityEngine.CoreModule - Name: Entry: 8 Data: - Name: Entry: 7 - Data: 56|Varneon.VInspector.FieldParentElementAttribute, Varneon.V-Inspector.Runtime + Data: 79|Varneon.VInspector.FieldParentElementAttribute, Varneon.V-Inspector.Runtime - Name: ParentName Entry: 1 Data: Foldout_References @@ -834,16 +1146,16 @@ MonoBehaviour: Data: timestampsToggle - Name: $v Entry: 7 - Data: 57|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 80|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: timestampsToggle - Name: k__BackingField Entry: 9 - Data: 45 + Data: 68 - Name: k__BackingField Entry: 9 - Data: 45 + Data: 68 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -858,19 +1170,19 @@ MonoBehaviour: Data: true - Name: _fieldAttributes Entry: 7 - Data: 58|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 81|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 2 - Name: Entry: 7 - Data: 59|UnityEngine.SerializeField, UnityEngine.CoreModule + Data: 82|UnityEngine.SerializeField, UnityEngine.CoreModule - Name: Entry: 8 Data: - Name: Entry: 7 - Data: 60|Varneon.VInspector.FieldParentElementAttribute, Varneon.V-Inspector.Runtime + Data: 83|Varneon.VInspector.FieldParentElementAttribute, Varneon.V-Inspector.Runtime - Name: ParentName Entry: 1 Data: Foldout_References @@ -897,13 +1209,13 @@ MonoBehaviour: Data: maxLogEntriesField - Name: $v Entry: 7 - Data: 61|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 84|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: maxLogEntriesField - Name: k__BackingField Entry: 7 - Data: 62|System.RuntimeType, mscorlib + Data: 85|System.RuntimeType, mscorlib - Name: Entry: 1 Data: UnityEngine.UI.InputField, UnityEngine.UI @@ -912,7 +1224,7 @@ MonoBehaviour: Data: - Name: k__BackingField Entry: 9 - Data: 62 + Data: 85 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -927,19 +1239,19 @@ MonoBehaviour: Data: true - Name: _fieldAttributes Entry: 7 - Data: 63|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 86|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 2 - Name: Entry: 7 - Data: 64|UnityEngine.SerializeField, UnityEngine.CoreModule + Data: 87|UnityEngine.SerializeField, UnityEngine.CoreModule - Name: Entry: 8 Data: - Name: Entry: 7 - Data: 65|Varneon.VInspector.FieldParentElementAttribute, Varneon.V-Inspector.Runtime + Data: 88|Varneon.VInspector.FieldParentElementAttribute, Varneon.V-Inspector.Runtime - Name: ParentName Entry: 1 Data: Foldout_References @@ -966,16 +1278,16 @@ MonoBehaviour: Data: fontSizeField - Name: $v Entry: 7 - Data: 66|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 89|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: fontSizeField - Name: k__BackingField Entry: 9 - Data: 62 + Data: 85 - Name: k__BackingField Entry: 9 - Data: 62 + Data: 85 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -990,19 +1302,19 @@ MonoBehaviour: Data: true - Name: _fieldAttributes Entry: 7 - Data: 67|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 90|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 2 - Name: Entry: 7 - Data: 68|UnityEngine.SerializeField, UnityEngine.CoreModule + Data: 91|UnityEngine.SerializeField, UnityEngine.CoreModule - Name: Entry: 8 Data: - Name: Entry: 7 - Data: 69|Varneon.VInspector.FieldParentElementAttribute, Varneon.V-Inspector.Runtime + Data: 92|Varneon.VInspector.FieldParentElementAttribute, Varneon.V-Inspector.Runtime - Name: ParentName Entry: 1 Data: Foldout_References @@ -1029,13 +1341,13 @@ MonoBehaviour: Data: scrollbar - Name: $v Entry: 7 - Data: 70|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 93|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: scrollbar - Name: k__BackingField Entry: 7 - Data: 71|System.RuntimeType, mscorlib + Data: 94|System.RuntimeType, mscorlib - Name: Entry: 1 Data: UnityEngine.UI.Scrollbar, UnityEngine.UI @@ -1044,7 +1356,7 @@ MonoBehaviour: Data: - Name: k__BackingField Entry: 9 - Data: 71 + Data: 94 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1056,13 +1368,25 @@ MonoBehaviour: Data: - Name: k__BackingField Entry: 5 - Data: false + Data: true - Name: _fieldAttributes Entry: 7 - Data: 72|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 95|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 - Data: 0 + Data: 2 + - Name: + Entry: 7 + Data: 96|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 97|UnityEngine.HideInInspector, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: - Name: Entry: 13 Data: @@ -1083,16 +1407,16 @@ MonoBehaviour: Data: canvasRoot - Name: $v Entry: 7 - Data: 73|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 98|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: canvasRoot - Name: k__BackingField Entry: 9 - Data: 33 + Data: 56 - Name: k__BackingField Entry: 9 - Data: 33 + Data: 56 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1104,13 +1428,25 @@ MonoBehaviour: Data: - Name: k__BackingField Entry: 5 - Data: false + Data: true - Name: _fieldAttributes Entry: 7 - Data: 74|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 99|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 - Data: 0 + Data: 2 + - Name: + Entry: 7 + Data: 100|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 101|UnityEngine.HideInInspector, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: - Name: Entry: 13 Data: diff --git a/Packages/com.varneon.vudon.logger/Runtime/Udon Programs/UdonConsole.cs b/Packages/com.varneon.vudon.logger/Runtime/Udon Programs/UdonConsole.cs index ca07a28..a6b3904 100644 --- a/Packages/com.varneon.vudon.logger/Runtime/Udon Programs/UdonConsole.cs +++ b/Packages/com.varneon.vudon.logger/Runtime/Udon Programs/UdonConsole.cs @@ -1,13 +1,14 @@ #pragma warning disable IDE0044 // Making serialized fields readonly hides them from the inspector using System; +using System.Linq; using UnityEngine; using UnityEngine.UI; using Varneon.VInspector; using Varneon.VUdon.Logger.Abstract; using VRC.SDKBase; -namespace Varneon.UdonPrefabs.RuntimeTools +namespace Varneon.VUdon.Logger { /// /// In-game console window for debugging UdonBehaviours @@ -19,33 +20,77 @@ public class UdonConsole : UdonLogger #region Variables #region Serialized + /// + /// Should the timestamps be displayed on log entries by default + /// [Header("Settings")] [SerializeField] + [Tooltip("Should the timestamps be displayed on log entries by default")] [FieldParentElement("Foldout_Settings")] private bool showTimestamps = false; + /// + /// How many log entries are ensured to always be visible in the console + /// [SerializeField] - [Tooltip("How many entries are ensured to always be visible in the console")] + [Tooltip("How many log entries are ensured to always be visible in the console")] [FieldParentElement("Foldout_Settings")] private int minLogEntries = 10; + /// + /// How many log entries can the console display simultaneously by default + /// [SerializeField] + [Tooltip("How many log entries can the console display simultaneously")] [FieldParentElement("Foldout_Settings")] private int maxLogEntries = 100; + /// + /// How many entries should be incremented/decremented from MaxLogEntries when buttons on the UI are pressed + /// [SerializeField] [Tooltip("How many entries should be incremented/decremented from MaxLogEntries when buttons on the UI are pressed")] [FieldParentElement("Foldout_Settings")] private int maxLogEntriesStep = 50; + /// + /// Font size + /// [SerializeField, Range(8, 32)] + [Tooltip("Font size")] [FieldParentElement("Foldout_Settings")] private int fontSize = 24; + /// + /// Should the log entries be sent to the default logs as well + /// [SerializeField] + [Tooltip("Should the log entries be sent to the default logs as well")] [FieldParentElement("Foldout_Settings")] private bool proxyEntriesToLogs; + /// + /// Format of the timestamp + /// + /// + [Space] + [Header("Advanced")] + [SerializeField] + [FieldParentElement("Foldout_Advanced")] + private string timestampFormat = "yyyy.MM.dd HH:mm:ss"; + + [SerializeField] + [FieldParentElement("Foldout_Advanced")] + private string systemPrefix = "[UdonConsole]:"; + + [SerializeField] + [FieldParentElement("Foldout_Advanced")] + private string playerJoinPrefix = "[JOIN]:"; + + [SerializeField] + [FieldParentElement("Foldout_Advanced")] + private string playerLeavePrefix = "[LEAVE]:"; + [Space] [Header("References")] [SerializeField] @@ -65,19 +110,15 @@ public class UdonConsole : UdonLogger private InputField maxLogEntriesField, fontSizeField; #endregion - #region Private + #region Hidden + [SerializeField, HideInInspector] private Scrollbar scrollbar; + [SerializeField, HideInInspector] private RectTransform canvasRoot; #endregion #region Constants - private const string LOG_PREFIX = "[UdonConsole]:"; - - private const string - JOIN_PREFIX = "[JOIN]", - LEAVE_PREFIX = "[LEAVE]"; - private const string WHITESPACE = " "; private const int @@ -92,16 +133,11 @@ private const int #region Private Methods private void Start() { - logItem.GetComponentInChildren(true).fontSize = fontSize; - timestampsToggle.isOn = !showTimestamps; - scrollbar = GetComponentInChildren(true); - canvasRoot = GetComponentInChildren(true).GetComponent(); - - Log($"{LOG_PREFIX} This is Varneon's Udon Essentials Console!"); - LogWarning($"{LOG_PREFIX} It can show warnings if something is out of the ordinary"); - LogError($"{LOG_PREFIX} And errors can also be shown if something goes completely wrong"); - Log($"{LOG_PREFIX} Context objects are also supported:", this); - Log($"{LOG_PREFIX} As well as assertions:"); + Log($"{systemPrefix} This is Varneon's Udon Essentials Console!"); + LogWarning($"{systemPrefix} It can show warnings if something is out of the ordinary"); + LogError($"{systemPrefix} And errors can also be shown if something goes completely wrong"); + Log($"{systemPrefix} Context objects are also supported:", this); + Log($"{systemPrefix} As well as assertions:"); Assert(false, null); } @@ -124,11 +160,11 @@ private void ReloadLogs() { GameObject item = logWindow.GetChild(i).gameObject; - string[] info = item.name.Split(' '); + string[] info = item.name.Split(new char[] { ' ' }, 2); LogType type = (LogType)int.Parse(info[0]); - string timestamp = string.Join(WHITESPACE, new string[] { info[1], info[2] }); + string timestamp = info[1]; Text text = item.GetComponent(); @@ -158,12 +194,12 @@ private void SetLogEntryActive(GameObject logEntry, LogType type) } /// - /// Gets the current timestamp formatted as "yyyy.MM.dd HH:mm:ss" + /// Gets the current timestamp formatted as defined by timestampFormat /// /// Formatted timestamp string private string GetTimestamp() { - return DateTime.UtcNow.ToLocalTime().ToString("yyyy.MM.dd HH:mm:ss"); + return DateTime.UtcNow.ToLocalTime().ToString(timestampFormat); } /// @@ -290,14 +326,14 @@ public override void ClearLogs(LogType logType) #region Player Events public override void OnPlayerJoined(VRCPlayerApi player) { - Log(string.Join(WHITESPACE, new string[] { LOG_PREFIX, JOIN_PREFIX, player.displayName })); + Log(string.Join(WHITESPACE, new string[] { systemPrefix, playerJoinPrefix, player.displayName })); } public override void OnPlayerLeft(VRCPlayerApi player) { if (!Utilities.IsValid(player)) { return; } - Log(string.Join(WHITESPACE, new string[] { LOG_PREFIX, LEAVE_PREFIX, player.displayName })); + Log(string.Join(WHITESPACE, new string[] { systemPrefix, playerLeavePrefix, player.displayName })); } #endregion @@ -423,5 +459,27 @@ private void SetFontSize(int fontSize) } } #endregion + + #region Initialization + +#if UNITY_EDITOR && !COMPILER_UDONSHARP + [UnityEditor.Callbacks.PostProcessScene(-1)] + private static void InitializeOnBuild() + { + GameObject[] sceneRoots = UnityEngine.SceneManagement.SceneManager.GetActiveScene().GetRootGameObjects(); + + System.Collections.Generic.IEnumerable consoles = sceneRoots.SelectMany(r => r.GetComponentsInChildren(true)); + + foreach (UdonConsole console in consoles) + { + console.logItem.GetComponentInChildren(true).fontSize = console.fontSize; + console.timestampsToggle.isOn = !console.showTimestamps; + console.scrollbar = console.GetComponentInChildren(true); + console.canvasRoot = console.GetComponentInChildren(true).GetComponent(); + } + } +#endif + + #endregion } } diff --git a/Packages/com.varneon.vudon.logger/package.json b/Packages/com.varneon.vudon.logger/package.json index 9a97670..252b37b 100644 --- a/Packages/com.varneon.vudon.logger/package.json +++ b/Packages/com.varneon.vudon.logger/package.json @@ -1,18 +1,21 @@ { "name": "com.varneon.vudon.logger", "displayName": "VUdon - Logger", - "version": "0.2.1", + "version": "0.3.0", "unity": "2019.4", "unityRelease": "29f1", - "description": "Runtime logger class and console for UdonSharp", + "description": "Runtime logger class and in-game console window for UdonSharp", "author": { "name": "Varneon", "url": "https://github.com/Varneon" }, "dependencies": { - "com.vrchat.udonsharp": "1.0.1" + "com.vrchat.udonsharp": "1.1.6", + "com.varneon.neon-inspector": "0.0.1" }, "vpmDependencies": { - "com.vrchat.udonsharp": "1.x.x" - } + "com.vrchat.udonsharp": ">=1.1.6 <2.0.0", + "com.varneon.neon-inspector": "0.x.x" + }, + "resolutionStrategy": "highestMinor" } \ No newline at end of file