diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..44d86fa --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,55 @@ +name: Build Release + +on: + workflow_dispatch: + +env: + packageName: "tlp.udonutils" + +permissions: + contents: write + +jobs: + build: + runs-on: ubuntu-latest + steps: + + - name: Checkout + uses: actions/checkout@v3 + + - name: get version + id: version + uses: notiz-dev/github-action-json-property@7c8cf5cc36eb85d8d287a8086a39dac59628eb31 + with: + path: "Packages/${{env.packageName}}/package.json" + prop_path: "version" + + - name: Set Environment Variables + run: | + echo "zipFile=${{ env.packageName }}-${{ steps.version.outputs.prop }}".zip >> $GITHUB_ENV + echo "unityPackage=${{ env.packageName }}-${{ steps.version.outputs.prop }}.unitypackage" >> $GITHUB_ENV + + - name: Create Zip + uses: thedoctor0/zip-release@09336613be18a8208dfa66bd57efafd9e2685657 + with: + type: "zip" + directory: "Packages/${{env.packageName}}/" + filename: "../../${{env.zipFile}}" # make the zip file two directories up, since we start two directories in above + + - run: find "Packages/${{env.packageName}}/" -name \*.meta >> metaList + + - name: Create UnityPackage + uses: pCYSl5EDgo/create-unitypackage@cfcd3cf0391a5ef1306342794866a9897c32af0b + with: + package-path: ${{ env.unityPackage }} + include-files: metaList + + + - name: Make Release + uses: softprops/action-gh-release@1e07f4398721186383de40550babbdf2b84acfc5 + with: + tag_name: ${{ steps.version.outputs.prop }} + files: | + ${{ env.zipFile }} + ${{ env.unityPackage }} + Packages/${{ env.packageName }}/package.json \ No newline at end of file diff --git a/.gitignore b/.gitignore index e0aa220..904af3a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,9 @@ -/Releases/ -/Releases.meta +/* +!.git +!.github +!.gitignore +!LICENSE +!README.md +!Packages/ +Packages/* +!Packages/tlp.udonutils/* diff --git a/Graphs/HorizontalLookAt.asset b/Graphs/HorizontalLookAt.asset deleted file mode 100644 index 8c6813f..0000000 --- a/Graphs/HorizontalLookAt.asset +++ /dev/null @@ -1,295 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!114 &11400000 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4f11136daadff0b44ac2278a314682ab, type: 3} - m_Name: HorizontalLookAt - m_EditorClassIdentifier: - serializedUdonProgramAsset: {fileID: 11400000, guid: d6bdc5fdaa093bc4b8bf3c34220f70bd, - type: 2} - udonAssembly: ".data_start\r\n\r\n .export weight\r\n \r\n instance_0: - %VRCUdonUdonBehaviour, this\r\n symbolName_0: %SystemString, null\r\n value_0: - %SystemObject, null\r\n instance_1: %UnityEngineTransform, this\r\n object_0: - %SystemObject, null\r\n result_0: %SystemBoolean, null\r\n instance_2: %UnityEngineTransform, - this\r\n value_1: %UnityEngineQuaternion, null\r\n x_0: %SystemSingle, null\r\n - \ y_0: %SystemSingle, null\r\n z_0: %SystemSingle, null\r\n Vector3_0: - %UnityEngineVector3, null\r\n instance_3: %UnityEngineQuaternion, null\r\n - \ a_0: %UnityEngineQuaternion, null\r\n b_0: %UnityEngineQuaternion, null\r\n - \ t_0: %SystemSingle, null\r\n forward_0: %UnityEngineVector3, null\r\n Vector3_1: - %UnityEngineVector3, null\r\n Vector3_2: %UnityEngineVector3, null\r\n instance_4: - %UnityEngineTransform, this\r\n instance_5: %VRCSDKBaseVRCPlayerApi, null\r\n - \ weight: %SystemSingle, null\r\n _initialRotation: %UnityEngineQuaternion, - null\r\n\r\n.data_end\r\n\r\n.code_start\r\n\r\n .export _start\r\n \r\n - \ _start:\r\n \r\n PUSH, instance_1\r\n PUSH, value_0\r\n EXTERN, - \"UnityEngineTransform.__get_rotation__UnityEngineQuaternion\"\r\n PUSH, - instance_0\r\n PUSH, symbolName_0\r\n PUSH, value_0\r\n EXTERN, - \"VRCUdonCommonInterfacesIUdonEventReceiver.__SetProgramVariable__SystemString_SystemObject__SystemVoid\"\r\n - \ JUMP, 0xFFFFFFFC\r\n \r\n .export _update\r\n \r\n _update:\r\n - \ \r\n PUSH, object_0\r\n EXTERN, \"VRCSDKBaseNetworking.__get_LocalPlayer__VRCSDKBaseVRCPlayerApi\"\r\n - \ PUSH, object_0\r\n PUSH, result_0\r\n EXTERN, \"VRCSDKBaseUtilities.__IsValid__SystemObject__SystemBoolean\"\r\n - \ PUSH, result_0\r\n JUMP_IF_FALSE, 0x00000194\r\n PUSH, instance_4\r\n - \ PUSH, Vector3_1\r\n EXTERN, \"UnityEngineTransform.__get_position__UnityEngineVector3\"\r\n - \ PUSH, object_0\r\n PUSH, instance_5\r\n COPY\r\n PUSH, - object_0\r\n PUSH, Vector3_2\r\n EXTERN, \"VRCSDKBaseVRCPlayerApi.__GetPosition__UnityEngineVector3\"\r\n - \ PUSH, Vector3_1\r\n PUSH, Vector3_2\r\n PUSH, forward_0\r\n - \ EXTERN, \"UnityEngineVector3.__op_Subtraction__UnityEngineVector3_UnityEngineVector3__UnityEngineVector3\"\r\n - \ PUSH, forward_0\r\n PUSH, b_0\r\n EXTERN, \"UnityEngineQuaternion.__LookRotation__UnityEngineVector3__UnityEngineQuaternion\"\r\n - \ PUSH, _initialRotation\r\n PUSH, b_0\r\n PUSH, weight\r\n - \ PUSH, instance_3\r\n EXTERN, \"UnityEngineQuaternion.__Slerp__UnityEngineQuaternion_UnityEngineQuaternion_SystemSingle__UnityEngineQuaternion\"\r\n - \ PUSH, instance_3\r\n PUSH, Vector3_0\r\n EXTERN, \"UnityEngineQuaternion.__get_eulerAngles__UnityEngineVector3\"\r\n - \ PUSH, Vector3_0\r\n PUSH, y_0\r\n EXTERN, \"UnityEngineVector3.__get_y__SystemSingle\"\r\n - \ PUSH, x_0\r\n PUSH, y_0\r\n PUSH, z_0\r\n PUSH, value_1\r\n - \ EXTERN, \"UnityEngineQuaternion.__Euler__SystemSingle_SystemSingle_SystemSingle__UnityEngineQuaternion\"\r\n - \ PUSH, instance_2\r\n PUSH, value_1\r\n EXTERN, \"UnityEngineTransform.__set_rotation__UnityEngineQuaternion__SystemVoid\"\r\n - \ JUMP, 0x00000194\r\n JUMP, 0xFFFFFFFC\r\n \r\n\r\n.code_end\r\n" - assemblyError: - graphData: - name: - description: - nodes: - - fullName: Variable_SystemSingle - uid: e923e774-3a73-41f5-9bfd-58e34e6aa13b - position: {x: 0, y: 0} - nodeUIDs: - - - - - - - - - - - flowUIDs: [] - nodeValues: - - unityObjectValue: {fileID: 0} - stringValue: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089|1 - - unityObjectValue: {fileID: 0} - stringValue: System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089|weight - - unityObjectValue: {fileID: 0} - stringValue: System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089|True - - unityObjectValue: {fileID: 0} - stringValue: System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089|False - - unityObjectValue: {fileID: 0} - stringValue: System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089|none - - fullName: Variable_UnityEngineQuaternion - uid: 0e0ff6b0-93a4-49ea-bc5d-d8a1def425e3 - position: {x: 0, y: 0} - nodeUIDs: - - - - - - - - - - - flowUIDs: [] - nodeValues: - - unityObjectValue: {fileID: 0} - stringValue: - - unityObjectValue: {fileID: 0} - stringValue: System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089|_initialRotation - - unityObjectValue: {fileID: 0} - stringValue: System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089|False - - unityObjectValue: {fileID: 0} - stringValue: System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089|False - - unityObjectValue: {fileID: 0} - stringValue: System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089|none - - fullName: Event_Start - uid: 2fd618ba-0e8e-4354-85ea-21d1eb1cd6e4 - position: {x: 237, y: 10.120003} - nodeUIDs: [] - flowUIDs: - - 863d8b39-795d-47f0-97ef-38332dfb396e - nodeValues: [] - - fullName: UnityEngineTransform.__get_rotation__UnityEngineQuaternion - uid: 71be00eb-4ebc-466c-8e62-d2346b5efa8d - position: {x: 366, y: 99.12} - nodeUIDs: - - - flowUIDs: [] - nodeValues: - - unityObjectValue: {fileID: 0} - stringValue: - - fullName: VRCUdonCommonInterfacesIUdonEventReceiver.__SetProgramVariable__SystemString_SystemObject__SystemVoid - uid: 863d8b39-795d-47f0-97ef-38332dfb396e - position: {x: 611, y: 10.120003} - nodeUIDs: - - - - - - 71be00eb-4ebc-466c-8e62-d2346b5efa8d|0 - flowUIDs: [] - nodeValues: - - unityObjectValue: {fileID: 0} - stringValue: - - unityObjectValue: {fileID: 0} - stringValue: System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089|_initialRotation - - unityObjectValue: {fileID: 0} - stringValue: - - fullName: Event_Update - uid: c3047606-35f4-4db7-925a-65891c080eea - position: {x: 237, y: 299.12} - nodeUIDs: [] - flowUIDs: - - dddd9e5c-9de3-4ce6-a504-eecad67a5b01 - nodeValues: [] - - fullName: UnityEngineTransform.__get_position__UnityEngineVector3 - uid: c1609de1-79b3-41f6-b104-da4653ab381e - position: {x: 447.31854, y: 449.35907} - nodeUIDs: - - - flowUIDs: [] - nodeValues: - - unityObjectValue: {fileID: 0} - stringValue: - - fullName: VRCSDKBaseNetworking.__get_LocalPlayer__VRCSDKBaseVRCPlayerApi - uid: a708fad7-7191-4583-a172-ce1b4aae4237 - position: {x: 231, y: 441.12} - nodeUIDs: [] - flowUIDs: [] - nodeValues: [] - - fullName: Is_Valid - uid: dddd9e5c-9de3-4ce6-a504-eecad67a5b01 - position: {x: 442, y: 301.12} - nodeUIDs: - - a708fad7-7191-4583-a172-ce1b4aae4237|0 - flowUIDs: - - 792ff194-644f-4481-9c40-464b58d476dc - nodeValues: - - unityObjectValue: {fileID: 0} - stringValue: - - fullName: UnityEngineVector3.__op_Subtraction__UnityEngineVector3_UnityEngineVector3__UnityEngineVector3 - uid: 71c60369-dc95-46ee-a076-85bbeeb34341 - position: {x: 665.31854, y: 470.35904} - nodeUIDs: - - c1609de1-79b3-41f6-b104-da4653ab381e|0 - - 8a27f689-3a13-4616-882d-dbe11684a773|0 - flowUIDs: [] - nodeValues: - - unityObjectValue: {fileID: 0} - stringValue: UnityEngine.Vector3, UnityEngine.CoreModule, Version=0.0.0.0, - Culture=neutral, PublicKeyToken=null|{"x":0.0,"y":0.0,"z":0.0} - - unityObjectValue: {fileID: 0} - stringValue: UnityEngine.Vector3, UnityEngine.CoreModule, Version=0.0.0.0, - Culture=neutral, PublicKeyToken=null|{"x":0.0,"y":0.0,"z":0.0} - - fullName: VRCSDKBaseVRCPlayerApi.__GetPosition__UnityEngineVector3 - uid: 8a27f689-3a13-4616-882d-dbe11684a773 - position: {x: 449.31854, y: 546.7591} - nodeUIDs: - - a708fad7-7191-4583-a172-ce1b4aae4237|0 - flowUIDs: [] - nodeValues: - - unityObjectValue: {fileID: 0} - stringValue: - - fullName: UnityEngineQuaternion.__LookRotation__UnityEngineVector3__UnityEngineQuaternion - uid: 41ff8417-f605-4b2e-a773-dadabf686b0e - position: {x: 891.3185, y: 476.11905} - nodeUIDs: - - 71c60369-dc95-46ee-a076-85bbeeb34341|0 - - - flowUIDs: [] - nodeValues: - - unityObjectValue: {fileID: 0} - stringValue: UnityEngine.Vector3, UnityEngine.CoreModule, Version=0.0.0.0, - Culture=neutral, PublicKeyToken=null|{"x":0.0,"y":0.0,"z":0.0} - - unityObjectValue: {fileID: 0} - stringValue: UnityEngine.Vector3, UnityEngine.CoreModule, Version=0.0.0.0, - Culture=neutral, PublicKeyToken=null|{"x":0.0,"y":0.0,"z":0.0} - - fullName: UnityEngineQuaternion.__Slerp__UnityEngineQuaternion_UnityEngineQuaternion_SystemSingle__UnityEngineQuaternion - uid: f9e11131-350c-4a7e-be01-ba48cced02b4 - position: {x: 1248.3185, y: 411.11908} - nodeUIDs: - - c0457fc3-0a3e-43b2-b542-6b25acfaaecd|0 - - 41ff8417-f605-4b2e-a773-dadabf686b0e|0 - - b6d37cc4-ccb6-4a47-b2af-4fd441095e7b|0 - flowUIDs: [] - nodeValues: - - unityObjectValue: {fileID: 0} - stringValue: UnityEngine.Quaternion, UnityEngine.CoreModule, Version=0.0.0.0, - Culture=neutral, PublicKeyToken=null|{"x":0.0,"y":0.0,"z":0.0,"w":0.0} - - unityObjectValue: {fileID: 0} - stringValue: UnityEngine.Quaternion, UnityEngine.CoreModule, Version=0.0.0.0, - Culture=neutral, PublicKeyToken=null|{"x":0.0,"y":0.0,"z":0.0,"w":0.0} - - unityObjectValue: {fileID: 0} - stringValue: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089|0 - - fullName: Get_Variable - uid: b6d37cc4-ccb6-4a47-b2af-4fd441095e7b - position: {x: 975.31854, y: 582.2391} - nodeUIDs: - - - flowUIDs: [] - nodeValues: - - unityObjectValue: {fileID: 0} - stringValue: System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089|e923e774-3a73-41f5-9bfd-58e34e6aa13b - - unityObjectValue: {fileID: 0} - stringValue: - - fullName: Get_Variable - uid: c0457fc3-0a3e-43b2-b542-6b25acfaaecd - position: {x: 895.3185, y: 379.99908} - nodeUIDs: - - - flowUIDs: [] - nodeValues: - - unityObjectValue: {fileID: 0} - stringValue: System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089|0e0ff6b0-93a4-49ea-bc5d-d8a1def425e3 - - unityObjectValue: {fileID: 0} - stringValue: - - fullName: UnityEngineQuaternion.__get_eulerAngles__UnityEngineVector3 - uid: 04842881-04bc-4f41-bd17-92754b9a5959 - position: {x: 1497.3186, y: 429.11905} - nodeUIDs: - - f9e11131-350c-4a7e-be01-ba48cced02b4|0 - flowUIDs: [] - nodeValues: - - unityObjectValue: {fileID: 0} - stringValue: UnityEngine.Quaternion, UnityEngine.CoreModule, Version=0.0.0.0, - Culture=neutral, PublicKeyToken=null|{"x":0.0,"y":0.0,"z":0.0,"w":0.0} - - fullName: UnityEngineTransform.__set_rotation__UnityEngineQuaternion__SystemVoid - uid: 792ff194-644f-4481-9c40-464b58d476dc - position: {x: 2185.6965, y: 304.16284} - nodeUIDs: - - - - 699ad579-eca7-43b8-ace9-62020dc8eff2|0 - flowUIDs: [] - nodeValues: - - unityObjectValue: {fileID: 0} - stringValue: - - unityObjectValue: {fileID: 0} - stringValue: UnityEngine.Quaternion, UnityEngine.CoreModule, Version=0.0.0.0, - Culture=neutral, PublicKeyToken=null|{"x":0.0,"y":0.0,"z":0.0,"w":0.0} - - fullName: UnityEngineQuaternion.__Euler__SystemSingle_SystemSingle_SystemSingle__UnityEngineQuaternion - uid: 699ad579-eca7-43b8-ace9-62020dc8eff2 - position: {x: 1941.4781, y: 377.9635} - nodeUIDs: - - - - 29a0f821-190b-456d-9716-44d82f76bdba|0 - - - flowUIDs: [] - nodeValues: - - unityObjectValue: {fileID: 0} - stringValue: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089|0 - - unityObjectValue: {fileID: 0} - stringValue: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089|0 - - unityObjectValue: {fileID: 0} - stringValue: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089|0 - - fullName: UnityEngineVector3.__get_y__SystemSingle - uid: 29a0f821-190b-456d-9716-44d82f76bdba - position: {x: 1765.9839, y: 426.9353} - nodeUIDs: - - 04842881-04bc-4f41-bd17-92754b9a5959|0 - flowUIDs: [] - nodeValues: - - unityObjectValue: {fileID: 0} - stringValue: UnityEngine.Vector3, UnityEngine.CoreModule, Version=0.0.0.0, - Culture=neutral, PublicKeyToken=null|{"x":0.0,"y":0.0,"z":0.0} - updateOrder: 0 - graphElementData: - - type: 5 - uid: 9812095f-d089-45e4-b339-c14973bd58e9 - jsonData: '{"visible":true,"layout":{"serializedVersion":"2","x":10.0,"y":130.0,"width":200.0,"height":150.0}}' - viewTransform: - position: {x: 73.2903, y: 136.85036} - scale: 0.57175326 - version: 1.0.0 - showAssembly: 0 diff --git a/LICENSE b/LICENSE index ba270be..535612d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2020 Guribo +Copyright (c) 2023 Guribo Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/Graphs.meta b/Packages/tlp.udonutils/Runtime.meta similarity index 77% rename from Graphs.meta rename to Packages/tlp.udonutils/Runtime.meta index 24327ee..664039a 100644 --- a/Graphs.meta +++ b/Packages/tlp.udonutils/Runtime.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 3638ed376c5a86d44a37588903294bf0 +guid: 4c12bc4e35c3f34489e7202f117a7d42 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Scripts/Common.meta b/Packages/tlp.udonutils/Runtime/Common.meta similarity index 77% rename from Scripts/Common.meta rename to Packages/tlp.udonutils/Runtime/Common.meta index 1f6cd45..1d1f495 100644 --- a/Scripts/Common.meta +++ b/Packages/tlp.udonutils/Runtime/Common.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: ba13d0994d1dd394fb7a38e342a8e2dc +guid: 15b1b88658600ee468c4bdbda71cd7ab folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Packages/tlp.udonutils/Runtime/Common/UdonCommon.cs b/Packages/tlp.udonutils/Runtime/Common/UdonCommon.cs new file mode 100644 index 0000000..93ecd61 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Common/UdonCommon.cs @@ -0,0 +1,166 @@ +using System; +using UnityEngine; +using VRC.SDKBase; + +namespace TLP.UdonUtils.Common +{ + public static class UdonCommon + { + /// + /// Finds the component of a given type in the current gameobject hierarchy which is closest to the scene root + /// + /// + /// + /// the found component or null if none was found + public static Component FindTopComponent(Type type, Transform start) + { + if (!Utilities.IsValid(start)) + { + return null; + } + + Component topComponent = null; + var topTransform = start; + + do + { + var behaviour = topTransform.GetComponent(type); + if (Utilities.IsValid(behaviour)) + { + topComponent = behaviour; + } + + topTransform = topTransform.parent; + } while (Utilities.IsValid(topTransform)); + + return topComponent; + } + + /** + * O(n) - scales linearly with number of players present, don't use in Update()! + */ + public static VRCPlayerApi GetClosestPlayer(ref VRCPlayerApi[] players, Vector3 location) + { + int playerCount = VRCPlayerApi.GetPlayerCount(); + if (players == null || players.Length < playerCount) + { + players = new VRCPlayerApi[playerCount * 2]; + } + + VRCPlayerApi.GetPlayers(players); + VRCPlayerApi closestPlayer = null; + float closestDistance = float.MaxValue; + for (int i = 0; i < playerCount; i++) + { + var playerInRange = players[i]; + if (!Utilities.IsValid(playerInRange)) + { + continue; + } + + var distanceVector = location - playerInRange.GetPosition(); + var projectedDistance = Vector3.ProjectOnPlane( + distanceVector, + playerInRange.GetRotation() * Vector3.up + ); + float projectedDistanceMagnitude = projectedDistance.magnitude; + if (projectedDistanceMagnitude < closestDistance) + { + closestDistance = projectedDistanceMagnitude; + closestPlayer = playerInRange; + } + } + + return closestPlayer; + } + + public static VRCPlayerApi GetClosestNonLocalPlayer(ref VRCPlayerApi[] players, Vector3 location) + { + int playerCount = VRCPlayerApi.GetPlayerCount(); + if (players == null || players.Length < playerCount) + { + players = new VRCPlayerApi[playerCount * 2]; + } + + VRCPlayerApi.GetPlayers(players); + VRCPlayerApi closestPlayer = null; + float closestDistance = float.MaxValue; + for (int i = 0; i < playerCount; i++) + { + var playerInRange = players[i]; + if (!Utilities.IsValid(playerInRange)) + { + continue; + } + + if (playerInRange.isLocal) + { + continue; + } + + var distanceVector = location - playerInRange.GetPosition(); + var projectedDistance = Vector3.ProjectOnPlane( + distanceVector, + playerInRange.GetRotation() * Vector3.up + ); + float projectedDistanceMagnitude = projectedDistance.magnitude; + if (projectedDistanceMagnitude < closestDistance) + { + closestDistance = projectedDistanceMagnitude; + closestPlayer = playerInRange; + } + } + + return closestPlayer; + } + + public static int GetPlayersInRangeNoAlloc( + ref VRCPlayerApi[] players, + Vector3 position, + float radius, + VRCPlayerApi[] outPlayers + ) + { + int playerCount = VRCPlayerApi.GetPlayerCount(); + if (players == null || players.Length < playerCount) + { + players = new VRCPlayerApi[playerCount * 2]; + } + + if (outPlayers == null) + { + return 0; + } + + VRCPlayerApi.GetPlayers(players); + + int playersFound = 0; + + for (int i = 0; i < playerCount; i++) + { + var playerInRange = players[i]; + if (!Utilities.IsValid(playerInRange)) + { + continue; + } + + if (Vector3.Distance(position, playerInRange.GetPosition()) < radius) + { + if (outPlayers.Length >= playersFound) + { + outPlayers[playersFound] = playerInRange; + ++playersFound; + } + } + } + + return playersFound; + } + + public static string UdonTypeNameShort(string udonTypeName) + { + string[] productTypeName = udonTypeName.Split('.'); + return productTypeName.Length > 0 ? productTypeName[productTypeName.Length - 1] : udonTypeName; + } + } +} \ No newline at end of file diff --git a/Scripts/Common/UdonCommon.cs.meta b/Packages/tlp.udonutils/Runtime/Common/UdonCommon.cs.meta similarity index 100% rename from Scripts/Common/UdonCommon.cs.meta rename to Packages/tlp.udonutils/Runtime/Common/UdonCommon.cs.meta diff --git a/README.meta b/Packages/tlp.udonutils/Runtime/DesignPatterns.meta similarity index 77% rename from README.meta rename to Packages/tlp.udonutils/Runtime/DesignPatterns.meta index bd7248b..2e3ce07 100644 --- a/README.meta +++ b/Packages/tlp.udonutils/Runtime/DesignPatterns.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: d9bc5484a16077e4bb23256ea2cd3c10 +guid: 8b80eca275b7dd6479a3a69748d4dbd4 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Scenes/Examples.meta b/Packages/tlp.udonutils/Runtime/DesignPatterns/MVC.meta similarity index 77% rename from Scenes/Examples.meta rename to Packages/tlp.udonutils/Runtime/DesignPatterns/MVC.meta index c5f0213..6704314 100644 --- a/Scenes/Examples.meta +++ b/Packages/tlp.udonutils/Runtime/DesignPatterns/MVC.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 3a2f17b414483cf41a4b8fc1c0700502 +guid: 505e85f876996b9418851aab31430300 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Packages/tlp.udonutils/Runtime/DesignPatterns/MVC/Controller.cs b/Packages/tlp.udonutils/Runtime/DesignPatterns/MVC/Controller.cs new file mode 100644 index 0000000..2bd92b7 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/DesignPatterns/MVC/Controller.cs @@ -0,0 +1,146 @@ +using JetBrains.Annotations; +using UnityEngine; +using VRC.SDKBase; + +namespace TLP.UdonUtils.DesignPatterns.MVC +{ + /// + /// The controller in the MVC pattern is responsible for receiving user input and updating the model and view + /// accordingly. + /// It acts as a bridge between the model and the view, ensuring that any changes made to the model + /// are reflected in the view. + /// The controller also handles any business logic related to user input. + /// + [DefaultExecutionOrder(ExecutionOrder)] + public abstract class Controller : MvcBase + { + protected override int ExecutionOrderReadOnly => ExecutionOrder; + + [PublicAPI] + public new const int ExecutionOrder = Model.ExecutionOrder + 1; + + public bool Initialized { get; private set; } + protected Model Model { get; private set; } + protected View View { get; private set; } + + #region PublicAPI + + [PublicAPI] + public bool Initialize(Model model, View view) + { +#if TLP_DEBUG + DebugLog(nameof(Initialize)); +#endif + if (HasError) + { + Error($"Can not initialize again due to previous critical error: '{CriticalError}'"); + return false; + } + + if (Initialized) + { + Warn("Already initialized"); + return false; + } + + if (!Utilities.IsValid(view)) + { + Error($"{nameof(view)} invalid"); + return false; + } + + if (!Utilities.IsValid(model)) + { + Error($"{nameof(model)} invalid"); + return false; + } + + if (view.HasError) + { + Error($"{nameof(view)} has critical error: '{view.CriticalError}'"); + return false; + } + + if (view.Initialized) + { + Error($"{nameof(view)} is already initialized"); + return false; + } + + if (model.HasError) + { + Error($"{nameof(model)} has critical error: '{model.CriticalError}'"); + return false; + } + + if (!model.Initialized) + { + Error($"{nameof(model)} is not initialized"); + return false; + } + + View = view; + Model = model; + + // setting it to true to prevent attempts to re-initialize controllers that have + // failed to initialize and are in need of cleanup + Initialized = true; + + if (InitializeInternal()) + { + return true; + } + + Error($"Initialization failed. Using {nameof(DeInitialize)} to cleanup."); + DeInitialize(); + return false; + } + + protected virtual void OnDestroy() + { +#if TLP_DEBUG + DebugLog(nameof(OnDestroy)); +#endif + DeInitialize(); + } + + public bool DeInitialize() + { +#if TLP_DEBUG + DebugLog(nameof(DeInitialize)); +#endif + if (!Initialized) + { + return false; + } + + if (Utilities.IsValid(View)) + { + View.DeInitialize(); + } + + View = null; + + if (Utilities.IsValid(Model)) + { + Model.DeInitialize(); + } + + Model = null; + + if (DeInitializeInternal()) + { + Initialized = false; + CriticalError = null; + return true; + } + + CriticalError = $"De-Initialization failed."; + Error(CriticalError); + HasError = true; + return false; + } + + #endregion + } +} \ No newline at end of file diff --git a/Scripts/Common/Editor/Networking/OwnershipTransferEditor.cs.meta b/Packages/tlp.udonutils/Runtime/DesignPatterns/MVC/Controller.cs.meta similarity index 83% rename from Scripts/Common/Editor/Networking/OwnershipTransferEditor.cs.meta rename to Packages/tlp.udonutils/Runtime/DesignPatterns/MVC/Controller.cs.meta index 5b0d0b4..e8b89fc 100644 --- a/Scripts/Common/Editor/Networking/OwnershipTransferEditor.cs.meta +++ b/Packages/tlp.udonutils/Runtime/DesignPatterns/MVC/Controller.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: e2c21512ad0e81b41b14dc223c8fb956 +guid: 2e7b77ccf077fd34fac39c267d68770e MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Packages/tlp.udonutils/Runtime/DesignPatterns/MVC/DummyView.asset b/Packages/tlp.udonutils/Runtime/DesignPatterns/MVC/DummyView.asset new file mode 100644 index 0000000..b2a44c7 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/DesignPatterns/MVC/DummyView.asset @@ -0,0 +1,743 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3} + m_Name: DummyView + m_EditorClassIdentifier: + serializedUdonProgramAsset: {fileID: 11400000, guid: d33163e2cbe294848a7ea9e488b7d07e, + type: 2} + udonAssembly: + assemblyError: + sourceCsScript: {fileID: 11500000, guid: c8db13e7e4484903a70bc2f4f099ffb3, type: 3} + scriptVersion: 2 + compiledVersion: 2 + behaviourSyncMode: 1 + hasInteractEvent: 0 + scriptID: -4634886210466703129 + serializationData: + SerializedFormat: 2 + SerializedBytes: + ReferencedUnityObjects: [] + SerializedBytesString: + Prefab: {fileID: 0} + PrefabModificationsReferencedUnityObjects: [] + PrefabModifications: [] + SerializationNodes: + - Name: fieldDefinitions + Entry: 7 + Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition, + UdonSharp.Editor]], mscorlib + - Name: comparer + Entry: 7 + Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String, + mscorlib]], mscorlib + - Name: + Entry: 8 + Data: + - Name: + Entry: 12 + Data: 12 + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: PendingSerializations + - Name: $v + Entry: 7 + Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: PendingSerializations + - Name: k__BackingField + Entry: 7 + Data: 3|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Int32, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 4|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: Severity + - Name: $v + Entry: 7 + Data: 5|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Severity + - Name: k__BackingField + Entry: 7 + Data: 6|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.Logger.ELogLevel, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: 7|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 8|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 9|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 7 + Data: 10|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.Logger.TlpLogger, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: 11|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: VRC.Udon.UdonBehaviour, VRC.Udon + - Name: + Entry: 8 + Data: + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 12|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: EventInstigator + - Name: $v + Entry: 7 + Data: 13|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: EventInstigator + - Name: k__BackingField + Entry: 7 + Data: 14|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.TlpBaseBehaviour, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: 15|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 3 + - Name: + Entry: 7 + Data: 16|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 17|UnityEngine.HideInInspector, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 18|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - 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: Pool + - Name: $v + Entry: 7 + Data: 19|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Pool + - Name: k__BackingField + Entry: 9 + Data: 14 + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: 20|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 3 + - Name: + Entry: 7 + Data: 21|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 22|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 23|UnityEngine.HideInInspector, UnityEngine.CoreModule + - 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: PoolableInUse + - Name: $v + Entry: 7 + Data: 24|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: PoolableInUse + - Name: k__BackingField + Entry: 7 + Data: 25|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Boolean, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 26|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 27|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 28|UnityEngine.HideInInspector, UnityEngine.CoreModule + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 29|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 7 + Data: 30|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.String, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 30 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 31|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 32|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 33|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 34|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 35|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 36|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 7 + Data: 37|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.DesignPatterns.MVC.Model, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 38|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 39|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 7 + Data: 40|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.DesignPatterns.MVC.Controller, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 41|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _modelChangeEvent + - Name: $v + Entry: 7 + Data: 42|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _modelChangeEvent + - Name: k__BackingField + Entry: 7 + Data: 43|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.Events.UdonEvent, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 44|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: diff --git a/Scripts/Common/HorizontalLookAt.asset.meta b/Packages/tlp.udonutils/Runtime/DesignPatterns/MVC/DummyView.asset.meta similarity index 79% rename from Scripts/Common/HorizontalLookAt.asset.meta rename to Packages/tlp.udonutils/Runtime/DesignPatterns/MVC/DummyView.asset.meta index c0d1c89..ed22b18 100644 --- a/Scripts/Common/HorizontalLookAt.asset.meta +++ b/Packages/tlp.udonutils/Runtime/DesignPatterns/MVC/DummyView.asset.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: a37533707706cdc4ba5293865ef9c38c +guid: 7f85fe3ea0b1c734ebff43a1a7d05f03 NativeFormatImporter: externalObjects: {} mainObjectFileID: 11400000 diff --git a/Packages/tlp.udonutils/Runtime/DesignPatterns/MVC/DummyView.cs b/Packages/tlp.udonutils/Runtime/DesignPatterns/MVC/DummyView.cs new file mode 100644 index 0000000..5ca09c3 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/DesignPatterns/MVC/DummyView.cs @@ -0,0 +1,12 @@ +using UdonSharp; + +namespace TLP.UdonUtils.DesignPatterns.MVC +{ + [UdonBehaviourSyncMode(BehaviourSyncMode.None)] + public class DummyView : View + { + public override void OnModelChanged() + { + } + } +} \ No newline at end of file diff --git a/Packages/tlp.udonutils/Runtime/DesignPatterns/MVC/DummyView.cs.meta b/Packages/tlp.udonutils/Runtime/DesignPatterns/MVC/DummyView.cs.meta new file mode 100644 index 0000000..f0a9bd3 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/DesignPatterns/MVC/DummyView.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: c8db13e7e4484903a70bc2f4f099ffb3 +timeCreated: 1682614793 \ No newline at end of file diff --git a/Packages/tlp.udonutils/Runtime/DesignPatterns/MVC/Model.cs b/Packages/tlp.udonutils/Runtime/DesignPatterns/MVC/Model.cs new file mode 100644 index 0000000..84dcc7e --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/DesignPatterns/MVC/Model.cs @@ -0,0 +1,181 @@ +using JetBrains.Annotations; +using TLP.UdonUtils.Events; +using UnityEngine; +using VRC.SDKBase; + +namespace TLP.UdonUtils.DesignPatterns.MVC +{ + [DefaultExecutionOrder(ExecutionOrder)] + public abstract class Model : MvcBase + { + public new const int ExecutionOrder = TlpExecutionOrder.UiStart; + private const string OnModelChangedCallbackName = "OnModelChanged"; + + public bool Initialized { get; private set; } + + public UdonEvent ChangeEvent { get; private set; } + + + #region PublicAPI + + public bool IsReady() + { + if (HasError) + { + Error("Can not add due to previous critical Error"); + return false; + } + + if (Initialized) + { + return true; + } + + Error("Not initialized"); + return false; + } + + [PublicAPI] + public bool Initialize(UdonEvent changeEvent) + { +#if TLP_DEBUG + DebugLog(nameof(Initialize)); +#endif + if (HasError) + { + Error($"Can not initialize again due to previous critical error: '{CriticalError}'"); + return false; + } + + if (Initialized) + { + Warn("Already initialized"); + return false; + } + + if (!Utilities.IsValid(changeEvent)) + { + Error($"{nameof(changeEvent)} invalid"); + return false; + } + + Dirty = false; + ChangeEvent = changeEvent; + ChangeEvent.ListenerMethod = OnModelChangedCallbackName; + if (!ChangeEvent.AddListenerVerified(this, OnModelChangedCallbackName)) + { + Error($"Adding to {nameof(ChangeEvent)} with callback '{OnModelChangedCallbackName}' failed"); + return false; + } + + // setting it to true to prevent attempts to re-initialize controllers that have + // failed to initialize and are in need of cleanup + Initialized = true; + + if (InitializeInternal()) + { + return true; + } + + Error($"Initialization failed. Using {nameof(DeInitialize)} to cleanup."); + DeInitialize(); + return false; + } + + public override void OnEvent(string eventName) + { +#if TLP_DEBUG + DebugLog($"{nameof(OnEvent)} {eventName}"); +#endif + + if (eventName == OnModelChangedCallbackName && ReferenceEquals(EventInstigator, this)) + { + Dirty = false; + return; + } + + base.OnEvent(eventName); + } + + + public void NotifyIfDirty(int delayFrames = 0) + { + if (!Dirty) + { + return; + } + + if (HasError || !Initialized) + { + Error(HasError ? "Has Error" : "Not Initialized"); + return; + } + + if (!Utilities.IsValid(ChangeEvent)) + { + Error($"{nameof(ChangeEvent)} invalid"); + return; + } + + if (delayFrames < 1) + { + if (!ChangeEvent.Raise(this)) + { + Error($"Failed to raise {nameof(ChangeEvent)} '{ChangeEvent.ListenerMethod}'"); + } + + return; + } + + if (!ChangeEvent.RaiseOnIdle(this, delayFrames)) + { + Error($"Failed to raise {nameof(ChangeEvent)} '{ChangeEvent.ListenerMethod}'"); + } + } + + public virtual bool Dirty { get; set; } + + protected virtual void OnDestroy() + { +#if TLP_DEBUG + DebugLog(nameof(OnDestroy)); +#endif + DeInitialize(); + } + + public bool DeInitialize() + { +#if TLP_DEBUG + DebugLog(nameof(DeInitialize)); +#endif + if (!Initialized) + { + return false; + } + + if (Utilities.IsValid(ChangeEvent)) + { + if (!ChangeEvent.RemoveListener(this, true)) + { + Warn($"{nameof(ChangeEvent)} wasn't being listened to"); + } + } + + if (DeInitializeInternal()) + { + ChangeEvent = null; + Initialized = false; + CriticalError = null; + return true; + } + + ChangeEvent = null; + CriticalError = $"De-Initialization failed."; + Error(CriticalError); + HasError = true; + return false; + } + + #endregion + } +} \ No newline at end of file diff --git a/Scripts/Common/Editor/UdonCommonEditor.cs.meta b/Packages/tlp.udonutils/Runtime/DesignPatterns/MVC/Model.cs.meta similarity index 83% rename from Scripts/Common/Editor/UdonCommonEditor.cs.meta rename to Packages/tlp.udonutils/Runtime/DesignPatterns/MVC/Model.cs.meta index 97f13ed..5fcaa33 100644 --- a/Scripts/Common/Editor/UdonCommonEditor.cs.meta +++ b/Packages/tlp.udonutils/Runtime/DesignPatterns/MVC/Model.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 9c86899c631b4f246a31c75efacad6fe +guid: 6009801846b33b4498ed0fea6a3f2a1f MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Packages/tlp.udonutils/Runtime/DesignPatterns/MVC/MvcBase.cs b/Packages/tlp.udonutils/Runtime/DesignPatterns/MVC/MvcBase.cs new file mode 100644 index 0000000..f0f4db6 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/DesignPatterns/MVC/MvcBase.cs @@ -0,0 +1,48 @@ +using TLP.UdonUtils.Events; +using UnityEngine; + +namespace TLP.UdonUtils.DesignPatterns.MVC +{ + public abstract class MvcBase : TlpBaseBehaviour + { + public string CriticalError { get; protected set; } + + public bool HasError { get; protected set; } + + public static bool InitializeMvcSingleGameObject(GameObject gameObject) + { + return InitializeMvc( + gameObject.GetComponent(), + gameObject.GetComponent(), + gameObject.GetComponent(), + gameObject.GetComponent() + ); + } + + public static bool InitializeMvc( + Model model, + View view, + Controller controller, + UdonEvent modelChangedEvent + ) + { + return model.Initialize(modelChangedEvent) + && controller.Initialize(model, view) + && view.Initialize(controller, model); + } + + #region Hooks + + protected virtual bool InitializeInternal() + { + return true; + } + + protected virtual bool DeInitializeInternal() + { + return true; + } + + #endregion + } +} \ No newline at end of file diff --git a/Packages/tlp.udonutils/Runtime/DesignPatterns/MVC/MvcBase.cs.meta b/Packages/tlp.udonutils/Runtime/DesignPatterns/MVC/MvcBase.cs.meta new file mode 100644 index 0000000..4331553 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/DesignPatterns/MVC/MvcBase.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: dbf7aba592e147d58d75553f36221785 +timeCreated: 1675528678 \ No newline at end of file diff --git a/Packages/tlp.udonutils/Runtime/DesignPatterns/MVC/View.cs b/Packages/tlp.udonutils/Runtime/DesignPatterns/MVC/View.cs new file mode 100644 index 0000000..015b35b --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/DesignPatterns/MVC/View.cs @@ -0,0 +1,177 @@ +using JetBrains.Annotations; +using TLP.UdonUtils.Events; +using UnityEngine; +using VRC.SDKBase; + +namespace TLP.UdonUtils.DesignPatterns.MVC +{ + [DefaultExecutionOrder(ExecutionOrder)] + public abstract class View : MvcBase + { + protected override int ExecutionOrderReadOnly => ExecutionOrder; + + [PublicAPI] + public new const int ExecutionOrder = Controller.ExecutionOrder + 1; + + public bool Initialized { get; private set; } + public Model Model { get; private set; } + public Controller Controller { get; private set; } + private UdonEvent _modelChangeEvent; + + protected virtual void OnDestroy() + { +#if TLP_DEBUG + DebugLog(nameof(OnDestroy)); +#endif + DeInitialize(); + } + + #region PublicAPI + + [PublicAPI] + public bool Initialize(Controller optionalController, Model model) + { +#if TLP_DEBUG + DebugLog(nameof(Initialize)); +#endif + if (HasError) + { + Error($"Can not initialize again due to previous critical error: '{CriticalError}'"); + return false; + } + + if (Initialized) + { + Warn("Already initialized"); + return false; + } + + if (!Utilities.IsValid(model)) + { + Error($"{nameof(model)} invalid"); + return false; + } + + if (model.HasError) + { + Error($"{nameof(model)} has critical error: '{model.CriticalError}'"); + return false; + } + + if (!model.Initialized) + { + Error($"{nameof(model)} is not initialized"); + return false; + } + + + if (Utilities.IsValid(optionalController)) + { + if (optionalController.HasError) + { + Error($"{nameof(optionalController)} has critical error: '{optionalController.CriticalError}'"); + return false; + } + + if (!optionalController.Initialized) + { + Error($"{nameof(optionalController)} is not initialized"); + return false; + } + + Controller = optionalController; + } + else + { + Controller = null; + } + + if (!Utilities.IsValid(model.ChangeEvent)) + { + Error($"{nameof(model.ChangeEvent)} invalid"); + return false; + } + + Model = model; + _modelChangeEvent = model.ChangeEvent; + _modelChangeEvent.AddListenerVerified(this, nameof(OnModelChanged)); + + // setting it to true to prevent attempts to re-initialize controllers that have + // failed to initialize and are in need of cleanup + Initialized = true; + if (InitializeInternal()) + { + return true; + } + + Error($"Initialization failed. Using {nameof(DeInitialize)} to cleanup."); + DeInitialize(); + return false; + } + + public bool DeInitialize() + { +#if TLP_DEBUG + DebugLog(nameof(DeInitialize)); +#endif + if (!Initialized) + { + return false; + } + + if (Utilities.IsValid(_modelChangeEvent)) + { + _modelChangeEvent.RemoveListener(this, false); + _modelChangeEvent = null; + } + + Model = null; + + if (DeInitializeInternal()) + { + Initialized = false; + CriticalError = null; + return true; + } + + CriticalError = $"De-Initialization failed."; + Error(CriticalError); + HasError = true; + return false; + } + + #endregion + + #region Hooks + + public abstract void OnModelChanged(); + + #endregion + + #region Internal + + public override void OnEvent(string eventName) + { + switch (eventName) + { + case nameof(OnModelChanged): + if (Initialized && !HasError) + { + OnModelChanged(); + } + else + { + Warn($"Ignoring '{eventName}' as not initialized or error has occurred"); + base.OnEvent(eventName); + } + + break; + default: + base.OnEvent(eventName); + return; + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Scripts/Common/Editor/UdonMathEditor.cs.meta b/Packages/tlp.udonutils/Runtime/DesignPatterns/MVC/View.cs.meta similarity index 83% rename from Scripts/Common/Editor/UdonMathEditor.cs.meta rename to Packages/tlp.udonutils/Runtime/DesignPatterns/MVC/View.cs.meta index beea729..fc3cd3f 100644 --- a/Scripts/Common/Editor/UdonMathEditor.cs.meta +++ b/Packages/tlp.udonutils/Runtime/DesignPatterns/MVC/View.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 9ab1a44b0ba276c46acdb97971ec7bfa +guid: 9755f6b7af945ec48922074df8e73f30 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Scripts.meta b/Packages/tlp.udonutils/Runtime/Events.meta similarity index 77% rename from Scripts.meta rename to Packages/tlp.udonutils/Runtime/Events.meta index ab44a4c..59e0783 100644 --- a/Scripts.meta +++ b/Packages/tlp.udonutils/Runtime/Events.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: e93f6d216ff6ebd4a9175779e27c212a +guid: cde78f2da1d06ab4fa0ae79aa77f32e6 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Packages/tlp.udonutils/Runtime/Events/AudioEvent.asset b/Packages/tlp.udonutils/Runtime/Events/AudioEvent.asset new file mode 100644 index 0000000..7d02721 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Events/AudioEvent.asset @@ -0,0 +1,854 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3} + m_Name: AudioEvent + m_EditorClassIdentifier: + serializedUdonProgramAsset: {fileID: 11400000, guid: d45c4a2db24880e47aaf5a2fb83e07dd, + type: 2} + udonAssembly: + assemblyError: + sourceCsScript: {fileID: 11500000, guid: e20d1406d8c442dca0724e09444df504, type: 3} + scriptVersion: 2 + compiledVersion: 2 + behaviourSyncMode: 2 + hasInteractEvent: 0 + scriptID: 7908371545052765338 + serializationData: + SerializedFormat: 2 + SerializedBytes: + ReferencedUnityObjects: [] + SerializedBytesString: + Prefab: {fileID: 0} + PrefabModificationsReferencedUnityObjects: [] + PrefabModifications: [] + SerializationNodes: + - Name: fieldDefinitions + Entry: 7 + Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition, + UdonSharp.Editor]], mscorlib + - Name: comparer + Entry: 7 + Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String, + mscorlib]], mscorlib + - Name: + Entry: 8 + Data: + - Name: + Entry: 12 + Data: 14 + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: PendingSerializations + - Name: $v + Entry: 7 + Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: PendingSerializations + - Name: k__BackingField + Entry: 7 + Data: 3|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Int32, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 4|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: Severity + - Name: $v + Entry: 7 + Data: 5|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Severity + - Name: k__BackingField + Entry: 7 + Data: 6|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.Logger.ELogLevel, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: 7|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 8|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 9|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 7 + Data: 10|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.Logger.TlpLogger, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: 11|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: VRC.Udon.UdonBehaviour, VRC.Udon + - Name: + Entry: 8 + Data: + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 12|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: EventInstigator + - Name: $v + Entry: 7 + Data: 13|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: EventInstigator + - Name: k__BackingField + Entry: 7 + Data: 14|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.TlpBaseBehaviour, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: 15|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 3 + - Name: + Entry: 7 + Data: 16|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 17|UnityEngine.HideInInspector, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 18|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - 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: Pool + - Name: $v + Entry: 7 + Data: 19|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Pool + - Name: k__BackingField + Entry: 9 + Data: 14 + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: 20|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 3 + - Name: + Entry: 7 + Data: 21|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 22|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 23|UnityEngine.HideInInspector, UnityEngine.CoreModule + - 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: PoolableInUse + - Name: $v + Entry: 7 + Data: 24|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: PoolableInUse + - Name: k__BackingField + Entry: 7 + Data: 25|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Boolean, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 26|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 27|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 28|UnityEngine.HideInInspector, UnityEngine.CoreModule + - 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: Listeners + - Name: $v + Entry: 7 + Data: 29|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Listeners + - Name: k__BackingField + Entry: 7 + Data: 30|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.TlpBaseBehaviour[], TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: 31|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: UnityEngine.Component[], UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - 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: 32|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 33|UnityEngine.SerializeField, UnityEngine.CoreModule + - 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: RaiseOnEnable + - Name: $v + Entry: 7 + Data: 34|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: RaiseOnEnable + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 35|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: RaiseOnStart + - Name: $v + Entry: 7 + Data: 36|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: RaiseOnStart + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 37|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: ListenerMethod + - Name: $v + Entry: 7 + Data: 38|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: ListenerMethod + - Name: k__BackingField + Entry: 7 + Data: 39|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.String, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 39 + - 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: 40|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 41|UnityEngine.TooltipAttribute, UnityEngine.CoreModule + - Name: tooltip + Entry: 1 + Data: Name of the method to be called on each listener + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 42|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 43|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 44|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _nextInvocationFrame + - Name: $v + Entry: 7 + Data: 45|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _nextInvocationFrame + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 46|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _instigator + - Name: $v + Entry: 7 + Data: 47|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _instigator + - Name: k__BackingField + Entry: 9 + Data: 14 + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 48|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 49|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 50|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: diff --git a/Scripts/Common/Networking/OwnerOnly.asset.meta b/Packages/tlp.udonutils/Runtime/Events/AudioEvent.asset.meta similarity index 79% rename from Scripts/Common/Networking/OwnerOnly.asset.meta rename to Packages/tlp.udonutils/Runtime/Events/AudioEvent.asset.meta index 33cb4a4..28f1952 100644 --- a/Scripts/Common/Networking/OwnerOnly.asset.meta +++ b/Packages/tlp.udonutils/Runtime/Events/AudioEvent.asset.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: a9d7f3c7a72f844488ff7cbb04cfd1a6 +guid: d9cb23a6fff21ad4aae7c7556dcba43c NativeFormatImporter: externalObjects: {} mainObjectFileID: 11400000 diff --git a/Packages/tlp.udonutils/Runtime/Events/AudioEvent.cs b/Packages/tlp.udonutils/Runtime/Events/AudioEvent.cs new file mode 100644 index 0000000..b50ad93 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Events/AudioEvent.cs @@ -0,0 +1,16 @@ +using JetBrains.Annotations; +using UdonSharp; +using UnityEngine; + +namespace TLP.UdonUtils.Events +{ + [DefaultExecutionOrder(ExecutionOrder)] + [UdonBehaviourSyncMode(BehaviourSyncMode.NoVariableSync)] + public class AudioEvent : UdonEvent + { + protected override int ExecutionOrderReadOnly => ExecutionOrder; + + [PublicAPI] + public new const int ExecutionOrder = TlpExecutionOrder.AudioStart; + } +} \ No newline at end of file diff --git a/Packages/tlp.udonutils/Runtime/Events/AudioEvent.cs.meta b/Packages/tlp.udonutils/Runtime/Events/AudioEvent.cs.meta new file mode 100644 index 0000000..d48deb8 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Events/AudioEvent.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: e20d1406d8c442dca0724e09444df504 +timeCreated: 1676120656 \ No newline at end of file diff --git a/Packages/tlp.udonutils/Runtime/Events/DirectInputEvent.asset b/Packages/tlp.udonutils/Runtime/Events/DirectInputEvent.asset new file mode 100644 index 0000000..860233a --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Events/DirectInputEvent.asset @@ -0,0 +1,854 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3} + m_Name: DirectInputEvent + m_EditorClassIdentifier: + serializedUdonProgramAsset: {fileID: 11400000, guid: 8c32cabbf588ff54188b2d3eb52bd9f3, + type: 2} + udonAssembly: + assemblyError: + sourceCsScript: {fileID: 11500000, guid: b0340305c81c4a769edb673cb7fbaba1, type: 3} + scriptVersion: 2 + compiledVersion: 2 + behaviourSyncMode: 2 + hasInteractEvent: 0 + scriptID: -974849984374150553 + serializationData: + SerializedFormat: 2 + SerializedBytes: + ReferencedUnityObjects: [] + SerializedBytesString: + Prefab: {fileID: 0} + PrefabModificationsReferencedUnityObjects: [] + PrefabModifications: [] + SerializationNodes: + - Name: fieldDefinitions + Entry: 7 + Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition, + UdonSharp.Editor]], mscorlib + - Name: comparer + Entry: 7 + Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String, + mscorlib]], mscorlib + - Name: + Entry: 8 + Data: + - Name: + Entry: 12 + Data: 14 + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: PendingSerializations + - Name: $v + Entry: 7 + Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: PendingSerializations + - Name: k__BackingField + Entry: 7 + Data: 3|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Int32, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 4|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: Severity + - Name: $v + Entry: 7 + Data: 5|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Severity + - Name: k__BackingField + Entry: 7 + Data: 6|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.Logger.ELogLevel, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: 7|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 8|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 9|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 7 + Data: 10|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.Logger.TlpLogger, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: 11|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: VRC.Udon.UdonBehaviour, VRC.Udon + - Name: + Entry: 8 + Data: + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 12|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: EventInstigator + - Name: $v + Entry: 7 + Data: 13|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: EventInstigator + - Name: k__BackingField + Entry: 7 + Data: 14|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.TlpBaseBehaviour, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: 15|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 3 + - Name: + Entry: 7 + Data: 16|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 17|UnityEngine.HideInInspector, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 18|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - 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: Pool + - Name: $v + Entry: 7 + Data: 19|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Pool + - Name: k__BackingField + Entry: 9 + Data: 14 + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: 20|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 3 + - Name: + Entry: 7 + Data: 21|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 22|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 23|UnityEngine.HideInInspector, UnityEngine.CoreModule + - 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: PoolableInUse + - Name: $v + Entry: 7 + Data: 24|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: PoolableInUse + - Name: k__BackingField + Entry: 7 + Data: 25|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Boolean, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 26|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 27|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 28|UnityEngine.HideInInspector, UnityEngine.CoreModule + - 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: Listeners + - Name: $v + Entry: 7 + Data: 29|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Listeners + - Name: k__BackingField + Entry: 7 + Data: 30|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.TlpBaseBehaviour[], TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: 31|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: UnityEngine.Component[], UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - 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: 32|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 33|UnityEngine.SerializeField, UnityEngine.CoreModule + - 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: RaiseOnEnable + - Name: $v + Entry: 7 + Data: 34|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: RaiseOnEnable + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 35|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: RaiseOnStart + - Name: $v + Entry: 7 + Data: 36|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: RaiseOnStart + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 37|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: ListenerMethod + - Name: $v + Entry: 7 + Data: 38|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: ListenerMethod + - Name: k__BackingField + Entry: 7 + Data: 39|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.String, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 39 + - 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: 40|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 41|UnityEngine.TooltipAttribute, UnityEngine.CoreModule + - Name: tooltip + Entry: 1 + Data: Name of the method to be called on each listener + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 42|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 43|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 44|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _nextInvocationFrame + - Name: $v + Entry: 7 + Data: 45|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _nextInvocationFrame + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 46|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _instigator + - Name: $v + Entry: 7 + Data: 47|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _instigator + - Name: k__BackingField + Entry: 9 + Data: 14 + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 48|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 49|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 50|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: diff --git a/Graphs/HorizontalLookAt.asset.meta b/Packages/tlp.udonutils/Runtime/Events/DirectInputEvent.asset.meta similarity index 79% rename from Graphs/HorizontalLookAt.asset.meta rename to Packages/tlp.udonutils/Runtime/Events/DirectInputEvent.asset.meta index d88da8f..cbd399b 100644 --- a/Graphs/HorizontalLookAt.asset.meta +++ b/Packages/tlp.udonutils/Runtime/Events/DirectInputEvent.asset.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 282ba712dfa27c246b44b2c9e30d749c +guid: 35313354a85954a4083bc4777e80dd0c NativeFormatImporter: externalObjects: {} mainObjectFileID: 11400000 diff --git a/Packages/tlp.udonutils/Runtime/Events/DirectInputEvent.cs b/Packages/tlp.udonutils/Runtime/Events/DirectInputEvent.cs new file mode 100644 index 0000000..97f4643 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Events/DirectInputEvent.cs @@ -0,0 +1,16 @@ +using JetBrains.Annotations; +using UdonSharp; +using UnityEngine; + +namespace TLP.UdonUtils.Events +{ + [DefaultExecutionOrder(ExecutionOrder)] + [UdonBehaviourSyncMode(BehaviourSyncMode.NoVariableSync)] + public class DirectInputEvent : UdonEvent + { + protected override int ExecutionOrderReadOnly => ExecutionOrder; + + [PublicAPI] + public new const int ExecutionOrder = TlpExecutionOrder.DirectInputStart; + } +} \ No newline at end of file diff --git a/Packages/tlp.udonutils/Runtime/Events/DirectInputEvent.cs.meta b/Packages/tlp.udonutils/Runtime/Events/DirectInputEvent.cs.meta new file mode 100644 index 0000000..bf9ead9 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Events/DirectInputEvent.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: b0340305c81c4a769edb673cb7fbaba1 +timeCreated: 1676120508 \ No newline at end of file diff --git a/Packages/tlp.udonutils/Runtime/Events/PlayerMotionEvent.asset b/Packages/tlp.udonutils/Runtime/Events/PlayerMotionEvent.asset new file mode 100644 index 0000000..defec71 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Events/PlayerMotionEvent.asset @@ -0,0 +1,854 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3} + m_Name: PlayerMotionEvent + m_EditorClassIdentifier: + serializedUdonProgramAsset: {fileID: 11400000, guid: b45fcf3e21d07614097b5e5d39c2e4b7, + type: 2} + udonAssembly: + assemblyError: + sourceCsScript: {fileID: 11500000, guid: 12863696f24240549d5d9aa0e7804501, type: 3} + scriptVersion: 2 + compiledVersion: 2 + behaviourSyncMode: 2 + hasInteractEvent: 0 + scriptID: -1217826581959681859 + serializationData: + SerializedFormat: 2 + SerializedBytes: + ReferencedUnityObjects: [] + SerializedBytesString: + Prefab: {fileID: 0} + PrefabModificationsReferencedUnityObjects: [] + PrefabModifications: [] + SerializationNodes: + - Name: fieldDefinitions + Entry: 7 + Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition, + UdonSharp.Editor]], mscorlib + - Name: comparer + Entry: 7 + Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String, + mscorlib]], mscorlib + - Name: + Entry: 8 + Data: + - Name: + Entry: 12 + Data: 14 + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: PendingSerializations + - Name: $v + Entry: 7 + Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: PendingSerializations + - Name: k__BackingField + Entry: 7 + Data: 3|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Int32, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 4|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: Severity + - Name: $v + Entry: 7 + Data: 5|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Severity + - Name: k__BackingField + Entry: 7 + Data: 6|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.Logger.ELogLevel, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: 7|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 8|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 9|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 7 + Data: 10|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.Logger.TlpLogger, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: 11|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: VRC.Udon.UdonBehaviour, VRC.Udon + - Name: + Entry: 8 + Data: + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 12|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: EventInstigator + - Name: $v + Entry: 7 + Data: 13|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: EventInstigator + - Name: k__BackingField + Entry: 7 + Data: 14|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.TlpBaseBehaviour, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: 15|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 3 + - Name: + Entry: 7 + Data: 16|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 17|UnityEngine.HideInInspector, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 18|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - 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: Pool + - Name: $v + Entry: 7 + Data: 19|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Pool + - Name: k__BackingField + Entry: 9 + Data: 14 + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: 20|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 3 + - Name: + Entry: 7 + Data: 21|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 22|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 23|UnityEngine.HideInInspector, UnityEngine.CoreModule + - 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: PoolableInUse + - Name: $v + Entry: 7 + Data: 24|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: PoolableInUse + - Name: k__BackingField + Entry: 7 + Data: 25|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Boolean, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 26|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 27|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 28|UnityEngine.HideInInspector, UnityEngine.CoreModule + - 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: Listeners + - Name: $v + Entry: 7 + Data: 29|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Listeners + - Name: k__BackingField + Entry: 7 + Data: 30|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.TlpBaseBehaviour[], TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: 31|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: UnityEngine.Component[], UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - 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: 32|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 33|UnityEngine.SerializeField, UnityEngine.CoreModule + - 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: RaiseOnEnable + - Name: $v + Entry: 7 + Data: 34|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: RaiseOnEnable + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 35|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: RaiseOnStart + - Name: $v + Entry: 7 + Data: 36|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: RaiseOnStart + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 37|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: ListenerMethod + - Name: $v + Entry: 7 + Data: 38|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: ListenerMethod + - Name: k__BackingField + Entry: 7 + Data: 39|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.String, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 39 + - 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: 40|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 41|UnityEngine.TooltipAttribute, UnityEngine.CoreModule + - Name: tooltip + Entry: 1 + Data: Name of the method to be called on each listener + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 42|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 43|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 44|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _nextInvocationFrame + - Name: $v + Entry: 7 + Data: 45|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _nextInvocationFrame + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 46|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _instigator + - Name: $v + Entry: 7 + Data: 47|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _instigator + - Name: k__BackingField + Entry: 9 + Data: 14 + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 48|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 49|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 50|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: diff --git a/Scripts/Common/Networking/OwnershipTransfer.asset.meta b/Packages/tlp.udonutils/Runtime/Events/PlayerMotionEvent.asset.meta similarity index 79% rename from Scripts/Common/Networking/OwnershipTransfer.asset.meta rename to Packages/tlp.udonutils/Runtime/Events/PlayerMotionEvent.asset.meta index 5b36522..e384ef7 100644 --- a/Scripts/Common/Networking/OwnershipTransfer.asset.meta +++ b/Packages/tlp.udonutils/Runtime/Events/PlayerMotionEvent.asset.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 777efcf936ab8264b9f792163a8f4ae2 +guid: 77f0a9070ef006445a3d34af59f949d2 NativeFormatImporter: externalObjects: {} mainObjectFileID: 11400000 diff --git a/Packages/tlp.udonutils/Runtime/Events/PlayerMotionEvent.cs b/Packages/tlp.udonutils/Runtime/Events/PlayerMotionEvent.cs new file mode 100644 index 0000000..938b022 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Events/PlayerMotionEvent.cs @@ -0,0 +1,16 @@ +using JetBrains.Annotations; +using UdonSharp; +using UnityEngine; + +namespace TLP.UdonUtils.Events +{ + [DefaultExecutionOrder(ExecutionOrder)] + [UdonBehaviourSyncMode(BehaviourSyncMode.NoVariableSync)] + public class PlayerMotionEvent : UdonEvent + { + protected override int ExecutionOrderReadOnly => ExecutionOrder; + + [PublicAPI] + public new const int ExecutionOrder = TlpExecutionOrder.PlayerMotionStart; + } +} \ No newline at end of file diff --git a/Packages/tlp.udonutils/Runtime/Events/PlayerMotionEvent.cs.meta b/Packages/tlp.udonutils/Runtime/Events/PlayerMotionEvent.cs.meta new file mode 100644 index 0000000..a1e6c6c --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Events/PlayerMotionEvent.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 12863696f24240549d5d9aa0e7804501 +timeCreated: 1676120618 \ No newline at end of file diff --git a/Packages/tlp.udonutils/Runtime/Events/UdonEvent.asset b/Packages/tlp.udonutils/Runtime/Events/UdonEvent.asset new file mode 100644 index 0000000..902db8a --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Events/UdonEvent.asset @@ -0,0 +1,854 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3} + m_Name: UdonEvent + m_EditorClassIdentifier: + serializedUdonProgramAsset: {fileID: 11400000, guid: 799d304f73339ae4ebb54df7ed21e3cc, + type: 2} + udonAssembly: + assemblyError: + sourceCsScript: {fileID: 11500000, guid: 608eb99ef5083ce43b025599a42d51da, type: 3} + scriptVersion: 2 + compiledVersion: 2 + behaviourSyncMode: 2 + hasInteractEvent: 0 + scriptID: -2706485587733231622 + serializationData: + SerializedFormat: 2 + SerializedBytes: + ReferencedUnityObjects: [] + SerializedBytesString: + Prefab: {fileID: 0} + PrefabModificationsReferencedUnityObjects: [] + PrefabModifications: [] + SerializationNodes: + - Name: fieldDefinitions + Entry: 7 + Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition, + UdonSharp.Editor]], mscorlib + - Name: comparer + Entry: 7 + Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String, + mscorlib]], mscorlib + - Name: + Entry: 8 + Data: + - Name: + Entry: 12 + Data: 14 + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: PendingSerializations + - Name: $v + Entry: 7 + Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: PendingSerializations + - Name: k__BackingField + Entry: 7 + Data: 3|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Int32, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 4|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: Severity + - Name: $v + Entry: 7 + Data: 5|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Severity + - Name: k__BackingField + Entry: 7 + Data: 6|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.Logger.ELogLevel, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: 7|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 8|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 9|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 7 + Data: 10|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.Logger.TlpLogger, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: 11|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: VRC.Udon.UdonBehaviour, VRC.Udon + - Name: + Entry: 8 + Data: + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 12|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: EventInstigator + - Name: $v + Entry: 7 + Data: 13|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: EventInstigator + - Name: k__BackingField + Entry: 7 + Data: 14|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.TlpBaseBehaviour, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: 15|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 3 + - Name: + Entry: 7 + Data: 16|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 17|UnityEngine.HideInInspector, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 18|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - 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: Pool + - Name: $v + Entry: 7 + Data: 19|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Pool + - Name: k__BackingField + Entry: 9 + Data: 14 + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: 20|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 3 + - Name: + Entry: 7 + Data: 21|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 22|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 23|UnityEngine.HideInInspector, UnityEngine.CoreModule + - 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: PoolableInUse + - Name: $v + Entry: 7 + Data: 24|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: PoolableInUse + - Name: k__BackingField + Entry: 7 + Data: 25|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Boolean, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 26|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 27|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 28|UnityEngine.HideInInspector, UnityEngine.CoreModule + - 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: Listeners + - Name: $v + Entry: 7 + Data: 29|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Listeners + - Name: k__BackingField + Entry: 7 + Data: 30|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.TlpBaseBehaviour[], TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: 31|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: UnityEngine.Component[], UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - 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: 32|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 33|UnityEngine.SerializeField, UnityEngine.CoreModule + - 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: RaiseOnEnable + - Name: $v + Entry: 7 + Data: 34|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: RaiseOnEnable + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 35|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: RaiseOnStart + - Name: $v + Entry: 7 + Data: 36|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: RaiseOnStart + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 37|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: ListenerMethod + - Name: $v + Entry: 7 + Data: 38|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: ListenerMethod + - Name: k__BackingField + Entry: 7 + Data: 39|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.String, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 39 + - 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: 40|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 41|UnityEngine.TooltipAttribute, UnityEngine.CoreModule + - Name: tooltip + Entry: 1 + Data: Name of the method to be called on each listener + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 42|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 43|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 44|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _nextInvocationFrame + - Name: $v + Entry: 7 + Data: 45|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _nextInvocationFrame + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 46|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _instigator + - Name: $v + Entry: 7 + Data: 47|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _instigator + - Name: k__BackingField + Entry: 9 + Data: 14 + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 48|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 49|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 50|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: diff --git a/Packages/tlp.udonutils/Runtime/Events/UdonEvent.asset.meta b/Packages/tlp.udonutils/Runtime/Events/UdonEvent.asset.meta new file mode 100644 index 0000000..a86498e --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Events/UdonEvent.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b0c348d7e8db140419f38778a94f3f80 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/tlp.udonutils/Runtime/Events/UdonEvent.cs b/Packages/tlp.udonutils/Runtime/Events/UdonEvent.cs new file mode 100644 index 0000000..27de69b --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Events/UdonEvent.cs @@ -0,0 +1,396 @@ +using System; +using JetBrains.Annotations; +using UdonSharp; +using UnityEngine; +using VRC.SDKBase; +using VRC.Udon.Common.Enums; + +namespace TLP.UdonUtils.Events +{ + [DefaultExecutionOrder(ExecutionOrder)] + [UdonBehaviourSyncMode(BehaviourSyncMode.NoVariableSync)] + public class UdonEvent : TlpBaseBehaviour + { + protected override int ExecutionOrderReadOnly => ExecutionOrder; + + [PublicAPI] + public new const int ExecutionOrder = TlpExecutionOrder.DefaultStart + 1; + + private const int InvalidInvocationFrame = -1; + private const int InvalidIndex = -1; + + [SerializeField] + internal TlpBaseBehaviour[] Listeners = { }; + + public bool RaiseOnEnable; + public bool RaiseOnStart; + + [Tooltip("Name of the method to be called on each listener")] + [PublicAPI] + public string ListenerMethod = "OnRaised"; + + public TlpBaseBehaviour[] ListenersReadOnly => Listeners == null + ? new TlpBaseBehaviour[0] + : (TlpBaseBehaviour[])Listeners.Clone(); + + public int ListenerCount { get; internal set; } + + private int _nextInvocationFrame; + internal TlpBaseBehaviour _instigator; + + #region Unity Lifecycle + + public void OnEnable() + { + #region TLP_DEBUG + +#if TLP_DEBUG + DebugLog(nameof(OnEnable)); +#endif + + #endregion + + if (RaiseOnEnable) + { + Raise(this); + } + } + + public void Start() + { + #region TLP_DEBUG + +#if TLP_DEBUG + DebugLog(nameof(Start)); +#endif + + #endregion + + if (RaiseOnStart) + { + Raise(this); + } + } + + #endregion + + #region Public API + + /// + /// Removes the first found entry + /// + /// must be valid + /// true if the listener is valid and was listening + [PublicAPI] + public bool RemoveListener(TlpBaseBehaviour listener, bool all = false) + { + #region TLP_DEBUG + +#if TLP_DEBUG + DebugLog(nameof(RemoveListener)); +#endif + + #endregion + + if (!Utilities.IsValid(listener)) + { + return false; + } + + ListenerCount = Consolidate(Listeners, ListenerCount); + int found = 0; + for (int i = 0; i < ListenerCount; i++) + { + if (Listeners[i] != listener) + { + continue; + } + + Listeners[i] = null; + ListenerCount = Consolidate(Listeners, ListenerCount); + + if (!all) + { + return true; + } + + ++found; + } + + return found > 0; + } + + /// + /// Calls the method specified by on each valid listener. + /// + /// Note: listeners are notified in the order they are added. + /// + [PublicAPI] + [RecursiveMethod] + public virtual bool Raise(TlpBaseBehaviour instigator) + { + #region TLP_DEBUG + +#if TLP_DEBUG + DebugLog($"{nameof(Raise)} '{ListenerMethod}'"); +#endif + + #endregion + + if (!Utilities.IsValid(instigator)) + { + Error("instigator must be valid"); + return false; + } + + if (string.IsNullOrWhiteSpace(ListenerMethod)) + { + Warn($"{nameof(ListenerMethod)} is empty, event {name} will not be raised"); + return false; + } + + _instigator = instigator; + IsPendingInvocation = false; + + foreach (var listener in Listeners) + { + if (!Utilities.IsValid(listener)) + { + continue; + } + + listener.EventInstigator = instigator; + listener.OnEvent(ListenerMethod); + } + + return true; + } + + /// + /// Use this when calling from e.g. an Unity UI event like Button or Scroll-rect + /// + [PublicAPI] + public void RaiseExtern() + { + #region TLP_DEBUG + +#if TLP_DEBUG + DebugLog(nameof(RaiseExtern)); +#endif + + #endregion + + Raise(this); + } + + /// + /// DON'T use directly, use instead + /// + public void InternalOnIdle() + { + #region TLP_DEBUG + +#if TLP_DEBUG + DebugLog(nameof(InternalOnIdle)); +#endif + + #endregion + + if (!IsPendingInvocation) + { + #region TLP_DEBUG + +#if TLP_DEBUG + DebugLog("already executed, skipping"); +#endif + + #endregion + return; + } + + if (!Raise(_instigator)) + { + Error($"{nameof(InternalOnIdle)}: failed to raise '{ListenerMethod}'"); + } + } + + /// + /// Clears the listeners list by resetting the count making it effectively contain no entries + /// + [PublicAPI] + public void RemoveAllListeners() + { + #region TLP_DEBUG + +#if TLP_DEBUG + DebugLog(nameof(RemoveAllListeners)); +#endif + + #endregion + + ListenerCount = 0; + } + + /// + /// Does not care about duplicates! + /// + /// must be valid + /// name of the function used as callback, used only to check correct connection + [PublicAPI] + public bool AddListenerVerified(TlpBaseBehaviour listener, string callbackName) + { + #region TLP_DEBUG + +#if TLP_DEBUG + DebugLog($"{nameof(AddListenerVerified)} '{callbackName}'"); + +#endif + + #endregion + + if (callbackName == ListenerMethod) + { + return AddListener(listener); + } + + Error( + $"{nameof(AddListenerVerified)}: callback name mismatch, expected '{ListenerMethod}' but received '{callbackName}'" + ); + return false; + } + + [PublicAPI] + public bool IsPendingInvocation { get; internal set; } + + /// + /// raises the event after the number of frames, unless the event was raised before by another source. + /// + /// + /// 0 and 1 are equivalent and will perform execution on the next update + /// + [PublicAPI] + public virtual bool RaiseOnIdle( + TlpBaseBehaviour instigator, + int idleFrames = 1, + EventTiming eventTiming = EventTiming.Update + ) + { + #region TLP_DEBUG + +#if TLP_DEBUG + DebugLog($"{nameof(RaiseOnIdle)} after {idleFrames} frames"); +#endif + + #endregion + + + if (idleFrames < 1) + { + Error($"{nameof(idleFrames)} must be at least 1 but was {idleFrames}"); + return false; + } + + if (!Utilities.IsValid(instigator)) + { + Error("instigator must be valid"); + return false; + } + + _instigator = instigator; + int newPendingInvocation = Time.frameCount + idleFrames; + if (Time.frameCount < _nextInvocationFrame && IsPendingInvocation && + newPendingInvocation >= _nextInvocationFrame) + { + #region TLP_DEBUG + +#if TLP_DEBUG + DebugLog($"Already pending raise of '{ListenerMethod}'"); + +#endif + + #endregion + return true; + } + + _nextInvocationFrame = newPendingInvocation; + IsPendingInvocation = true; + SendCustomEventDelayedFrames(nameof(InternalOnIdle), idleFrames, eventTiming); + return true; + } + + [PublicAPI] + public int NextInvocationFrame => IsPendingInvocation ? _nextInvocationFrame : InvalidInvocationFrame; + + #endregion + + #region Internal + + private bool AddListener(TlpBaseBehaviour listener) + { +#if TLP_DEBUG + DebugLog(nameof(AddListener)); +#endif + if (!Utilities.IsValid(listener)) + { + return false; + } + + if (Listeners == null) + { + Listeners = new TlpBaseBehaviour[1]; + } + else if (ListenerCount >= Listeners.Length) + { + var tmp = new TlpBaseBehaviour[ListenerCount + 1]; + Listeners.CopyTo(tmp, 0); + Listeners = tmp; + } + + Listeners[ListenerCount] = listener; + + ++ListenerCount; + return true; + } + + + private static int Consolidate(TlpBaseBehaviour[] list, int elements) + { + if (list == null) + { + return 0; + } + + int end = Mathf.Min(elements, list.Length); + int valid = 0; + int moveIndex = InvalidIndex; + for (int i = 0; i < end; i++) + { + if (Utilities.IsValid(list[i])) + { + ++valid; + if (moveIndex == InvalidIndex) + { + continue; + } + + list[moveIndex] = list[i]; + list[i] = null; + ++moveIndex; + } + else + { + // ensure that the entry no longer references an invalid object + list[i] = null; + if (moveIndex == InvalidIndex) + { + moveIndex = i; + } + } + } + + return valid; + } + + #endregion + } +} \ No newline at end of file diff --git a/Scripts/Common/HorizontalLookAt.cs.meta b/Packages/tlp.udonutils/Runtime/Events/UdonEvent.cs.meta similarity index 83% rename from Scripts/Common/HorizontalLookAt.cs.meta rename to Packages/tlp.udonutils/Runtime/Events/UdonEvent.cs.meta index eecf814..6815d81 100644 --- a/Scripts/Common/HorizontalLookAt.cs.meta +++ b/Packages/tlp.udonutils/Runtime/Events/UdonEvent.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 9e7f888abcc6fe842a80cb1fa38f96a3 +guid: 608eb99ef5083ce43b025599a42d51da MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Packages/tlp.udonutils/Runtime/Events/UiEvent.asset b/Packages/tlp.udonutils/Runtime/Events/UiEvent.asset new file mode 100644 index 0000000..214cc98 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Events/UiEvent.asset @@ -0,0 +1,854 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3} + m_Name: UiEvent + m_EditorClassIdentifier: + serializedUdonProgramAsset: {fileID: 11400000, guid: 24c937b24b4f3e24991409d1b945de16, + type: 2} + udonAssembly: + assemblyError: + sourceCsScript: {fileID: 11500000, guid: f95147634bfd42ba8c41c9183e88e2bf, type: 3} + scriptVersion: 2 + compiledVersion: 2 + behaviourSyncMode: 2 + hasInteractEvent: 0 + scriptID: -7350555452572834290 + serializationData: + SerializedFormat: 2 + SerializedBytes: + ReferencedUnityObjects: [] + SerializedBytesString: + Prefab: {fileID: 0} + PrefabModificationsReferencedUnityObjects: [] + PrefabModifications: [] + SerializationNodes: + - Name: fieldDefinitions + Entry: 7 + Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition, + UdonSharp.Editor]], mscorlib + - Name: comparer + Entry: 7 + Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String, + mscorlib]], mscorlib + - Name: + Entry: 8 + Data: + - Name: + Entry: 12 + Data: 14 + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: PendingSerializations + - Name: $v + Entry: 7 + Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: PendingSerializations + - Name: k__BackingField + Entry: 7 + Data: 3|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Int32, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 4|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: Severity + - Name: $v + Entry: 7 + Data: 5|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Severity + - Name: k__BackingField + Entry: 7 + Data: 6|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.Logger.ELogLevel, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: 7|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 8|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 9|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 7 + Data: 10|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.Logger.TlpLogger, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: 11|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: VRC.Udon.UdonBehaviour, VRC.Udon + - Name: + Entry: 8 + Data: + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 12|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: EventInstigator + - Name: $v + Entry: 7 + Data: 13|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: EventInstigator + - Name: k__BackingField + Entry: 7 + Data: 14|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.TlpBaseBehaviour, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: 15|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 3 + - Name: + Entry: 7 + Data: 16|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 17|UnityEngine.HideInInspector, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 18|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - 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: Pool + - Name: $v + Entry: 7 + Data: 19|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Pool + - Name: k__BackingField + Entry: 9 + Data: 14 + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: 20|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 3 + - Name: + Entry: 7 + Data: 21|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 22|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 23|UnityEngine.HideInInspector, UnityEngine.CoreModule + - 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: PoolableInUse + - Name: $v + Entry: 7 + Data: 24|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: PoolableInUse + - Name: k__BackingField + Entry: 7 + Data: 25|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Boolean, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 26|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 27|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 28|UnityEngine.HideInInspector, UnityEngine.CoreModule + - 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: Listeners + - Name: $v + Entry: 7 + Data: 29|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Listeners + - Name: k__BackingField + Entry: 7 + Data: 30|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.TlpBaseBehaviour[], TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: 31|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: UnityEngine.Component[], UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - 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: 32|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 33|UnityEngine.SerializeField, UnityEngine.CoreModule + - 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: RaiseOnEnable + - Name: $v + Entry: 7 + Data: 34|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: RaiseOnEnable + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 35|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: RaiseOnStart + - Name: $v + Entry: 7 + Data: 36|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: RaiseOnStart + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 37|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: ListenerMethod + - Name: $v + Entry: 7 + Data: 38|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: ListenerMethod + - Name: k__BackingField + Entry: 7 + Data: 39|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.String, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 39 + - 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: 40|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 41|UnityEngine.TooltipAttribute, UnityEngine.CoreModule + - Name: tooltip + Entry: 1 + Data: Name of the method to be called on each listener + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 42|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 43|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 44|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _nextInvocationFrame + - Name: $v + Entry: 7 + Data: 45|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _nextInvocationFrame + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 46|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _instigator + - Name: $v + Entry: 7 + Data: 47|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _instigator + - Name: k__BackingField + Entry: 9 + Data: 14 + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 48|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 49|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 50|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: diff --git a/Packages/tlp.udonutils/Runtime/Events/UiEvent.asset.meta b/Packages/tlp.udonutils/Runtime/Events/UiEvent.asset.meta new file mode 100644 index 0000000..3bf2f43 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Events/UiEvent.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b941450eb7d36be4ea69809a170ae6fa +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/tlp.udonutils/Runtime/Events/UiEvent.cs b/Packages/tlp.udonutils/Runtime/Events/UiEvent.cs new file mode 100644 index 0000000..5a96106 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Events/UiEvent.cs @@ -0,0 +1,11 @@ +using UdonSharp; +using UnityEngine; + +namespace TLP.UdonUtils.Events +{ + [DefaultExecutionOrder(ExecutionOrder)] + [UdonBehaviourSyncMode(BehaviourSyncMode.NoVariableSync)] + public class UiEvent : UdonEvent + { + } +} \ No newline at end of file diff --git a/Packages/tlp.udonutils/Runtime/Events/UiEvent.cs.meta b/Packages/tlp.udonutils/Runtime/Events/UiEvent.cs.meta new file mode 100644 index 0000000..ae81216 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Events/UiEvent.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f95147634bfd42ba8c41c9183e88e2bf +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/tlp.udonutils/Runtime/Events/VehicleMotionEvent.asset b/Packages/tlp.udonutils/Runtime/Events/VehicleMotionEvent.asset new file mode 100644 index 0000000..5cda4cf --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Events/VehicleMotionEvent.asset @@ -0,0 +1,854 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3} + m_Name: VehicleMotionEvent + m_EditorClassIdentifier: + serializedUdonProgramAsset: {fileID: 11400000, guid: d12c22e78db9cb04584ea324557303ec, + type: 2} + udonAssembly: + assemblyError: + sourceCsScript: {fileID: 11500000, guid: 514a6d3e1bc446b8832ecbe3a3ba05b5, type: 3} + scriptVersion: 2 + compiledVersion: 2 + behaviourSyncMode: 2 + hasInteractEvent: 0 + scriptID: 1802943170604745365 + serializationData: + SerializedFormat: 2 + SerializedBytes: + ReferencedUnityObjects: [] + SerializedBytesString: + Prefab: {fileID: 0} + PrefabModificationsReferencedUnityObjects: [] + PrefabModifications: [] + SerializationNodes: + - Name: fieldDefinitions + Entry: 7 + Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition, + UdonSharp.Editor]], mscorlib + - Name: comparer + Entry: 7 + Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String, + mscorlib]], mscorlib + - Name: + Entry: 8 + Data: + - Name: + Entry: 12 + Data: 14 + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: PendingSerializations + - Name: $v + Entry: 7 + Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: PendingSerializations + - Name: k__BackingField + Entry: 7 + Data: 3|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Int32, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 4|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: Severity + - Name: $v + Entry: 7 + Data: 5|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Severity + - Name: k__BackingField + Entry: 7 + Data: 6|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.Logger.ELogLevel, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: 7|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 8|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 9|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 7 + Data: 10|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.Logger.TlpLogger, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: 11|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: VRC.Udon.UdonBehaviour, VRC.Udon + - Name: + Entry: 8 + Data: + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 12|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: EventInstigator + - Name: $v + Entry: 7 + Data: 13|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: EventInstigator + - Name: k__BackingField + Entry: 7 + Data: 14|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.TlpBaseBehaviour, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: 15|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 3 + - Name: + Entry: 7 + Data: 16|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 17|UnityEngine.HideInInspector, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 18|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - 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: Pool + - Name: $v + Entry: 7 + Data: 19|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Pool + - Name: k__BackingField + Entry: 9 + Data: 14 + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: 20|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 3 + - Name: + Entry: 7 + Data: 21|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 22|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 23|UnityEngine.HideInInspector, UnityEngine.CoreModule + - 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: PoolableInUse + - Name: $v + Entry: 7 + Data: 24|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: PoolableInUse + - Name: k__BackingField + Entry: 7 + Data: 25|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Boolean, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 26|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 27|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 28|UnityEngine.HideInInspector, UnityEngine.CoreModule + - 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: Listeners + - Name: $v + Entry: 7 + Data: 29|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Listeners + - Name: k__BackingField + Entry: 7 + Data: 30|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.TlpBaseBehaviour[], TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: 31|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: UnityEngine.Component[], UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - 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: 32|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 33|UnityEngine.SerializeField, UnityEngine.CoreModule + - 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: RaiseOnEnable + - Name: $v + Entry: 7 + Data: 34|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: RaiseOnEnable + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 35|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: RaiseOnStart + - Name: $v + Entry: 7 + Data: 36|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: RaiseOnStart + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 37|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: ListenerMethod + - Name: $v + Entry: 7 + Data: 38|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: ListenerMethod + - Name: k__BackingField + Entry: 7 + Data: 39|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.String, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 39 + - 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: 40|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 41|UnityEngine.TooltipAttribute, UnityEngine.CoreModule + - Name: tooltip + Entry: 1 + Data: Name of the method to be called on each listener + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 42|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 43|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 44|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _nextInvocationFrame + - Name: $v + Entry: 7 + Data: 45|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _nextInvocationFrame + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 46|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _instigator + - Name: $v + Entry: 7 + Data: 47|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _instigator + - Name: k__BackingField + Entry: 9 + Data: 14 + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 48|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 49|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 50|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: diff --git a/Packages/tlp.udonutils/Runtime/Events/VehicleMotionEvent.asset.meta b/Packages/tlp.udonutils/Runtime/Events/VehicleMotionEvent.asset.meta new file mode 100644 index 0000000..4dbfac1 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Events/VehicleMotionEvent.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7542269b29ccb314cb24b62fc63c7ea2 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/tlp.udonutils/Runtime/Events/VehicleMotionEvent.cs b/Packages/tlp.udonutils/Runtime/Events/VehicleMotionEvent.cs new file mode 100644 index 0000000..c3df55b --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Events/VehicleMotionEvent.cs @@ -0,0 +1,16 @@ +using JetBrains.Annotations; +using UdonSharp; +using UnityEngine; + +namespace TLP.UdonUtils.Events +{ + [DefaultExecutionOrder(ExecutionOrder)] + [UdonBehaviourSyncMode(BehaviourSyncMode.NoVariableSync)] + public class VehicleMotionEvent : UdonEvent + { + protected override int ExecutionOrderReadOnly => ExecutionOrder; + + [PublicAPI] + public new const int ExecutionOrder = TlpExecutionOrder.VehicleMotionStart; + } +} \ No newline at end of file diff --git a/Packages/tlp.udonutils/Runtime/Events/VehicleMotionEvent.cs.meta b/Packages/tlp.udonutils/Runtime/Events/VehicleMotionEvent.cs.meta new file mode 100644 index 0000000..15ae501 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Events/VehicleMotionEvent.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 514a6d3e1bc446b8832ecbe3a3ba05b5 +timeCreated: 1676120572 \ No newline at end of file diff --git a/Packages/tlp.udonutils/Runtime/Events/WeaponEvent.asset b/Packages/tlp.udonutils/Runtime/Events/WeaponEvent.asset new file mode 100644 index 0000000..f81efdc --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Events/WeaponEvent.asset @@ -0,0 +1,854 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3} + m_Name: WeaponEvent + m_EditorClassIdentifier: + serializedUdonProgramAsset: {fileID: 11400000, guid: fda6a60cbacd6fe49ac531a8c75fdc6c, + type: 2} + udonAssembly: + assemblyError: + sourceCsScript: {fileID: 11500000, guid: 330623feb7794f379ab6158daf09ec0e, type: 3} + scriptVersion: 2 + compiledVersion: 2 + behaviourSyncMode: 2 + hasInteractEvent: 0 + scriptID: 4477138070749166299 + serializationData: + SerializedFormat: 2 + SerializedBytes: + ReferencedUnityObjects: [] + SerializedBytesString: + Prefab: {fileID: 0} + PrefabModificationsReferencedUnityObjects: [] + PrefabModifications: [] + SerializationNodes: + - Name: fieldDefinitions + Entry: 7 + Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition, + UdonSharp.Editor]], mscorlib + - Name: comparer + Entry: 7 + Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String, + mscorlib]], mscorlib + - Name: + Entry: 8 + Data: + - Name: + Entry: 12 + Data: 14 + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: PendingSerializations + - Name: $v + Entry: 7 + Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: PendingSerializations + - Name: k__BackingField + Entry: 7 + Data: 3|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Int32, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 4|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: Severity + - Name: $v + Entry: 7 + Data: 5|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Severity + - Name: k__BackingField + Entry: 7 + Data: 6|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.Logger.ELogLevel, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: 7|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 8|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 9|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 7 + Data: 10|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.Logger.TlpLogger, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: 11|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: VRC.Udon.UdonBehaviour, VRC.Udon + - Name: + Entry: 8 + Data: + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 12|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: EventInstigator + - Name: $v + Entry: 7 + Data: 13|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: EventInstigator + - Name: k__BackingField + Entry: 7 + Data: 14|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.TlpBaseBehaviour, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: 15|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 3 + - Name: + Entry: 7 + Data: 16|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 17|UnityEngine.HideInInspector, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 18|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - 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: Pool + - Name: $v + Entry: 7 + Data: 19|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Pool + - Name: k__BackingField + Entry: 9 + Data: 14 + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: 20|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 3 + - Name: + Entry: 7 + Data: 21|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 22|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 23|UnityEngine.HideInInspector, UnityEngine.CoreModule + - 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: PoolableInUse + - Name: $v + Entry: 7 + Data: 24|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: PoolableInUse + - Name: k__BackingField + Entry: 7 + Data: 25|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Boolean, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 26|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 27|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 28|UnityEngine.HideInInspector, UnityEngine.CoreModule + - 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: Listeners + - Name: $v + Entry: 7 + Data: 29|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Listeners + - Name: k__BackingField + Entry: 7 + Data: 30|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.TlpBaseBehaviour[], TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: 31|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: UnityEngine.Component[], UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - 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: 32|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 33|UnityEngine.SerializeField, UnityEngine.CoreModule + - 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: RaiseOnEnable + - Name: $v + Entry: 7 + Data: 34|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: RaiseOnEnable + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 35|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: RaiseOnStart + - Name: $v + Entry: 7 + Data: 36|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: RaiseOnStart + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 37|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: ListenerMethod + - Name: $v + Entry: 7 + Data: 38|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: ListenerMethod + - Name: k__BackingField + Entry: 7 + Data: 39|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.String, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 39 + - 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: 40|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 41|UnityEngine.TooltipAttribute, UnityEngine.CoreModule + - Name: tooltip + Entry: 1 + Data: Name of the method to be called on each listener + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 42|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 43|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 44|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _nextInvocationFrame + - Name: $v + Entry: 7 + Data: 45|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _nextInvocationFrame + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 46|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _instigator + - Name: $v + Entry: 7 + Data: 47|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _instigator + - Name: k__BackingField + Entry: 9 + Data: 14 + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 48|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 49|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 50|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: diff --git a/Packages/tlp.udonutils/Runtime/Events/WeaponEvent.asset.meta b/Packages/tlp.udonutils/Runtime/Events/WeaponEvent.asset.meta new file mode 100644 index 0000000..c724550 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Events/WeaponEvent.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b021668771c272d42ba5d5ed5a358b19 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/tlp.udonutils/Runtime/Events/WeaponsEvent.cs b/Packages/tlp.udonutils/Runtime/Events/WeaponsEvent.cs new file mode 100644 index 0000000..e091f78 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Events/WeaponsEvent.cs @@ -0,0 +1,16 @@ +using JetBrains.Annotations; +using UdonSharp; +using UnityEngine; + +namespace TLP.UdonUtils.Events +{ + [DefaultExecutionOrder(ExecutionOrder)] + [UdonBehaviourSyncMode(BehaviourSyncMode.NoVariableSync)] + public class WeaponsEvent : UdonEvent + { + protected override int ExecutionOrderReadOnly => ExecutionOrder; + + [PublicAPI] + public new const int ExecutionOrder = TlpExecutionOrder.WeaponsStart; + } +} \ No newline at end of file diff --git a/Packages/tlp.udonutils/Runtime/Events/WeaponsEvent.cs.meta b/Packages/tlp.udonutils/Runtime/Events/WeaponsEvent.cs.meta new file mode 100644 index 0000000..a11d8fc --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Events/WeaponsEvent.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 330623feb7794f379ab6158daf09ec0e +timeCreated: 1676120635 \ No newline at end of file diff --git a/Packages/tlp.udonutils/Runtime/Extensions.meta b/Packages/tlp.udonutils/Runtime/Extensions.meta new file mode 100644 index 0000000..7aed472 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Extensions.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9fb6d6a83bc4d0345a617cb3ce045813 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/tlp.udonutils/Runtime/Extensions/ArrayUtils.cs b/Packages/tlp.udonutils/Runtime/Extensions/ArrayUtils.cs new file mode 100644 index 0000000..dffccf5 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Extensions/ArrayUtils.cs @@ -0,0 +1,85 @@ +using System; + +namespace TLP.UdonUtils.Extensions +{ + public static class ArrayUtils + { + /// + /// + /// + /// + /// + /// if true will ensure that the array is empty + /// + /// + public static T[] ResizeOrCreate(this T[] original, int newSize, bool clear = false) + { + if (original == null) + { + return new T[newSize]; + } + + if (newSize < 0) + { + return new T[0]; + } + + if (original.Length == newSize) + { + if (clear) + { + for (int i = 0; i < original.Length; i++) + { + original[i] = default; + } + } + + return original; + } + + var newArray = new T[newSize]; + int length = original.Length <= newSize ? original.Length : newSize; + if (!clear) + { + Array.Copy(original, newArray, length); + } + + return newArray; + } + + public static T[] IncreaseSizeBy(this T[] original, int additional) + { + return original.ResizeOrCreate(original == null ? additional : original.Length + additional); + } + + public static T[] Append(this T[] original, T value) + { + var copy = original.IncreaseSizeBy(1); + copy[copy.Length - 1] = value; + return copy; + } + + public static bool IsNullOrEmpty(this T[] array) + { + return array == null || array.Length == 0; + } + + public static int LengthSafe(this T[] array) + { + return array == null ? 0 : array.Length; + } + + public static T[] CreateCopy(this T[] source, T[] destination) + { + int lengthSafe = source.LengthSafe(); + if (lengthSafe < 1) + { + return source == null ? new T[0] : destination.ResizeOrCreate(0); + } + + destination = destination.ResizeOrCreate(lengthSafe); + Array.Copy(source, destination, lengthSafe); + return destination; + } + } +} \ No newline at end of file diff --git a/Packages/tlp.udonutils/Runtime/Extensions/ArrayUtils.cs.meta b/Packages/tlp.udonutils/Runtime/Extensions/ArrayUtils.cs.meta new file mode 100644 index 0000000..77fc499 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Extensions/ArrayUtils.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: b1de8a6445874e1e94d3a55301625010 +timeCreated: 1676714964 \ No newline at end of file diff --git a/Packages/tlp.udonutils/Runtime/Extensions/IntegerUtils.cs b/Packages/tlp.udonutils/Runtime/Extensions/IntegerUtils.cs new file mode 100644 index 0000000..e0ec905 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Extensions/IntegerUtils.cs @@ -0,0 +1,43 @@ +using JetBrains.Annotations; + +namespace TLP.UdonUtils.Extensions +{ + public static class IntegerUtils + { + /// + /// Decrements the value in-place, result range is 0 to maxValue - 1 + /// + /// value to decrement in-place, expected to be positive + /// expected to be greater than zero + /// expected to be positive, may be larger than maxValue + [PublicAPI] + public static void MoveIndexLeftLooping(ref this int value, int maxValue, int decrement = 1) + { + value = (maxValue + value - decrement % maxValue) % maxValue; + } + + [PublicAPI] + public static int SubtractLooping(this int value, int maxValue, int decrement = 1) + { + return (maxValue + value - decrement % maxValue) % maxValue; + } + + /// + /// Increments the value in-place, result range is 0 to maxValue - 1 + /// + /// value to decrement in-place, expected to be positive + /// expected to be greater than zero + /// expected to be positive, may be larger than maxValue + [PublicAPI] + public static void MoveIndexRightLooping(ref this int value, int maxValue, int increment = 1) + { + value = (value + increment) % maxValue; + } + + [PublicAPI] + public static int AddLooping(this int value, int maxValue, int increment = 1) + { + return (value + increment) % maxValue; + } + } +} \ No newline at end of file diff --git a/Packages/tlp.udonutils/Runtime/Extensions/IntegerUtils.cs.meta b/Packages/tlp.udonutils/Runtime/Extensions/IntegerUtils.cs.meta new file mode 100644 index 0000000..e025e68 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Extensions/IntegerUtils.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: f05613c1f7194ebe9ee045d33f49027e +timeCreated: 1675006894 \ No newline at end of file diff --git a/Packages/tlp.udonutils/Runtime/Extensions/NetworkUtils.cs b/Packages/tlp.udonutils/Runtime/Extensions/NetworkUtils.cs new file mode 100644 index 0000000..c831f6f --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Extensions/NetworkUtils.cs @@ -0,0 +1,17 @@ +using VRC.Udon.Common; + +namespace TLP.UdonUtils.Extensions +{ + public static class NetworkUtils + { + public static float Latency(this DeserializationResult deserializationResult) + { + if (deserializationResult.receiveTime > deserializationResult.sendTime) + { + return deserializationResult.receiveTime - deserializationResult.sendTime; + } + + return 0f; + } + } +} \ No newline at end of file diff --git a/Packages/tlp.udonutils/Runtime/Extensions/NetworkUtils.cs.meta b/Packages/tlp.udonutils/Runtime/Extensions/NetworkUtils.cs.meta new file mode 100644 index 0000000..868231d --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Extensions/NetworkUtils.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: dea454129562405396d5933e6298d352 +timeCreated: 1689876557 \ No newline at end of file diff --git a/Packages/tlp.udonutils/Runtime/Extensions/UdonMath.cs b/Packages/tlp.udonutils/Runtime/Extensions/UdonMath.cs new file mode 100644 index 0000000..e62eddb --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Extensions/UdonMath.cs @@ -0,0 +1,349 @@ +using UnityEngine; + +namespace TLP.UdonUtils.Extensions +{ + public static class UdonMath + { + public static float Remap(float inMin, float inMax, float outMin, float outMax, float value) + { + float t = inMin.InverseLerp(inMax, value); + return outMin.Lerp(outMax, t); + } + + /// + /// unclamped + /// + /// + /// + /// + /// + public static float InverseLerp(this float a, float b, float value) + { + float divisor = b - a; + if (Mathf.Approximately(divisor, 0f)) + { + return a; + } + + return (value - a) / divisor; + } + + /// + /// unclamped + /// + /// + /// + /// + /// + public static float Lerp(this float a, float b, float t) + { + return (1f - t) * a + t * b; + } + + /// + /// input should be between -1 to 1 + /// + /// + /// + /// + public static float ApplyExpo(this float input, float factor) + { + return (1f - factor) * (input * input * input) + factor * input; + } + + /// + /// Interpolation that combines fast response time with reduced high frequency noise. + /// + /// Note: does not seem to be able to filter + /// + /// Original by Piotr Zurek: https://twitter.com/evil_arev/status/1128062338156900353 + /// + /// + /// + /// + /// + public static float AdaptiveInterpolation(float a, float b, float factor) + { + return Mathf.Lerp(a, b, factor * Mathf.Abs(a - b)); + } + + /// + /// + /// + /// x=p, y=i, z=d + /// + /// + /// + /// + /// + /// result, integral, currentError + public static Vector3 PidUpdate( + Vector3 pid, + float previousIntegral, + float previousError, + float currentValue, + float targetValue, + float deltaTime + ) + { + float currentError = targetValue - currentValue; + + float proportional = pid.x * currentError; + float integral = previousIntegral + deltaTime * pid.y * currentError; + float derivative = pid.z * (currentError - previousError) / deltaTime; + + float result = proportional + integral + derivative; + + return new Vector3(result, integral, currentError); + } + + /// + /// given two (e.g. world) rotations a and b it will return the rotation c which can transform a into b (e.g. b = a * c) + /// + /// + /// + /// delta rotation which can turn a into b + public static Quaternion GetDeltaAToB(Quaternion a, Quaternion b) + { + return Quaternion.Inverse(a) * b; + } + + + /// + /// + /// + /// + /// + /// Torque in Newton-meter [Nm] + public static float PowerWToTorque(float powerInWatts, float rpm) + { + return powerInWatts / rpm; + } + + /// + /// + /// + /// [Nm] + /// + /// Power in Watts + public static float TorqueToPowerW(float torque, float rpm) + { + return torque * rpm; + } + + /// + /// + /// + /// + /// + /// default conversion is for mechanical HP to Watt + /// Torque in Newton-meter [Nm] + public static float PowerHpToTorque(float powerInHp, float rpm, float hpToWatt = 745.70f) + { + return powerInHp / rpm * hpToWatt; + } + + /// + /// + /// + /// [Nm] + /// + /// default conversion is for mechanical HP to Watt + /// Power in Horsepower + public static float TorqueToPowerHp(float torque, float rpm, float hpToWatt = 745.70f) + { + return torque / hpToWatt * rpm; + } + + + /// + /// checks if two quaternions have the same orientation + /// + /// + /// + /// true if a == +- b + public static bool HaveSameOrientation(Quaternion a, Quaternion b) + { + const float quaternionEps = 0.0001f; + return Mathf.Abs(Quaternion.Dot(a.normalized, b.normalized)) > 1.0f - quaternionEps; + } + + /// + /// checks if two quaternions have the same rotation, stricter compared to HaveSameOrientation(...) + /// + /// + /// + /// true if a == b + public static bool HaveSameRotation(Quaternion a, Quaternion b) + { + const float quaternionEps = 0.0001f; + return Quaternion.Dot(a.normalized, b.normalized) > 1.0f - quaternionEps; + } + + /// + /// given two (e.g. world) rotations this and b it will return the rotation + /// c which can transform this rotation into b (e.g. b = this * c) + /// + /// + /// + /// delta rotation which can turn a into b + public static Quaternion GetDeltaToB(this Quaternion a, Quaternion b) + { + return Quaternion.Inverse(a) * b; + } + + /// + /// Original Author: Max Kaufmann (max.kaufmann@gmail.com) + /// + /// + /// + /// + public static Quaternion AngVelToDeriv(Quaternion current, Vector3 angVel) + { + var spin = new Quaternion(angVel.x, angVel.y, angVel.z, 0f); + var result = spin * current; + return new Quaternion(0.5f * result.x, 0.5f * result.y, 0.5f * result.z, 0.5f * result.w); + } + + /// + /// + /// Original Author: Max Kaufmann (max.kaufmann@gmail.com) + /// + /// + /// + /// + public static Vector3 DerivToAngVel(Quaternion current, Quaternion deriv) + { + var result = deriv * Quaternion.Inverse(current); + return new Vector3(2f * result.x, 2f * result.y, 2f * result.z); + } + + /// + /// Original Author: Max Kaufmann (max.kaufmann@gmail.com) + /// + /// + /// + /// + /// + public static Quaternion IntegrateRotation(Quaternion rotation, Vector3 angularVelocity, float deltaTime) + { + var deriv = AngVelToDeriv(rotation, angularVelocity); + var pred = new Vector4( + rotation.x + deriv.x * deltaTime, + rotation.y + deriv.y * deltaTime, + rotation.z + deriv.z * deltaTime, + rotation.w + deriv.w * deltaTime + ).normalized; + return new Quaternion(pred.x, pred.y, pred.z, pred.w); + } + + /// + /// Original Author: Max Kaufmann (max.kaufmann@gmail.com) + /// + /// + /// + /// + /// + /// + /// + /// + public static Quaternion SmoothDamp( + Quaternion rot, + Quaternion target, + ref Quaternion deriv, + float smoothTime, + float maxSpeed, + float deltaTime + ) + { + // account for double-cover + float dot = Quaternion.Dot(rot, target); + float multi = dot > 0f ? 1f : -1f; + target.x *= multi; + target.y *= multi; + target.z *= multi; + target.w *= multi; + // smooth damp (nlerp approx) + var result = new Vector4( + Mathf.SmoothDamp(rot.x, target.x, ref deriv.x, smoothTime, maxSpeed, deltaTime), + Mathf.SmoothDamp(rot.y, target.y, ref deriv.y, smoothTime, maxSpeed, deltaTime), + Mathf.SmoothDamp(rot.z, target.z, ref deriv.z, smoothTime, maxSpeed, deltaTime), + Mathf.SmoothDamp(rot.w, target.w, ref deriv.w, smoothTime, maxSpeed, deltaTime) + ).normalized; + // compute deriv + float dtInv = 1f / deltaTime; + deriv.x = (result.x - rot.x) * dtInv; + deriv.y = (result.y - rot.y) * dtInv; + deriv.z = (result.z - rot.z) * dtInv; + deriv.w = (result.w - rot.w) * dtInv; + return new Quaternion(result.x, result.y, result.z, result.w); + } + + // Source: https://wiki.unity3d.com/index.php/Averaging_Quaternions_and_Vectors + //Get an average (mean) from more then two quaternions (with two, slerp would be used). + //Note: this only works if all the quaternions are relatively close together. + //Usage: + //-Cumulative is an external Vector4 which holds all the added x y z and w components. + //-newRotation is the next rotation to be added to the average pool + //-firstRotation is the first quaternion of the array to be averaged + //-addAmount holds the total amount of quaternions which are currently added + //This function returns the current average quaternion + public static Quaternion AverageQuaternion( + ref Vector4 cumulative, + Quaternion newRotation, + Quaternion firstRotation, + int addAmount + ) + { + Debug.Assert(addAmount > 0); + + //Before we add the new rotation to the average (mean), we have to check whether the quaternion has to be inverted. Because + //q and -q are the same rotation, but cannot be averaged, we have to make sure they are all the same. + if (!AreQuaternionsClose(newRotation, firstRotation)) + { + newRotation = newRotation.InverseSignQuaternion(); + } + + //Average the values + float addDet = 1f / addAmount; + cumulative.w += newRotation.w; + float w = cumulative.w * addDet; + cumulative.x += newRotation.x; + float x = cumulative.x * addDet; + cumulative.y += newRotation.y; + float y = cumulative.y * addDet; + cumulative.z += newRotation.z; + float z = cumulative.z * addDet; + + //note: if speed is an issue, you can skip the normalization step + return new Quaternion(x, y, z, w).normalized; + } + + // Source: https://wiki.unity3d.com/index.php/Averaging_Quaternions_and_Vectors + //Changes the sign of the quaternion components. This is not the same as the inverse. + public static Quaternion InverseSignQuaternion(this Quaternion q) + { + return new Quaternion(-q.x, -q.y, -q.z, -q.w); + } + + // Source: https://wiki.unity3d.com/index.php/Averaging_Quaternions_and_Vectors + //Returns true if the two input quaternions are close to each other. This can + //be used to check whether or not one of two quaternions which are supposed to + //be very similar but has its component signs reversed (q has the same rotation as + //-q) + public static bool AreQuaternionsClose(Quaternion q1, Quaternion q2) + { + float dot = Quaternion.Dot(q1, q2); + + if (dot < 0.0f) + { + return false; + } + + else + { + return true; + } + } + } +} \ No newline at end of file diff --git a/Scripts/Common/UdonMath.cs.meta b/Packages/tlp.udonutils/Runtime/Extensions/UdonMath.cs.meta similarity index 100% rename from Scripts/Common/UdonMath.cs.meta rename to Packages/tlp.udonutils/Runtime/Extensions/UdonMath.cs.meta diff --git a/Packages/tlp.udonutils/Runtime/Extensions/VRCPlayerApiUtils.cs b/Packages/tlp.udonutils/Runtime/Extensions/VRCPlayerApiUtils.cs new file mode 100644 index 0000000..2b17135 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Extensions/VRCPlayerApiUtils.cs @@ -0,0 +1,73 @@ +using JetBrains.Annotations; +using VRC.SDKBase; + +namespace TLP.UdonUtils.Extensions +{ + public static class VrcPlayerApiUtils + { + [PublicAPI] + public const int InvalidPlayerId = -1; + + [PublicAPI] + public static int PlayerIdSafe(this VRCPlayerApi playerApi) + { + return Utilities.IsValid(playerApi) ? playerApi.playerId : InvalidPlayerId; + } + + [PublicAPI] + public static string DisplayNameSafe(this VRCPlayerApi playerApi) + { + return Utilities.IsValid(playerApi) ? playerApi.displayName : ""; + } + + /// + /// + /// + /// + /// returns 'Invalid Player' if player doesn't exist + [PublicAPI] + public static string ToStringSafe(this VRCPlayerApi playerApi) + { + return Utilities.IsValid(playerApi) + ? $"Player {playerApi.playerId} ({nameof(playerApi.displayName)}={playerApi.displayName}, {nameof(playerApi.isLocal)}={playerApi.isLocal}, {nameof(playerApi.isMaster)}={playerApi.isMaster}, VR={playerApi.IsUserInVR()}, grounded={playerApi.IsPlayerGrounded()})" + : "Invalid Player"; + } + + [PublicAPI] + public static VRCPlayerApi IdToVrcPlayer(this int playerId) + { + return VRCPlayerApi.GetPlayerById(playerId); + } + + public static bool IsValidPlayer(this int playerId, out VRCPlayerApi player) + { + player = VRCPlayerApi.GetPlayerById(playerId); + return Utilities.IsValid(player); + } + + public static bool IsRemoteSafe(this VRCPlayerApi player) + { + return Utilities.IsValid(player) && !player.isLocal; + } + + public static bool IsMasterSafe(this VRCPlayerApi player) + { + return Utilities.IsValid(player) && player.isMaster; + } + + public static bool IsLocalSafe(this VRCPlayerApi player) + { + return Utilities.IsValid(player) && player.isLocal; + } + + public static bool IsInstanceOwnerSafe(this VRCPlayerApi player) + { + return Utilities.IsValid(player) && player.isInstanceOwner; + } + + public static bool IsValidSafe(this VRCPlayerApi player) + { + return Utilities.IsValid(player); + } + } +} \ No newline at end of file diff --git a/Packages/tlp.udonutils/Runtime/Extensions/VRCPlayerApiUtils.cs.meta b/Packages/tlp.udonutils/Runtime/Extensions/VRCPlayerApiUtils.cs.meta new file mode 100644 index 0000000..dc63927 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Extensions/VRCPlayerApiUtils.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 26955208a6e74e10998e3f6b4845110e +timeCreated: 1675605194 \ No newline at end of file diff --git a/Packages/tlp.udonutils/Runtime/Logger.meta b/Packages/tlp.udonutils/Runtime/Logger.meta new file mode 100644 index 0000000..b9f5ce3 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Logger.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0eb4ad064dec6b144b4a3f09046c7791 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/tlp.udonutils/Runtime/Logger/TlpLogger.asset b/Packages/tlp.udonutils/Runtime/Logger/TlpLogger.asset new file mode 100644 index 0000000..61230eb --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Logger/TlpLogger.asset @@ -0,0 +1,856 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3} + m_Name: TlpLogger + m_EditorClassIdentifier: + serializedUdonProgramAsset: {fileID: 11400000, guid: cb4a4d56777598746b830c4a06d01508, + type: 2} + udonAssembly: + assemblyError: + sourceCsScript: {fileID: 11500000, guid: 43266f688d95c0340a72883e181fea7a, type: 3} + scriptVersion: 2 + compiledVersion: 2 + behaviourSyncMode: 1 + hasInteractEvent: 0 + scriptID: -3251338304318250380 + serializationData: + SerializedFormat: 2 + SerializedBytes: + ReferencedUnityObjects: [] + SerializedBytesString: + Prefab: {fileID: 0} + PrefabModificationsReferencedUnityObjects: [] + PrefabModifications: [] + SerializationNodes: + - Name: fieldDefinitions + Entry: 7 + Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition, + UdonSharp.Editor]], mscorlib + - Name: comparer + Entry: 7 + Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String, + mscorlib]], mscorlib + - Name: + Entry: 8 + Data: + - Name: + Entry: 12 + Data: 14 + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: PendingSerializations + - Name: $v + Entry: 7 + Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: PendingSerializations + - Name: k__BackingField + Entry: 7 + Data: 3|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Int32, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 4|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: Severity + - Name: $v + Entry: 7 + Data: 5|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Severity + - Name: k__BackingField + Entry: 7 + Data: 6|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.Logger.ELogLevel, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: 7|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 8|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 9|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 7 + Data: 10|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.Logger.TlpLogger, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: 11|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: VRC.Udon.UdonBehaviour, VRC.Udon + - Name: + Entry: 8 + Data: + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 12|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: EventInstigator + - Name: $v + Entry: 7 + Data: 13|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: EventInstigator + - Name: k__BackingField + Entry: 7 + Data: 14|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.TlpBaseBehaviour, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: 15|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 3 + - Name: + Entry: 7 + Data: 16|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 17|UnityEngine.HideInInspector, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 18|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - 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: Pool + - Name: $v + Entry: 7 + Data: 19|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Pool + - Name: k__BackingField + Entry: 9 + Data: 14 + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: 20|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 3 + - Name: + Entry: 7 + Data: 21|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 22|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 23|UnityEngine.HideInInspector, UnityEngine.CoreModule + - 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: PoolableInUse + - Name: $v + Entry: 7 + Data: 24|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: PoolableInUse + - Name: k__BackingField + Entry: 7 + Data: 25|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Boolean, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 26|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 27|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 28|UnityEngine.HideInInspector, UnityEngine.CoreModule + - 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: _startTime + - Name: $v + Entry: 7 + Data: 29|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _startTime + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 30|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: DetailedPlayerInfo + - Name: $v + Entry: 7 + Data: 31|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: DetailedPlayerInfo + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 32|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 33|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - 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: DetailedContextInfo + - Name: $v + Entry: 7 + Data: 34|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: DetailedContextInfo + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 35|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 36|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - 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: CreateDebugFrameLog + - Name: $v + Entry: 7 + Data: 37|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: CreateDebugFrameLog + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 2 + - Name: + Entry: 7 + Data: 39|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 40|UnityEngine.TooltipAttribute, UnityEngine.CoreModule + - Name: tooltip + Entry: 1 + Data: If true will combine all Debug logs of a frame into a single string, + can be used to see what has been logged in the entire frame. Can be useful + to determine frames with excessive logging. + - 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: _lastFrame + - Name: $v + Entry: 7 + Data: 41|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _lastFrame + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 42|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 43|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 7 + Data: 44|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.String, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 44 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 45|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _performanceStopwatch + - Name: $v + Entry: 7 + Data: 46|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _performanceStopwatch + - Name: k__BackingField + Entry: 7 + Data: 47|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Diagnostics.Stopwatch, System + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 47 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 48|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _lastLog + - Name: $v + Entry: 7 + Data: 49|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _lastLog + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 50|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: diff --git a/Packages/tlp.udonutils/Runtime/Logger/TlpLogger.asset.meta b/Packages/tlp.udonutils/Runtime/Logger/TlpLogger.asset.meta new file mode 100644 index 0000000..d3d45c7 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Logger/TlpLogger.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4f06f9d2e68d8114ab22a62bbf43f319 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/tlp.udonutils/Runtime/Logger/TlpLogger.cs b/Packages/tlp.udonutils/Runtime/Logger/TlpLogger.cs new file mode 100644 index 0000000..1618f3a --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Logger/TlpLogger.cs @@ -0,0 +1,201 @@ +using JetBrains.Annotations; +using UdonSharp; +using UnityEngine; +using UnityEngine.Serialization; +using VRC.SDKBase; +using VRC.Udon; + +namespace TLP.UdonUtils.Logger +{ + public enum ELogLevel + { + None = 0, + Assertion = 1, + Error = 2, + Warning = 3, + Info = 4, + Debug = 5 + } + + [UdonBehaviourSyncMode(BehaviourSyncMode.None)] + [DefaultExecutionOrder(ExecutionOrder)] + public class TlpLogger : TlpBaseBehaviour + { + protected override int ExecutionOrderReadOnly => ExecutionOrder; + + [PublicAPI] + public new const int ExecutionOrder = TlpExecutionOrder.Min; + + private int _startTime; + + [FormerlySerializedAs("detailedPlayerInfo")] + public bool DetailedPlayerInfo = true; + + [FormerlySerializedAs("detailedContextInfo")] + public bool DetailedContextInfo = true; + + [FormerlySerializedAs("createDebugFrameLog")] + [Tooltip( + "If true will combine all Debug logs of a frame into a single string, can be used to see what has been logged in the entire frame. Can be useful to determine frames with excessive logging." + )] + public bool CreateDebugFrameLog; + + private int _lastFrame = -1; + public string DebugLogOfFrame { get; private set; } + + private readonly System.Diagnostics.Stopwatch _performanceStopwatch = new System.Diagnostics.Stopwatch(); + + public void Start() + { + _startTime = Networking.GetServerTimeInMilliseconds(); + + Info( + $"Starting at server time {_startTime}. Initialization took at least {_performanceStopwatch.Elapsed.TotalMilliseconds}ms." + ); + } + + private int _lastLog; + + protected virtual string Prefix => "[TLP]"; + + protected virtual string GetPlayerInfo(Object context) + { + if (!DetailedPlayerInfo) + { + return ""; + } + + int delta = Networking.GetServerTimeInMilliseconds() - _lastLog; + _lastLog += delta; + + + bool master = false; + int localPlayerPlayerId = -1; + bool isLocal = true; + string playerName = "None"; + if (Utilities.IsValid(Networking.LocalPlayer)) + { + localPlayerPlayerId = Networking.LocalPlayer.playerId; + } + + int ownerId = localPlayerPlayerId; + // ReSharper disable once OperatorIsCanBeUsed not supported by U# + if (Utilities.IsValid(context) && context.GetType() == typeof(UdonBehaviour)) + { + var udonBehaviour = (UdonBehaviour)context; + var theOwner = Networking.GetOwner(udonBehaviour.gameObject); + if (Utilities.IsValid(theOwner)) + { + ownerId = theOwner.playerId; + master = theOwner.isMaster; + isLocal = theOwner.playerId == localPlayerPlayerId; + playerName = theOwner.displayName; + } + } + + double elapsedAccurate = _performanceStopwatch.Elapsed.TotalMilliseconds; + _performanceStopwatch.Restart(); + return + $"[f={Time.frameCount} ntss={Networking.GetServerTimeInMilliseconds() - _startTime}ms nt={Networking.GetServerTimeInMilliseconds()}ms dt={elapsedAccurate:F3}ms][{(isLocal ? "Local" : "Remote")} owner {playerName}({ownerId}) {(master ? " is Master" : "")}]"; + } + + public virtual void DebugLog(string logPrefix, string message, int executionOrder, Object context) + { + if ((int)Severity < (int)ELogLevel.Debug) + { + return; + } + + string completeMessage; + if (DetailedContextInfo) + { + completeMessage = + $"[DEBUG]{Prefix}{logPrefix}{GetPlayerInfo(context)} {message}"; + Debug.Log(completeMessage, context); + } + else + { + completeMessage = $"[DEBUG]{GetPlayerInfo(context)} {message}"; + Debug.Log(completeMessage, context); + } + + if (!CreateDebugFrameLog) + { + return; + } + + if (Time.frameCount == _lastFrame) + { + DebugLogOfFrame += $"{completeMessage}\n"; + } + else + { + _lastFrame = Time.frameCount; + DebugLogOfFrame = $"{completeMessage}\n"; + } + } + + public virtual void Info(string logPrefix, string message, Object context) + { + if ((int)Severity < (int)ELogLevel.Info) + { + return; + } + + if (DetailedContextInfo) + { + Debug.Log($"[INFO]{Prefix}{logPrefix}{GetPlayerInfo(context)} {message}", context); + } + else + { + Debug.Log($"[INFO]{GetPlayerInfo(context)} {message}", context); + } + } + + public virtual void Warn(string logPrefix, string message, Object context) + { + if ((int)Severity < (int)ELogLevel.Warning) + { + return; + } + + if (DetailedContextInfo) + { + Debug.LogWarning( + $"[WARN]{Prefix}{logPrefix}{GetPlayerInfo(context)} {message}", + context + ); + } + else + { + Debug.LogWarning( + $"[WARN]{GetPlayerInfo(context)} {message}", + context + ); + } + } + + public virtual void Error(string logPrefix, string message, Object context) + { + if ((int)Severity < (int)ELogLevel.Assertion) + { + return; + } + + if (DetailedContextInfo) + { + Debug.LogError( + $"[ERROR]{Prefix}{logPrefix}{GetPlayerInfo(context)} {message}", + context + ); + } + else + { + Debug.LogError( + $"[ERROR]{GetPlayerInfo(context)} {message}", + context + ); + } + } + } +} \ No newline at end of file diff --git a/Packages/tlp.udonutils/Runtime/Logger/TlpLogger.cs.meta b/Packages/tlp.udonutils/Runtime/Logger/TlpLogger.cs.meta new file mode 100644 index 0000000..361ded0 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Logger/TlpLogger.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 43266f688d95c0340a72883e181fea7a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/tlp.udonutils/Runtime/Physics.meta b/Packages/tlp.udonutils/Runtime/Physics.meta new file mode 100644 index 0000000..d367249 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Physics.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f0c607932c44e8c4796b9bcf5e1cd7c1 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/tlp.udonutils/Runtime/Physics/RigidbodyVelocityProvider.asset b/Packages/tlp.udonutils/Runtime/Physics/RigidbodyVelocityProvider.asset new file mode 100644 index 0000000..47ab9aa --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Physics/RigidbodyVelocityProvider.asset @@ -0,0 +1,1007 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3} + m_Name: RigidbodyVelocityProvider + m_EditorClassIdentifier: + serializedUdonProgramAsset: {fileID: 11400000, guid: a91807ff667b58745a410f012a4acd7b, + type: 2} + udonAssembly: + assemblyError: + sourceCsScript: {fileID: 11500000, guid: e945adb2fe954e1c839e25603bb97463, type: 3} + scriptVersion: 2 + compiledVersion: 2 + behaviourSyncMode: 1 + hasInteractEvent: 0 + scriptID: -2950486671528830696 + serializationData: + SerializedFormat: 2 + SerializedBytes: + ReferencedUnityObjects: [] + SerializedBytesString: + Prefab: {fileID: 0} + PrefabModificationsReferencedUnityObjects: [] + PrefabModifications: [] + SerializationNodes: + - Name: fieldDefinitions + Entry: 7 + Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition, + UdonSharp.Editor]], mscorlib + - Name: comparer + Entry: 7 + Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String, + mscorlib]], mscorlib + - Name: + Entry: 8 + Data: + - Name: + Entry: 12 + Data: 17 + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: PendingSerializations + - Name: $v + Entry: 7 + Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: PendingSerializations + - Name: k__BackingField + Entry: 7 + Data: 3|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Int32, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 4|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: Severity + - Name: $v + Entry: 7 + Data: 5|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Severity + - Name: k__BackingField + Entry: 7 + Data: 6|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.Logger.ELogLevel, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: 7|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 8|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 9|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 7 + Data: 10|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.Logger.TlpLogger, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: 11|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: VRC.Udon.UdonBehaviour, VRC.Udon + - Name: + Entry: 8 + Data: + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 12|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: EventInstigator + - Name: $v + Entry: 7 + Data: 13|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: EventInstigator + - Name: k__BackingField + Entry: 7 + Data: 14|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.TlpBaseBehaviour, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: 15|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 3 + - Name: + Entry: 7 + Data: 16|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 17|UnityEngine.HideInInspector, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 18|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - 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: Pool + - Name: $v + Entry: 7 + Data: 19|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Pool + - Name: k__BackingField + Entry: 9 + Data: 14 + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: 20|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 3 + - Name: + Entry: 7 + Data: 21|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 22|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 23|UnityEngine.HideInInspector, UnityEngine.CoreModule + - 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: PoolableInUse + - Name: $v + Entry: 7 + Data: 24|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: PoolableInUse + - Name: k__BackingField + Entry: 7 + Data: 25|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Boolean, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 26|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 27|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 28|UnityEngine.HideInInspector, UnityEngine.CoreModule + - 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: RelativeTo + - Name: $v + Entry: 7 + Data: 29|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: RelativeTo + - Name: k__BackingField + Entry: 7 + Data: 30|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: UnityEngine.Transform, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 30 + - 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: 31|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 32|UnityEngine.SerializeField, UnityEngine.CoreModule + - 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: _acceleration + - Name: $v + Entry: 7 + Data: 33|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _acceleration + - Name: k__BackingField + Entry: 7 + Data: 34|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: UnityEngine.Vector3[], UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 34 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 35|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _velocity + - Name: $v + Entry: 7 + Data: 36|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _velocity + - Name: k__BackingField + Entry: 9 + Data: 34 + - Name: k__BackingField + Entry: 9 + Data: 34 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 37|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _velocityTime + - Name: $v + Entry: 7 + Data: 38|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _velocityTime + - Name: k__BackingField + Entry: 7 + Data: 39|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Single[], mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 39 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 40|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _accelerationTime + - Name: $v + Entry: 7 + Data: 41|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _accelerationTime + - Name: k__BackingField + Entry: 9 + Data: 39 + - Name: k__BackingField + Entry: 9 + Data: 39 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 42|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _angularVelocity + - Name: $v + Entry: 7 + Data: 43|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _angularVelocity + - Name: k__BackingField + Entry: 9 + Data: 34 + - Name: k__BackingField + Entry: 9 + Data: 34 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 44|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _angularAcceleration + - Name: $v + Entry: 7 + Data: 45|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _angularAcceleration + - Name: k__BackingField + Entry: 9 + Data: 34 + - Name: k__BackingField + Entry: 9 + Data: 34 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 46|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: ToTrack + - Name: $v + Entry: 7 + Data: 47|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: ToTrack + - Name: k__BackingField + Entry: 7 + Data: 48|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: UnityEngine.Rigidbody, UnityEngine.PhysicsModule + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 48 + - 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: 49|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 50|UnityEngine.SerializeField, UnityEngine.CoreModule + - 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: _position + - Name: $v + Entry: 7 + Data: 51|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _position + - Name: k__BackingField + Entry: 7 + Data: 52|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: UnityEngine.Vector3, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 52 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 53|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _rotation + - Name: $v + Entry: 7 + Data: 54|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _rotation + - Name: k__BackingField + Entry: 7 + Data: 55|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: UnityEngine.Quaternion, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 55 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 56|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _previousRotation + - Name: $v + Entry: 7 + Data: 57|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _previousRotation + - Name: k__BackingField + Entry: 9 + Data: 55 + - Name: k__BackingField + Entry: 9 + Data: 55 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 58|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: diff --git a/Packages/tlp.udonutils/Runtime/Physics/RigidbodyVelocityProvider.asset.meta b/Packages/tlp.udonutils/Runtime/Physics/RigidbodyVelocityProvider.asset.meta new file mode 100644 index 0000000..e93813b --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Physics/RigidbodyVelocityProvider.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 97e4d9c03e6f9ca419382043245ce926 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/tlp.udonutils/Runtime/Physics/RigidbodyVelocityProvider.cs b/Packages/tlp.udonutils/Runtime/Physics/RigidbodyVelocityProvider.cs new file mode 100644 index 0000000..1b517d1 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Physics/RigidbodyVelocityProvider.cs @@ -0,0 +1,108 @@ +using UdonSharp; +using UnityEngine; + +namespace TLP.UdonUtils.Physics +{ + /// + /// uses rigidbody velocity and calculates acceleration after everything that can affect physics of objects which + /// should be everything except audio + /// + [UdonBehaviourSyncMode(BehaviourSyncMode.None)] + [DefaultExecutionOrder(ExecutionOrder)] + public class RigidbodyVelocityProvider : VelocityProvider + { + [SerializeField] + internal Rigidbody ToTrack; + + private Vector3 _position; + private Quaternion _rotation; + private Quaternion _previousRotation; + + private void FixedUpdate() + { + var trackTransform = ToTrack.transform; + _UpdatePositionSnapshot( + trackTransform.position, + ToTrack.velocity, + Time.fixedDeltaTime, + Time.timeSinceLevelLoad + ); + + _UpdateRotationSnapshot( + trackTransform.rotation, + ToTrack.angularVelocity, + Time.fixedDeltaTime + ); +#if TLP_DEBUG + UpdateDebugEditorValues(); +#endif + } + + public override float GetLatestSnapShot( + out Vector3 position, + out Vector3 velocity, + out Vector3 acceleration, + out Quaternion rotation, + out Vector3 angularVelocity, + out Vector3 angularAcceleration, + out Transform relativeTo + ) + { + #region TLP_DEBUG + +#if TLP_DEBUG + DebugLog(nameof(GetLatestSnapShot)); +#endif + + #endregion + + + position = _position; + velocity = _velocity[2]; + acceleration = _acceleration[2]; + rotation = _rotation; + angularVelocity = _angularVelocity[2]; + angularAcceleration = _angularAcceleration[2]; + relativeTo = RelativeTo; + + return _accelerationTime[2]; + } + + internal void _UpdatePositionSnapshot( + Vector3 worldPosition, + Vector3 rigidbodyVelocity, + float deltaTime, + float time + ) + { + _velocity[0] = _velocity[1]; + _velocity[1] = _velocity[2]; + + _acceleration[0] = _acceleration[1]; + _acceleration[1] = _acceleration[2]; + + _velocity[2] = RelativeTo.InverseTransformVector(rigidbodyVelocity); + _acceleration[2] = (_velocity[2] - _velocity[1]) / deltaTime; + + _velocityTime[2] = time; + _accelerationTime[2] = time; + + _position = RelativeTo.InverseTransformPoint(worldPosition); + } + + public void _UpdateRotationSnapshot(Quaternion worldRotation, Vector3 angularVelocity, float deltaTime) + { + _angularVelocity[0] = _angularVelocity[1]; + _angularVelocity[1] = _angularVelocity[2]; + + _angularAcceleration[0] = _angularAcceleration[1]; + _angularAcceleration[1] = _angularAcceleration[2]; + + _angularVelocity[2] = angularVelocity; //RelativeTo.InverseTransformVector(angularVelocity); + _angularAcceleration[2] = (_angularVelocity[2] - _angularVelocity[1]) / deltaTime; + + _previousRotation = _rotation; + _rotation = worldRotation; //UdonMath.GetDeltaAToB(RelativeTo.rotation.normalized, worldRotation.normalized).normalized; + } + } +} \ No newline at end of file diff --git a/Packages/tlp.udonutils/Runtime/Physics/RigidbodyVelocityProvider.cs.meta b/Packages/tlp.udonutils/Runtime/Physics/RigidbodyVelocityProvider.cs.meta new file mode 100644 index 0000000..c4f4b2f --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Physics/RigidbodyVelocityProvider.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: e945adb2fe954e1c839e25603bb97463 +timeCreated: 1690129391 \ No newline at end of file diff --git a/Packages/tlp.udonutils/Runtime/Physics/VelocityProvider.cs b/Packages/tlp.udonutils/Runtime/Physics/VelocityProvider.cs new file mode 100644 index 0000000..4dc8bae --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Physics/VelocityProvider.cs @@ -0,0 +1,131 @@ +using JetBrains.Annotations; +using UdonSharp; +using UnityEngine; + +namespace TLP.UdonUtils.Physics +{ + /// + /// calculates velocity and acceleration after everything that can affect locations and physics of objects which + /// should be everything except audio + /// + [UdonBehaviourSyncMode(BehaviourSyncMode.None)] + [DefaultExecutionOrder(ExecutionOrder)] + public abstract class VelocityProvider : TlpBaseBehaviour + { + protected override int ExecutionOrderReadOnly => ExecutionOrder; + + // after everything that can affect locations and physics of objects which should be everything except audio + [PublicAPI] + public new const int ExecutionOrder = TlpExecutionOrder.UiEnd + 1; + + + [SerializeField] + protected internal Transform RelativeTo; + + /// + /// moving average: most recent 2 values + /// + public Vector3 AccelerationAvg2 => 0.5f * (_acceleration[1] + _acceleration[2]); + + /// + /// moving average: most recent 3 values + /// + public Vector3 AccelerationAvg3 => + 0.33333333333334f * (_acceleration[0] + _acceleration[1] + _acceleration[2]); + + protected internal Vector3[] _acceleration = new Vector3[3]; + protected Vector3[] _velocity = new Vector3[3]; + protected float[] _velocityTime = new float[3]; + protected float[] _accelerationTime = new float[3]; + protected Vector3[] _angularVelocity = new Vector3[3]; + protected internal Vector3[] _angularAcceleration = new Vector3[3]; + + private void OnEnable() + { + Clear(); + } + + private void OnDisable() + { + Clear(); + } + + public virtual void Clear() + { + for (int i = 0; i < _velocity.Length; i++) + { + _velocity[i] = Vector3.zero; + } + + for (int i = 0; i < _acceleration.Length; i++) + { + _acceleration[i] = Vector3.zero; + } + + for (int i = 0; i < _velocityTime.Length; i++) + { + _velocityTime[i] = 0; + } + + for (int i = 0; i < _accelerationTime.Length; i++) + { + _accelerationTime[i] = 0; + } + } + + public virtual void SetTeleported(bool keepVelocity = true) + { + if (!keepVelocity) + { + Clear(); + } + } + +#if TLP_DEBUG + + [SerializeField] + private float DebugVelocity; + + [SerializeField] + private float DebugAccelerationInGs; + + [SerializeField] + private float DebugAccelerationInGs2x; + + [SerializeField] + private float DebugAccelerationInGs3x; + + [SerializeField] + private float DebugAgeVelocity; + + [SerializeField] + private float DebugAgeAcceleration; + + protected void UpdateDebugEditorValues() + { + float time = GetLatestSnapShot( + out var position, + out var velocity, + out var acceleration, + out var _unused, + out var __unused, + out var ___unused, + out var unused + ); + DebugVelocity = velocity.magnitude; + DebugAccelerationInGs = acceleration.magnitude / 9.81f; + DebugAccelerationInGs2x = AccelerationAvg2.magnitude / 9.81f; + DebugAccelerationInGs3x = AccelerationAvg3.magnitude / 9.81f; + } +#endif + public abstract float GetLatestSnapShot( + out Vector3 position, + out Vector3 velocity, + out Vector3 acceleration, + out Quaternion rotation, + out Vector3 angularVelocity, + out Vector3 angularAcceleration, + out Transform relativeTo + ); + } +} \ No newline at end of file diff --git a/Packages/tlp.udonutils/Runtime/Physics/VelocityProvider.cs.meta b/Packages/tlp.udonutils/Runtime/Physics/VelocityProvider.cs.meta new file mode 100644 index 0000000..6eeae6e --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Physics/VelocityProvider.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: e118c5bf03e948b7959343a88ffc74b5 +timeCreated: 1690128687 \ No newline at end of file diff --git a/Packages/tlp.udonutils/Runtime/Player.meta b/Packages/tlp.udonutils/Runtime/Player.meta new file mode 100644 index 0000000..98e9cf4 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Player.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 281de505ce358ea4aa316ce620522624 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/tlp.udonutils/Runtime/Player/PlayerBlackList.asset b/Packages/tlp.udonutils/Runtime/Player/PlayerBlackList.asset new file mode 100644 index 0000000..12b828f --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Player/PlayerBlackList.asset @@ -0,0 +1,1299 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3} + m_Name: PlayerBlackList + m_EditorClassIdentifier: + serializedUdonProgramAsset: {fileID: 11400000, guid: fa659185c4c3be44695d30f5676e5aaa, + type: 2} + udonAssembly: + assemblyError: + sourceCsScript: {fileID: 11500000, guid: ad16e62d55f940899a9e4a9fc2624fce, type: 3} + scriptVersion: 2 + compiledVersion: 2 + behaviourSyncMode: 2 + hasInteractEvent: 0 + scriptID: -7238404589134037442 + serializationData: + SerializedFormat: 2 + SerializedBytes: + ReferencedUnityObjects: [] + SerializedBytesString: + Prefab: {fileID: 0} + PrefabModificationsReferencedUnityObjects: [] + PrefabModifications: [] + SerializationNodes: + - Name: fieldDefinitions + Entry: 7 + Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition, + UdonSharp.Editor]], mscorlib + - Name: comparer + Entry: 7 + Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String, + mscorlib]], mscorlib + - Name: + Entry: 8 + Data: + - Name: + Entry: 12 + Data: 21 + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: PendingSerializations + - Name: $v + Entry: 7 + Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: PendingSerializations + - Name: k__BackingField + Entry: 7 + Data: 3|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Int32, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 4|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: Severity + - Name: $v + Entry: 7 + Data: 5|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Severity + - Name: k__BackingField + Entry: 7 + Data: 6|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.Logger.ELogLevel, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: 7|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 8|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 9|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 7 + Data: 10|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.Logger.TlpLogger, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: 11|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: VRC.Udon.UdonBehaviour, VRC.Udon + - Name: + Entry: 8 + Data: + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 12|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: EventInstigator + - Name: $v + Entry: 7 + Data: 13|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: EventInstigator + - Name: k__BackingField + Entry: 7 + Data: 14|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.TlpBaseBehaviour, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: 15|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 3 + - Name: + Entry: 7 + Data: 16|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 17|UnityEngine.HideInInspector, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 18|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - 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: Pool + - Name: $v + Entry: 7 + Data: 19|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Pool + - Name: k__BackingField + Entry: 9 + Data: 14 + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: 20|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 3 + - Name: + Entry: 7 + Data: 21|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 22|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 23|UnityEngine.HideInInspector, UnityEngine.CoreModule + - 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: PoolableInUse + - Name: $v + Entry: 7 + Data: 24|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: PoolableInUse + - Name: k__BackingField + Entry: 7 + Data: 25|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Boolean, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 26|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 27|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 28|UnityEngine.HideInInspector, UnityEngine.CoreModule + - 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: BlackListedPlayers + - Name: $v + Entry: 7 + Data: 29|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: BlackListedPlayers + - Name: k__BackingField + Entry: 7 + Data: 30|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.Sync.SyncedEvents.SyncedEventStringArray, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: 31|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 32|UnityEngine.SerializeField, UnityEngine.CoreModule + - 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: WhiteListedPlayers + - Name: $v + Entry: 7 + Data: 33|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: WhiteListedPlayers + - Name: k__BackingField + Entry: 9 + Data: 30 + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: 34|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 35|UnityEngine.SerializeField, UnityEngine.CoreModule + - 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: OptionalBlackListUrl + - Name: $v + Entry: 7 + Data: 36|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: OptionalBlackListUrl + - Name: k__BackingField + Entry: 7 + Data: 37|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: VRC.SDKBase.VRCUrl, VRCSDKBase + - 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: 2 + - Name: + Entry: 7 + Data: 39|UnityEngine.TooltipAttribute, UnityEngine.CoreModule + - Name: tooltip + Entry: 1 + Data: Optional URL to text that contains all players that shall be blacklisted. + Entries must be separated by linebreak (\n or \r\n). Refreshed every time + this behaviour is enabled. + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 40|UnityEngine.SerializeField, UnityEngine.CoreModule + - 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: OptionalWhiteListUrl + - Name: $v + Entry: 7 + Data: 41|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: OptionalWhiteListUrl + - 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: 42|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 43|UnityEngine.TooltipAttribute, UnityEngine.CoreModule + - Name: tooltip + Entry: 1 + Data: Optional URL to text that contains all players that shall be whitelisted. + Entries must be separated by linebreak (\n or \r\n). Refreshed every time + this behaviour is enabled. + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 44|UnityEngine.SerializeField, UnityEngine.CoreModule + - 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: OptionalInitialBlackListedPlayerNames + - Name: $v + Entry: 7 + Data: 45|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: OptionalInitialBlackListedPlayerNames + - Name: k__BackingField + Entry: 7 + Data: 46|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: UnityEngine.TextAsset, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 46 + - 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: 47|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 48|UnityEngine.TooltipAttribute, UnityEngine.CoreModule + - Name: tooltip + Entry: 1 + Data: Optional text file that contains all players that shall be blacklisted. + Entries must be separated by linebreak (\n or \r\n). + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 49|UnityEngine.SerializeField, UnityEngine.CoreModule + - 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: OptionalInitialWhiteListedPlayerNames + - Name: $v + Entry: 7 + Data: 50|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: OptionalInitialWhiteListedPlayerNames + - Name: k__BackingField + Entry: 9 + Data: 46 + - Name: k__BackingField + Entry: 9 + Data: 46 + - 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: 51|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 52|UnityEngine.TooltipAttribute, UnityEngine.CoreModule + - Name: tooltip + Entry: 1 + Data: Optional text file that contains all players that shall be whitelisted. + Entries must be separated by linebreak (\n or \r\n). + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 53|UnityEngine.SerializeField, UnityEngine.CoreModule + - 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: _initialBlackListedEntries + - Name: $v + Entry: 7 + Data: 54|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _initialBlackListedEntries + - Name: k__BackingField + Entry: 7 + Data: 55|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: VRC.SDK3.Data.DataDictionary, VRCSDK3 + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 55 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 56|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _initialWhiteListedEntries + - Name: $v + Entry: 7 + Data: 57|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _initialWhiteListedEntries + - Name: k__BackingField + Entry: 9 + Data: 55 + - Name: k__BackingField + Entry: 9 + Data: 55 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 58|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _dynamicallyWhiteListedEntries + - Name: $v + Entry: 7 + Data: 59|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _dynamicallyWhiteListedEntries + - Name: k__BackingField + Entry: 9 + Data: 55 + - Name: k__BackingField + Entry: 9 + Data: 55 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 60|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _dynamicallyBlackListedEntries + - Name: $v + Entry: 7 + Data: 61|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _dynamicallyBlackListedEntries + - Name: k__BackingField + Entry: 9 + Data: 55 + - Name: k__BackingField + Entry: 9 + Data: 55 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 62|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _blackListed + - Name: $v + Entry: 7 + Data: 63|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _blackListed + - Name: k__BackingField + Entry: 9 + Data: 55 + - Name: k__BackingField + Entry: 9 + Data: 55 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 64|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _whiteListed + - Name: $v + Entry: 7 + Data: 65|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _whiteListed + - Name: k__BackingField + Entry: 9 + Data: 55 + - Name: k__BackingField + Entry: 9 + Data: 55 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 66|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: WhitelistMode + - Name: $v + Entry: 7 + Data: 67|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: WhitelistMode + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 68|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 3 + - Name: + Entry: 7 + Data: 69|UnityEngine.HeaderAttribute, UnityEngine.CoreModule + - Name: header + Entry: 1 + Data: Configuration + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 70|UnityEngine.TooltipAttribute, UnityEngine.CoreModule + - Name: tooltip + Entry: 1 + Data: If true players are treated as blacklisted unless they are in a whitelist + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 71|UnityEngine.SerializeField, UnityEngine.CoreModule + - 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: DisallowModifyingWhenBlackListed + - Name: $v + Entry: 7 + Data: 72|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: DisallowModifyingWhenBlackListed + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 73|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 74|UnityEngine.TooltipAttribute, UnityEngine.CoreModule + - Name: tooltip + Entry: 1 + Data: If true and the local player is blacklisted then the local player can + not blacklist, whitelist or reset any player + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 75|UnityEngine.SerializeField, UnityEngine.CoreModule + - 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: RunTestOnPlayerJoin + - Name: $v + Entry: 7 + Data: 76|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: RunTestOnPlayerJoin + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 77|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 78|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: diff --git a/Packages/tlp.udonutils/Runtime/Player/PlayerBlackList.asset.meta b/Packages/tlp.udonutils/Runtime/Player/PlayerBlackList.asset.meta new file mode 100644 index 0000000..64b1b53 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Player/PlayerBlackList.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1283bd55942bd05459e1751b1c37b944 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/tlp.udonutils/Runtime/Player/PlayerBlackList.cs b/Packages/tlp.udonutils/Runtime/Player/PlayerBlackList.cs new file mode 100644 index 0000000..13945ea --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Player/PlayerBlackList.cs @@ -0,0 +1,793 @@ +using JetBrains.Annotations; +using TLP.UdonUtils.Extensions; +using TLP.UdonUtils.Sync; +using TLP.UdonUtils.Sync.SyncedEvents; +using UdonSharp; +using UnityEngine; +using VRC.SDK3.Data; +using VRC.SDK3.StringLoading; +using VRC.SDKBase; +using VRC.Udon; + +namespace TLP.UdonUtils.Player +{ + [DefaultExecutionOrder(ExecutionOrder)] + [UdonBehaviourSyncMode(BehaviourSyncMode.NoVariableSync)] + public class PlayerBlackList : TlpBaseBehaviour + { + protected override int ExecutionOrderReadOnly => ExecutionOrder; + + [PublicAPI] + public new const int ExecutionOrder = TlpExecutionOrder.DefaultStart; + + [SerializeField] + internal SyncedEventStringArray BlackListedPlayers; + + [SerializeField] + internal SyncedEventStringArray WhiteListedPlayers; + + [Tooltip( + "Optional URL to text that contains all players that shall be blacklisted. Entries must be separated by linebreak (\\n or \\r\\n). Refreshed every time this behaviour is enabled." + )] + [SerializeField] + private VRCUrl OptionalBlackListUrl; + + [Tooltip( + "Optional URL to text that contains all players that shall be whitelisted. Entries must be separated by linebreak (\\n or \\r\\n). Refreshed every time this behaviour is enabled." + )] + [SerializeField] + private VRCUrl OptionalWhiteListUrl; + + [Tooltip( + "Optional text file that contains all players that shall be blacklisted. Entries must be separated by linebreak (\\n or \\r\\n)." + )] + [SerializeField] + internal TextAsset OptionalInitialBlackListedPlayerNames; + + [Tooltip( + "Optional text file that contains all players that shall be whitelisted. Entries must be separated by linebreak (\\n or \\r\\n)." + )] + [SerializeField] + internal TextAsset OptionalInitialWhiteListedPlayerNames; + + private readonly DataDictionary _initialBlackListedEntries = new DataDictionary(); + private readonly DataDictionary _initialWhiteListedEntries = new DataDictionary(); + private readonly DataDictionary _dynamicallyWhiteListedEntries = new DataDictionary(); + private readonly DataDictionary _dynamicallyBlackListedEntries = new DataDictionary(); + private readonly DataDictionary _blackListed = new DataDictionary(); + private readonly DataDictionary _whiteListed = new DataDictionary(); + + [Header("Configuration")] + [Tooltip("If true players are treated as blacklisted unless they are in a whitelist")] + [SerializeField] + internal bool WhitelistMode; + + [Tooltip( + "If true and the local player is blacklisted then the local player " + + "can not blacklist, whitelist or reset any player" + )] + [SerializeField] + internal bool DisallowModifyingWhenBlackListed = true; + +#if TLP_DEBUG + [SerializeField] + private bool RunTestOnPlayerJoin; +#endif + + #region Udon Lifecycle + + protected virtual void OnEnable() + { + #region TLP_DEBUG + +#if TLP_DEBUG + DebugLog(nameof(OnEnable)); +#endif + + #endregion + + Initialize(); + } + + + protected virtual void OnDisable() + { + #region TLP_DEBUG + +#if TLP_DEBUG + DebugLog(nameof(OnDisable)); +#endif + + #endregion + + if (!Utilities.IsValid(BlackListedPlayers)) + { + Warn($"{nameof(SyncedEventStringArray)} no longer valid during cleanup"); + return; + } + + if (!BlackListedPlayers.RemoveListener(this, true)) + { + Warn( + $"{nameof(SyncedEventStringArray)} was not being listened to, " + + $"did you remove the {nameof(PlayerBlackList)} already manually?" + ); + } + } + + #endregion + + #region Public API + + [PublicAPI] + public bool IsBlackListed(string playerName) + { + #region TLP_DEBUG + +#if TLP_DEBUG + DebugLog($"{nameof(IsBlackListed)} '{playerName}'"); +#endif + + #endregion + + + if (WhitelistMode) + { + return !_whiteListed.ContainsKey(playerName); + } + + return _blackListed.ContainsKey(playerName) && !_whiteListed.ContainsKey(playerName); + } + + [PublicAPI] + public bool IsWhiteListed(string playerName) + { + #region TLP_DEBUG + +#if TLP_DEBUG + DebugLog($"{nameof(IsWhiteListed)} '{playerName}'"); +#endif + + #endregion + + if (WhitelistMode) + { + return _whiteListed.ContainsKey(playerName); + } + + return _whiteListed.ContainsKey(playerName) || !_blackListed.ContainsKey(playerName); + } + + /// + /// Adds a player to the dynamic blacklist and sends it to other players. + /// If the player was part of a whitelist the player will be removed from that. + /// + /// + /// true on success, false on sync errors or invalid name + [PublicAPI] + public bool AddToBlackList(string playerName) + { + #region TLP_DEBUG + +#if TLP_DEBUG + DebugLog($"{nameof(AddToBlackList)} '{playerName}'"); +#endif + + #endregion + + if (string.IsNullOrWhiteSpace(playerName)) + { + Error($"Empty {nameof(playerName)}"); + return false; + } + + if (DisallowModifyingWhenBlackListed + && IsBlackListed(Networking.LocalPlayer.DisplayNameSafe())) + { + Warn($"You are blacklisted and thus not allowed to blacklist player '{playerName}'"); + return false; + } + + if (_dynamicallyWhiteListedEntries.ContainsKey(playerName)) + { + _dynamicallyWhiteListedEntries.Remove(playerName); + if (!UpdateSyncedPlayerList(_dynamicallyWhiteListedEntries.GetKeys(), WhiteListedPlayers)) + { + Error($"Failed to remove blacklisted player '{playerName}' from whitelist for everyone"); + return false; + } + } + + if (_dynamicallyBlackListedEntries.ContainsKey(playerName)) + { + // already blacklisted + if (UpdateSyncedPlayerList(_dynamicallyBlackListedEntries.GetKeys(), BlackListedPlayers)) + { + return true; + } + + Error($"Failed to add player '{playerName}' to blacklist for everyone"); + return false; + } + + _dynamicallyBlackListedEntries[playerName] = true; + if (UpdateSyncedPlayerList(_dynamicallyBlackListedEntries.GetKeys(), BlackListedPlayers)) + { + return true; + } + + Error($"Failed to add player '{playerName}' to blacklist for everyone"); + return false; + } + + /// + /// Adds a player to the dynamic whitelist and sends it to other players. + /// If the player was part of a blacklist the player will be removed from that. + /// + /// + /// true on success, false on sync errors or invalid name + [PublicAPI] + public bool AddToWhiteList(string playerName) + { + #region TLP_DEBUG + +#if TLP_DEBUG + DebugLog($"{nameof(AddToWhiteList)} '{playerName}'"); +#endif + + #endregion + + if (string.IsNullOrWhiteSpace(playerName)) + { + Error($"Empty {nameof(playerName)}"); + return false; + } + + if (DisallowModifyingWhenBlackListed && IsBlackListed(Networking.LocalPlayer.DisplayNameSafe())) + { + Warn($"You are blacklisted and thus not allowed to whitelist player '{playerName}'"); + return false; + } + + if (_dynamicallyBlackListedEntries.ContainsKey(playerName)) + { + _dynamicallyBlackListedEntries.Remove(playerName); + if (!UpdateSyncedPlayerList(_dynamicallyBlackListedEntries.GetKeys(), BlackListedPlayers)) + { + Error($"Failed to remove blacklisted player '{playerName}' from whitelist for everyone"); + return false; + } + } + + if (_dynamicallyWhiteListedEntries.ContainsKey(playerName)) + { + // already whitelisted + if (UpdateSyncedPlayerList(_dynamicallyWhiteListedEntries.GetKeys(), WhiteListedPlayers)) + { + return true; + } + + Error($"Failed to add player '{playerName}' to whitelist for everyone"); + return false; + } + + _dynamicallyWhiteListedEntries[playerName] = true; + if (UpdateSyncedPlayerList(_dynamicallyWhiteListedEntries.GetKeys(), WhiteListedPlayers)) + { + return true; + } + + Error($"Failed to add player '{playerName}' to whitelist for everyone"); + return false; + } + + /// + /// Reverts the player to the initial state loaded from text assets and downloaded lists and + /// syncs the changed dynamic lists with other players. + /// + /// + /// true on success (regardless of if name was part of dynamic lists or not), + /// false on sync errors or invalid name + [PublicAPI] + public bool ResetToDefault(string playerName) + { + #region TLP_DEBUG + +#if TLP_DEBUG + DebugLog($"{nameof(ResetToDefault)} '{playerName}'"); +#endif + + #endregion + + if (string.IsNullOrWhiteSpace(playerName)) + { + Error($"Empty {nameof(playerName)}"); + return false; + } + + if (DisallowModifyingWhenBlackListed && IsBlackListed(Networking.LocalPlayer.DisplayNameSafe())) + { + Warn($"You are blacklisted and thus not allowed to whitelist player '{playerName}'"); + return false; + } + + if (_dynamicallyBlackListedEntries.ContainsKey(playerName)) + { + _dynamicallyBlackListedEntries.Remove(playerName); + if (!UpdateSyncedPlayerList(_dynamicallyBlackListedEntries.GetKeys(), BlackListedPlayers)) + { + Error($"Failed to sync blacklisted player '{playerName}' with other players"); + return false; + } + } + + if (_dynamicallyWhiteListedEntries.ContainsKey(playerName)) + { + _dynamicallyWhiteListedEntries.Remove(playerName); + if (!UpdateSyncedPlayerList(_dynamicallyWhiteListedEntries.GetKeys(), BlackListedPlayers)) + { + Error($"Failed to sync blacklisted player '{playerName}' with other players"); + return false; + } + } + + return true; + } + + #endregion + + public override void OnEvent(string eventName) + { + switch (eventName) + { + case nameof(OnSharedBlacklistChanged): + { + #region TLP_DEBUG + +#if TLP_DEBUG + DebugLog($"{nameof(OnEvent)} {eventName}"); +#endif + + #endregion + + OnSharedBlacklistChanged(); + break; + } + + case nameof(OnSharedWhitelistChanged): + { + #region TLP_DEBUG + +#if TLP_DEBUG + DebugLog($"{nameof(OnEvent)} {eventName}"); +#endif + + #endregion + + OnSharedWhitelistChanged(); + break; + } + default: + base.OnEvent(eventName); + break; + } + } + + private void LoadInitialNames(DataDictionary output, string text) + { + #region TLP_DEBUG + +#if TLP_DEBUG + DebugLog(nameof(LoadInitialNames)); +#endif + + #endregion + + output.Clear(); + + text = text.Replace("\r\n", "\n"); + string[] entries = text.Split('\n'); + foreach (string playerName in entries) + { + if (string.IsNullOrWhiteSpace(playerName)) + { + continue; + } + + if (!output.ContainsKey(playerName)) + { + output[playerName] = true; + } + } + } + + private void CombineBlackLists( + DataDictionary initialBlackListed, + DataDictionary dynamicBlackListed, + DataDictionary dynamicWhiteListed, + DataDictionary outputBlackList + ) + { + #region TLP_DEBUG + +#if TLP_DEBUG + DebugLog(nameof(CombineBlackLists)); +#endif + + #endregion + + outputBlackList.Clear(); + + // add initial entries + var initialNames = initialBlackListed.GetKeys(); + for (int i = 0; i < initialNames.Count; i++) + { + var playerName = initialNames[i]; + if (dynamicWhiteListed.ContainsKey(playerName)) + { + continue; + } + + outputBlackList[playerName] = true; + } + + // add all dynamically blacklisted entries + var addedNames = dynamicBlackListed.GetKeys(); + for (int i = 0; i < addedNames.Count; i++) + { + var playerName = addedNames[i]; + if (outputBlackList.ContainsKey(playerName)) + { + continue; + } + + outputBlackList[playerName] = true; + } + } + + private void CombineWhiteLists( + DataDictionary initialWhiteListed, + DataDictionary initialBlackListed, + DataDictionary dynamicBlackListed, + DataDictionary dynamicWhiteListed, + DataDictionary outputWhiteList + ) + { + #region TLP_DEBUG + +#if TLP_DEBUG + DebugLog(nameof(CombineWhiteLists)); +#endif + + #endregion + + outputWhiteList.Clear(); + + // add initial entries + var initialWhite = initialWhiteListed.GetKeys(); + for (int i = 0; i < initialWhite.Count; i++) + { + var playerName = initialWhite[i]; + if (initialBlackListed.ContainsKey(playerName)) + { + continue; + } + + if (dynamicBlackListed.ContainsKey(playerName)) + { + continue; + } + + outputWhiteList[playerName] = true; + } + + // add dynamic entries + var dynamicWhite = dynamicWhiteListed.GetKeys(); + for (int i = 0; i < dynamicWhite.Count; i++) + { + var playerName = dynamicWhite[i]; + if (dynamicBlackListed.ContainsKey(playerName)) + { + // keep black listed + continue; + } + + if (outputWhiteList.ContainsKey(playerName)) + { + continue; + } + + outputWhiteList[playerName] = true; + } + } + + private void OnSharedBlacklistChanged() + { + #region TLP_DEBUG + +#if TLP_DEBUG + DebugLog(nameof(OnSharedBlacklistChanged)); +#endif + + #endregion + + RefreshReceivedSharedList(_dynamicallyBlackListedEntries, BlackListedPlayers); + RebuildResultLists(); + } + + private void OnSharedWhitelistChanged() + { + #region TLP_DEBUG + +#if TLP_DEBUG + DebugLog(nameof(OnSharedWhitelistChanged)); +#endif + + #endregion + + RefreshReceivedSharedList(_dynamicallyWhiteListedEntries, WhiteListedPlayers); + RebuildResultLists(); + } + + private void RefreshReceivedSharedList(DataDictionary sharedList, SyncedEventStringArray syncedList) + { + #region TLP_DEBUG + +#if TLP_DEBUG + DebugLog(nameof(RefreshReceivedSharedList)); +#endif + + #endregion + + sharedList.Clear(); + string[] syncedListValues = syncedList.Values; + if (syncedListValues.LengthSafe() == 0) + { + return; + } + + foreach (string playerName in syncedListValues) + { + if (string.IsNullOrWhiteSpace(playerName) + || sharedList.ContainsKey(playerName)) + { + continue; + } + + sharedList[playerName] = true; + } + } + + private void RebuildResultLists() + { + #region TLP_DEBUG + +#if TLP_DEBUG + DebugLog(nameof(RebuildResultLists)); +#endif + + #endregion + + CombineBlackLists( + _initialBlackListedEntries, + _dynamicallyBlackListedEntries, + _dynamicallyWhiteListedEntries, + _blackListed + ); + + CombineWhiteLists( + _initialWhiteListedEntries, + _initialBlackListedEntries, + _dynamicallyBlackListedEntries, + _dynamicallyWhiteListedEntries, + _whiteListed + ); + } + + private bool UpdateSyncedPlayerList(DataList playerNames, SyncedEventStringArray syncedNames) + { + #region TLP_DEBUG + +#if TLP_DEBUG + DebugLog(nameof(UpdateSyncedPlayerList)); +#endif + + #endregion + + var names = playerNames; + syncedNames.Values = new string[names.Count]; + for (int i = 0; i < names.Count; i++) + { + syncedNames.Values[i] = names[i].String; + } + + if (syncedNames.TakeOwnership()) + { + return syncedNames.Raise(this); + } + + Error($"Failed to take ownership"); + return false; + } + + internal void Initialize() + { + #region TLP_DEBUG + +#if TLP_DEBUG + DebugLog(nameof(Initialize)); +#endif + + #endregion + + + if (!Utilities.IsValid(BlackListedPlayers)) + { + ErrorAndDisableComponent($"{nameof(BlackListedPlayers)} is not set"); + return; + } + + if (!Utilities.IsValid(WhiteListedPlayers)) + { + ErrorAndDisableComponent($"{nameof(WhiteListedPlayers)} is not set"); + return; + } + + BlackListedPlayers.ListenerMethod = nameof(OnSharedBlacklistChanged); + if (!BlackListedPlayers.AddListenerVerified(this, nameof(OnSharedBlacklistChanged))) + { + ErrorAndDisableComponent($"Failed listening to {nameof(SyncedEventStringArray)} change event"); + return; + } + + WhiteListedPlayers.ListenerMethod = nameof(OnSharedWhitelistChanged); + if (!WhiteListedPlayers.AddListenerVerified(this, nameof(OnSharedWhitelistChanged))) + { + ErrorAndDisableComponent($"Failed listening to {nameof(SyncedEventStringArray)} change event"); + return; + } + + if (Utilities.IsValid(OptionalInitialBlackListedPlayerNames)) + { + LoadInitialNames( + _initialBlackListedEntries, + OptionalInitialBlackListedPlayerNames.text + ); + } + else + { + LoadInitialNames(_initialBlackListedEntries, ""); + } + + if (Utilities.IsValid(OptionalInitialWhiteListedPlayerNames)) + { + LoadInitialNames( + _initialWhiteListedEntries, + OptionalInitialWhiteListedPlayerNames.text + ); + } + else + { + LoadInitialNames(_initialWhiteListedEntries, ""); + } + + RefreshReceivedSharedList(_dynamicallyWhiteListedEntries, WhiteListedPlayers); + RefreshReceivedSharedList(_dynamicallyBlackListedEntries, BlackListedPlayers); + + RebuildResultLists(); + + if (OptionalWhiteListUrl != null && !string.IsNullOrEmpty(OptionalWhiteListUrl.ToString())) + { + VRCStringDownloader.LoadUrl(OptionalWhiteListUrl, gameObject.GetComponent()); + } + + if (OptionalBlackListUrl != null && !string.IsNullOrEmpty(OptionalBlackListUrl.ToString())) + { + VRCStringDownloader.LoadUrl(OptionalBlackListUrl, gameObject.GetComponent()); + } + } + + + #region Callbacks + + public override void OnStringLoadSuccess(IVRCStringDownload result) + { + base.OnStringLoadSuccess(result); + + #region TLP_DEBUG + +#if TLP_DEBUG + DebugLog($"{nameof(OnStringLoadSuccess)} {result.Url}\n{result.Result}"); +#endif + + #endregion + + + if (result.Url.ToString() == OptionalWhiteListUrl.ToString()) + { + DebugLog("Updating initial whitelist using downloaded result"); + string initial = Utilities.IsValid(OptionalInitialWhiteListedPlayerNames) + ? OptionalInitialWhiteListedPlayerNames.text + : ""; + LoadInitialNames( + _initialWhiteListedEntries, + $"{initial}\n{(string.IsNullOrEmpty(result.Result) ? "" : result.Result)}" + ); + } + + if (result.Url.ToString() == OptionalBlackListUrl.ToString()) + { + DebugLog("Updating initial blacklist using downloaded result"); + string initial = Utilities.IsValid(OptionalInitialBlackListedPlayerNames) + ? OptionalInitialBlackListedPlayerNames.text + : ""; + LoadInitialNames( + _initialBlackListedEntries, + $"{initial}\n{(string.IsNullOrEmpty(result.Result) ? "" : result.Result)}" + ); + } + + RebuildResultLists(); + } + + public override void OnStringLoadError(IVRCStringDownload result) + { + base.OnStringLoadError(result); + + #region TLP_DEBUG + +#if TLP_DEBUG + DebugLog($"{nameof(OnStringLoadError)} {result.Url} {result.Error}"); +#endif + + #endregion + + if (result.Url.ToString() == OptionalWhiteListUrl.ToString() + && !string.IsNullOrEmpty(OptionalWhiteListUrl.ToString()) + && result.ErrorCode != 404) + { + VRCStringDownloader.LoadUrl(OptionalWhiteListUrl, gameObject.GetComponent()); + } + + if (result.Url.ToString() == OptionalBlackListUrl.ToString() + && !string.IsNullOrEmpty(OptionalBlackListUrl.ToString()) + && result.ErrorCode != 404) + { + VRCStringDownloader.LoadUrl(OptionalBlackListUrl, gameObject.GetComponent()); + } + } + + #endregion + +#if TLP_DEBUG + public override void OnPlayerJoined(VRCPlayerApi player) + { + base.OnPlayerJoined(player); + if (!RunTestOnPlayerJoin) + { + return; + } + + DebugLog($"{nameof(OnPlayerJoined)} {player.DisplayNameSafe()}"); + + if (IsBlackListed(player.DisplayNameSafe())) + { + DebugLog($"{player.DisplayNameSafe()} is blacklisted by {name}"); + Assert(AddToWhiteList(player.DisplayNameSafe()), "Failed to whitelist player", this); + Assert(IsWhiteListed(player.DisplayNameSafe()), "Player not whitelisted after manually adding", this); + Assert(ResetToDefault(player.DisplayNameSafe()), "Failed to reset player", this); + Assert(IsBlackListed(player.DisplayNameSafe()), "Player not blacklisted again after resetting", this); + } + + if (IsWhiteListed(player.DisplayNameSafe())) + { + DebugLog($"{player.DisplayNameSafe()} is whitelisted by {name}"); + Assert(AddToBlackList(player.DisplayNameSafe()), "Failed to blacklist player", this); + Assert(IsBlackListed(player.DisplayNameSafe()), "Player not blacklisted after manually adding", this); + Assert(ResetToDefault(player.DisplayNameSafe()), "Failed to reset player", this); + Assert(IsWhiteListed(player.DisplayNameSafe()), "Player not whitelisted again after resetting", this); + } + } +#endif + } +} \ No newline at end of file diff --git a/Packages/tlp.udonutils/Runtime/Player/PlayerBlackList.cs.meta b/Packages/tlp.udonutils/Runtime/Player/PlayerBlackList.cs.meta new file mode 100644 index 0000000..2210415 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Player/PlayerBlackList.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: ad16e62d55f940899a9e4a9fc2624fce +timeCreated: 1694114666 \ No newline at end of file diff --git a/Packages/tlp.udonutils/Runtime/Player/PlayerList.asset b/Packages/tlp.udonutils/Runtime/Player/PlayerList.asset new file mode 100644 index 0000000..6268ef4 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Player/PlayerList.asset @@ -0,0 +1,1032 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3} + m_Name: PlayerList + m_EditorClassIdentifier: + serializedUdonProgramAsset: {fileID: 11400000, guid: 717664729863f1244879bdb03467835e, + type: 2} + udonAssembly: + assemblyError: + sourceCsScript: {fileID: 11500000, guid: e09db8f78e0643d49b2476e37e4564ee, type: 3} + scriptVersion: 2 + compiledVersion: 2 + behaviourSyncMode: 4 + hasInteractEvent: 0 + scriptID: -7974467666169818057 + serializationData: + SerializedFormat: 2 + SerializedBytes: + ReferencedUnityObjects: [] + SerializedBytesString: + Prefab: {fileID: 0} + PrefabModificationsReferencedUnityObjects: [] + PrefabModifications: [] + SerializationNodes: + - Name: fieldDefinitions + Entry: 7 + Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition, + UdonSharp.Editor]], mscorlib + - Name: comparer + Entry: 7 + Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String, + mscorlib]], mscorlib + - Name: + Entry: 8 + Data: + - Name: + Entry: 12 + Data: 17 + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: PendingSerializations + - Name: $v + Entry: 7 + Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: PendingSerializations + - Name: k__BackingField + Entry: 7 + Data: 3|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Int32, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 4|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: Severity + - Name: $v + Entry: 7 + Data: 5|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Severity + - Name: k__BackingField + Entry: 7 + Data: 6|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.Logger.ELogLevel, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: 7|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 8|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 9|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 7 + Data: 10|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.Logger.TlpLogger, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: 11|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: VRC.Udon.UdonBehaviour, VRC.Udon + - Name: + Entry: 8 + Data: + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 12|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: EventInstigator + - Name: $v + Entry: 7 + Data: 13|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: EventInstigator + - Name: k__BackingField + Entry: 7 + Data: 14|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.TlpBaseBehaviour, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: 15|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 3 + - Name: + Entry: 7 + Data: 16|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 17|UnityEngine.HideInInspector, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 18|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - 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: Pool + - Name: $v + Entry: 7 + Data: 19|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Pool + - Name: k__BackingField + Entry: 9 + Data: 14 + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: 20|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 3 + - Name: + Entry: 7 + Data: 21|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 22|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 23|UnityEngine.HideInInspector, UnityEngine.CoreModule + - 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: PoolableInUse + - Name: $v + Entry: 7 + Data: 24|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: PoolableInUse + - Name: k__BackingField + Entry: 7 + Data: 25|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Boolean, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 26|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 27|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 28|UnityEngine.HideInInspector, UnityEngine.CoreModule + - 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: Listeners + - Name: $v + Entry: 7 + Data: 29|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Listeners + - Name: k__BackingField + Entry: 7 + Data: 30|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.TlpBaseBehaviour[], TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: 31|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: UnityEngine.Component[], UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - 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: 32|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 33|UnityEngine.SerializeField, UnityEngine.CoreModule + - 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: RaiseOnEnable + - Name: $v + Entry: 7 + Data: 34|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: RaiseOnEnable + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 35|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: RaiseOnStart + - Name: $v + Entry: 7 + Data: 36|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: RaiseOnStart + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 37|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: ListenerMethod + - Name: $v + Entry: 7 + Data: 38|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: ListenerMethod + - Name: k__BackingField + Entry: 7 + Data: 39|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.String, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 39 + - 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: 40|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 41|UnityEngine.TooltipAttribute, UnityEngine.CoreModule + - Name: tooltip + Entry: 1 + Data: Name of the method to be called on each listener + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 42|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 43|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 44|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _nextInvocationFrame + - Name: $v + Entry: 7 + Data: 45|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _nextInvocationFrame + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 46|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _instigator + - Name: $v + Entry: 7 + Data: 47|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _instigator + - Name: k__BackingField + Entry: 9 + Data: 14 + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 48|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 49|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 50|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: FastSync + - Name: $v + Entry: 7 + Data: 51|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: FastSync + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 1 + - Name: + Entry: 7 + Data: 53|UnityEngine.TooltipAttribute, UnityEngine.CoreModule + - Name: tooltip + Entry: 1 + Data: If enabled synchronisation is requested instantly instead of on the next + frame, off by default + - 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: Calls + - Name: $v + Entry: 7 + Data: 54|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Calls + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 3 + Data: 1 + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 55|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 56|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime + - 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: Values + - Name: $v + Entry: 7 + Data: 57|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Values + - Name: k__BackingField + Entry: 7 + Data: 58|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Int32[], mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 58 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 3 + Data: 1 + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 59|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 60|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 61|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: diff --git a/Packages/tlp.udonutils/Runtime/Player/PlayerList.asset.meta b/Packages/tlp.udonutils/Runtime/Player/PlayerList.asset.meta new file mode 100644 index 0000000..8107e77 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Player/PlayerList.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: de61bb1bbef83b8409027ccffd980bc8 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/tlp.udonutils/Runtime/Player/PlayerList.cs b/Packages/tlp.udonutils/Runtime/Player/PlayerList.cs new file mode 100644 index 0000000..16880cf --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Player/PlayerList.cs @@ -0,0 +1,420 @@ +using System; +using TLP.UdonUtils.Sync.SyncedEvents; +using UdonSharp; +using VRC.SDKBase; + +namespace TLP.UdonUtils.Player +{ + [UdonBehaviourSyncMode(BehaviourSyncMode.Manual)] + public class PlayerList : SyncedEventIntArray + { + public int[] Players + { + get => Values; + set => Values = value; + } + + #region public + + /// + /// + /// + /// + /// true if player was added and false if already in the list + public bool AddPlayer(VRCPlayerApi player) + { + int validPlayers = ConsolidatePlayerIds(Players); + + if (!Assert(Utilities.IsValid(player), "Player invalid", this)) + { + ResizePlayerArray(validPlayers); + return false; + } + + if (Players == null || Players.Length == 0) + { + Players = new[] + { + player.playerId + }; + return true; + } + + if (Array.BinarySearch(Players, player.playerId) >= 0) + { + Warn($"Player {player.playerId} already in list"); + ResizePlayerArray(validPlayers); + return false; + } + + int[] tempArray = new int[validPlayers + 1]; + tempArray[0] = player.playerId; + Array.ConstrainedCopy(Players, 0, tempArray, 1, validPlayers); + Players = tempArray; + Sort(Players); + return true; + } + + public bool RemovePlayer(VRCPlayerApi player) + { + int count = ConsolidatePlayerIds(Players); + + if (!Utilities.IsValid(player) + || DiscardInvalid() == 0) + { + ResizePlayerArray(count); + return false; + } + + int playerIndex = Array.BinarySearch(Players, player.playerId); + if (playerIndex < 0) + { + ResizePlayerArray(count); + return false; + } + + int[] tempArray = new int[count - 1]; + + if (playerIndex > 0) + { + Array.ConstrainedCopy(Players, 0, tempArray, 0, playerIndex); + } + + if (tempArray.Length - playerIndex > 0) + { + Array.ConstrainedCopy(Players, playerIndex + 1, tempArray, playerIndex, tempArray.Length - playerIndex); + } + + Players = tempArray; + return true; + } + + public bool Contains(VRCPlayerApi playerApi) + { +#if TLP_DEBUG + DebugLog(nameof(Contains)); +#endif + if (!Utilities.IsValid(playerApi) + || DiscardInvalid() == 0) + { + return false; + } + + return Array.BinarySearch(Players, playerApi.playerId) > -1; + } + + /// + /// + /// + /// number of valid players in the list after disposing of all invalid ids + public int DiscardInvalid() + { + #region TLP_DEBUG + +#if TLP_DEBUG + DebugLog(nameof(DiscardInvalid)); +#endif + + #endregion + + int validPlayers = ConsolidatePlayerIds(Players); + ResizePlayerArray(validPlayers); + return validPlayers; + } + + public void Clear() + { +#if TLP_DEBUG + DebugLog(nameof(Clear)); +#endif + Players = new int[0]; + } + + #endregion + + #region Internal + + internal bool ResizePlayerArray(int length) + { + if (length < 0) + { + return false; + } + + if (Players == null || Players.Length == 0) + { + Players = new int[length]; + for (int i = 0; i < Players.Length; i++) + { + Players[i] = int.MaxValue; + } + + return true; + } + + int copyLength = length > Players.Length ? Players.Length : length; + int[] temp = new int[length]; + Array.ConstrainedCopy(Players, 0, temp, 0, copyLength); + Players = temp; + for (int i = copyLength; i < Players.Length; i++) + { + Players[i] = int.MaxValue; + } + + return true; + } + + internal void Sort(int[] array) + { + if (array == null || array.Length < 2) + { + return; + } + + // BubbleSort(array); + // IterativeQuickSort(array, 0, array.Length - 1); + //MergeSort(array); + HeapSort(array); + } + + #region BubbleSort + + internal void BubbleSort(int[] array) + { + int arrayLength = array.Length; + for (int i = 0; i < arrayLength; i++) + { + for (int j = 0; j < arrayLength - 1; j++) + { + int next = j + 1; + + if (array[j] > array[next]) + { + int tmp = array[j]; + array[j] = array[next]; + array[next] = tmp; + } + } + } + } + + #endregion + + #region Heap Sort + + public static void HeapSort(int[] arr) + { + int n = arr.Length; + + // Build heap (rearrange array) + for (int i = n / 2 - 1; i >= 0; i--) + { + Heapify(arr, n, i); + } + + // One by one extract an element from heap + for (int i = n - 1; i >= 0; i--) + { + // Move current root to end + Swap(arr, 0, i); + + // call max heapify on the reduced heap + Heapify(arr, i, 0); + } + } + + [RecursiveMethod] + private static void Heapify(int[] arr, int n, int i) + { + int largest = i; // Initialize largest as root + int l = 2 * i + 1; // left = 2*i + 1 + int r = 2 * i + 2; // right = 2*i + 2 + + // If left child is larger than root + if (l < n && arr[l] > arr[largest]) + { + largest = l; + } + + // If right child is larger than largest so far + if (r < n && arr[r] > arr[largest]) + { + largest = r; + } + + // If largest is not root + if (largest != i) + { + HsSwap(arr, i, largest); + + // Recursively heapify the affected sub-tree + Heapify(arr, n, largest); + } + } + + private static void HsSwap(int[] arr, int i, int j) + { + int temp = arr[i]; + arr[i] = arr[j]; + arr[j] = temp; + } + + #endregion + + + #region Merge Sort + + public static void MergeSort(int[] array) + { + int n = array.Length; + int[] tempArray = new int[n]; + + for (int size = 1; size < n; size *= 2) + { + for (int left = 0; left < n - size; left += 2 * size) + { + int mid = left + size - 1; + int right = Math.Min(left + 2 * size - 1, n - 1); + + Merge(array, tempArray, left, mid, right); + } + } + } + + private static void Merge(int[] array, int[] tempArray, int left, int mid, int right) + { + int i = left; + int j = mid + 1; + int k = 0; + + while (i <= mid && j <= right) + { + if (array[i] < array[j]) + { + tempArray[k++] = array[i++]; + } + else + { + tempArray[k++] = array[j++]; + } + } + + while (i <= mid) + { + tempArray[k++] = array[i++]; + } + + while (j <= right) + { + tempArray[k++] = array[j++]; + } + + for (i = left, k = 0; i <= right; i++, k++) + { + array[i] = tempArray[k]; + } + } + + #endregion + + #region Iterative QuickSort + + private static void IterativeQuickSort(int[] arr, int left, int right) + { + int[] stack = new int[right - left + 1]; + int top = -1; + + stack[++top] = left; + stack[++top] = right; + + while (top >= 0) + { + right = stack[top--]; + left = stack[top--]; + + int pivotIndex = Partition(arr, left, right); + + if (pivotIndex - 1 > left) + { + stack[++top] = left; + stack[++top] = pivotIndex - 1; + } + + if (pivotIndex + 1 < right) + { + stack[++top] = pivotIndex + 1; + stack[++top] = right; + } + } + } + + private static int Partition(int[] arr, int left, int right) + { + int pivot = arr[right]; + int i = left - 1; + + for (int j = left; j <= right - 1; j++) + { + if (arr[j] < pivot) + { + i++; + Swap(arr, i, j); + } + } + + Swap(arr, i + 1, right); + + return i + 1; + } + + private static void Swap(int[] arr, int i, int j) + { + int temp = arr[i]; + arr[i] = arr[j]; + arr[j] = temp; + } + + #endregion + + + internal int ConsolidatePlayerIds(int[] list) + { + if (list == null) + { + return 0; + } + + int valid = 0; + int moveIndex = -1; + for (int i = 0; i < list.Length; i++) + { + var vrcPlayerApi = VRCPlayerApi.GetPlayerById(list[i]); + if (Utilities.IsValid(vrcPlayerApi)) + { + ++valid; + if (moveIndex != -1) + { + list[moveIndex] = list[i]; + list[i] = int.MaxValue; + ++moveIndex; + } + } + else + { + // ensure that the entry no longer references a valid player + list[i] = int.MaxValue; + if (moveIndex == -1) + { + moveIndex = i; + } + } + } + + return valid; + } + + #endregion + + + } +} \ No newline at end of file diff --git a/Packages/tlp.udonutils/Runtime/Player/PlayerList.cs.meta b/Packages/tlp.udonutils/Runtime/Player/PlayerList.cs.meta new file mode 100644 index 0000000..27cf11c --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Player/PlayerList.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e09db8f78e0643d49b2476e37e4564ee +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Prefabs.meta b/Packages/tlp.udonutils/Runtime/Prefabs.meta similarity index 77% rename from Prefabs.meta rename to Packages/tlp.udonutils/Runtime/Prefabs.meta index 37861ef..7bb7d40 100644 --- a/Prefabs.meta +++ b/Packages/tlp.udonutils/Runtime/Prefabs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: be5f3db055642d24d9af792c0daff386 +guid: 873e92b649e4db24f9d4414b12326e27 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Packages/tlp.udonutils/Runtime/Prefabs/BlackList.prefab b/Packages/tlp.udonutils/Runtime/Prefabs/BlackList.prefab new file mode 100644 index 0000000..07436a7 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Prefabs/BlackList.prefab @@ -0,0 +1,281 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1442694913025329607 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4505952376485496110} + - component: {fileID: 2945190170164097910} + - component: {fileID: 8948932208484565875} + m_Layer: 0 + m_Name: WhiteListedPlayers + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4505952376485496110 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1442694913025329607} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 5282955951685947598} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &2945190170164097910 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1442694913025329607} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6a95d77ea9524c9499e23f1c6f0e121b, type: 3} + m_Name: + m_EditorClassIdentifier: + serializationData: + SerializedFormat: 2 + SerializedBytes: + ReferencedUnityObjects: [] + SerializedBytesString: + Prefab: {fileID: 0} + PrefabModificationsReferencedUnityObjects: [] + PrefabModifications: [] + SerializationNodes: [] + _udonSharpBackingUdonBehaviour: {fileID: 8948932208484565875} + Severity: 3 + EventInstigator: {fileID: 0} + Pool: {fileID: 0} + PoolableInUse: 0 + Listeners: [] + RaiseOnEnable: 0 + RaiseOnStart: 0 + ListenerMethod: OnRaised + FastSync: 0 + Calls: 0 + Values: [] +--- !u!114 &8948932208484565875 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1442694913025329607} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 45115577ef41a5b4ca741ed302693907, type: 3} + m_Name: + m_EditorClassIdentifier: + interactTextPlacement: {fileID: 0} + interactText: Use + interactTextGO: {fileID: 0} + proximity: 2 + SynchronizePosition: 0 + AllowCollisionOwnershipTransfer: 0 + Reliable: 0 + _syncMethod: 3 + serializedProgramAsset: {fileID: 11400000, guid: 79098f38ba326f14195be22cc00656ef, + type: 2} + programSource: {fileID: 11400000, guid: 77a735fdd8cf6ba49aa979e0eb722c64, type: 2} + serializedPublicVariablesBytesString: Ai8AAAAAATIAAABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlAFQAYQBiAGwAZQAsACAAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4AAAAAAAYBAAAAAAAAACcBBAAAAHQAeQBwAGUAAWgAAABTAHkAcwB0AGUAbQAuAEMAbwBsAGwAZQBjAHQAaQBvAG4AcwAuAEcAZQBuAGUAcgBpAGMALgBMAGkAcwB0AGAAMQBbAFsAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4ALgBJAG4AdABlAHIAZgBhAGMAZQBzAC4ASQBVAGQAbwBuAFYAYQByAGkAYQBiAGwAZQAsACAAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4AXQBdACwAIABtAHMAYwBvAHIAbABpAGIAAQEJAAAAVgBhAHIAaQBhAGIAbABlAHMALwEAAAABaAAAAFMAeQBzAHQAZQBtAC4AQwBvAGwAbABlAGMAdABpAG8AbgBzAC4ARwBlAG4AZQByAGkAYwAuAEwAaQBzAHQAYAAxAFsAWwBWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAEkAbgB0AGUAcgBmAGEAYwBlAHMALgBJAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlACwAIABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgBdAF0ALAAgAG0AcwBjAG8AcgBsAGkAYgABAAAABgEAAAAAAAAAAi8CAAAAAUkAAABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlAGAAMQBbAFsAUwB5AHMAdABlAG0ALgBJAG4AdAAzADIALAAgAG0AcwBjAG8AcgBsAGkAYgBdAF0ALAAgAFYAUgBDAC4AVQBkAG8AbgAuAEMAbwBtAG0AbwBuAAIAAAAGAgAAAAAAAAAnAQQAAAB0AHkAcABlAAEXAAAAUwB5AHMAdABlAG0ALgBTAHQAcgBpAG4AZwAsACAAbQBzAGMAbwByAGwAaQBiACcBCgAAAFMAeQBtAGIAbwBsAE4AYQBtAGUAAR8AAABfAF8AXwBVAGQAbwBuAFMAaABhAHIAcABCAGUAaABhAHYAaQBvAHUAcgBWAGUAcgBzAGkAbwBuAF8AXwBfACcBBAAAAHQAeQBwAGUAARYAAABTAHkAcwB0AGUAbQAuAEkAbgB0ADMAMgAsACAAbQBzAGMAbwByAGwAaQBiABcBBQAAAFYAYQBsAHUAZQACAAAABwUHBQcF + publicVariablesUnityEngineObjects: [] + publicVariablesSerializationDataFormat: 0 +--- !u!1 &5572252244580748447 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5282955951685947598} + - component: {fileID: 5266047853028999190} + - component: {fileID: 7907251537392066233} + m_Layer: 0 + m_Name: BlackList + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5282955951685947598 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5572252244580748447} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4505952376485496110} + - {fileID: 7419379726722327803} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5266047853028999190 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5572252244580748447} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ad16e62d55f940899a9e4a9fc2624fce, type: 3} + m_Name: + m_EditorClassIdentifier: + serializationData: + SerializedFormat: 2 + SerializedBytes: + ReferencedUnityObjects: [] + SerializedBytesString: + Prefab: {fileID: 0} + PrefabModificationsReferencedUnityObjects: [] + PrefabModifications: [] + SerializationNodes: [] + _udonSharpBackingUdonBehaviour: {fileID: 7907251537392066233} + Severity: 3 + EventInstigator: {fileID: 0} + Pool: {fileID: 0} + PoolableInUse: 0 + BlackListedPlayers: {fileID: 7235251681700086747} + WhiteListedPlayers: {fileID: 2945190170164097910} + OptionalBlackListUrl: + url: + OptionalWhiteListUrl: + url: + OptionalInitialBlackListedPlayerNames: {fileID: 0} + OptionalInitialWhiteListedPlayerNames: {fileID: 0} + WhitelistMode: 0 + DisallowModifyingWhenBlackListed: 1 + RunTestOnPlayerJoin: 0 +--- !u!114 &7907251537392066233 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5572252244580748447} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 45115577ef41a5b4ca741ed302693907, type: 3} + m_Name: + m_EditorClassIdentifier: + interactTextPlacement: {fileID: 0} + interactText: Use + interactTextGO: {fileID: 0} + proximity: 2 + SynchronizePosition: 0 + AllowCollisionOwnershipTransfer: 0 + Reliable: 0 + _syncMethod: 2 + serializedProgramAsset: {fileID: 11400000, guid: fa659185c4c3be44695d30f5676e5aaa, + type: 2} + programSource: {fileID: 11400000, guid: 1283bd55942bd05459e1751b1c37b944, type: 2} + serializedPublicVariablesBytesString: Ai8AAAAAATIAAABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlAFQAYQBiAGwAZQAsACAAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4AAAAAAAYBAAAAAAAAACcBBAAAAHQAeQBwAGUAAWgAAABTAHkAcwB0AGUAbQAuAEMAbwBsAGwAZQBjAHQAaQBvAG4AcwAuAEcAZQBuAGUAcgBpAGMALgBMAGkAcwB0AGAAMQBbAFsAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4ALgBJAG4AdABlAHIAZgBhAGMAZQBzAC4ASQBVAGQAbwBuAFYAYQByAGkAYQBiAGwAZQAsACAAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4AXQBdACwAIABtAHMAYwBvAHIAbABpAGIAAQEJAAAAVgBhAHIAaQBhAGIAbABlAHMALwEAAAABaAAAAFMAeQBzAHQAZQBtAC4AQwBvAGwAbABlAGMAdABpAG8AbgBzAC4ARwBlAG4AZQByAGkAYwAuAEwAaQBzAHQAYAAxAFsAWwBWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAEkAbgB0AGUAcgBmAGEAYwBlAHMALgBJAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlACwAIABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgBdAF0ALAAgAG0AcwBjAG8AcgBsAGkAYgABAAAABgEAAAAAAAAAAi8CAAAAAUkAAABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlAGAAMQBbAFsAUwB5AHMAdABlAG0ALgBJAG4AdAAzADIALAAgAG0AcwBjAG8AcgBsAGkAYgBdAF0ALAAgAFYAUgBDAC4AVQBkAG8AbgAuAEMAbwBtAG0AbwBuAAIAAAAGAgAAAAAAAAAnAQQAAAB0AHkAcABlAAEXAAAAUwB5AHMAdABlAG0ALgBTAHQAcgBpAG4AZwAsACAAbQBzAGMAbwByAGwAaQBiACcBCgAAAFMAeQBtAGIAbwBsAE4AYQBtAGUAAR8AAABfAF8AXwBVAGQAbwBuAFMAaABhAHIAcABCAGUAaABhAHYAaQBvAHUAcgBWAGUAcgBzAGkAbwBuAF8AXwBfACcBBAAAAHQAeQBwAGUAARYAAABTAHkAcwB0AGUAbQAuAEkAbgB0ADMAMgAsACAAbQBzAGMAbwByAGwAaQBiABcBBQAAAFYAYQBsAHUAZQACAAAABwUHBQcF + publicVariablesUnityEngineObjects: [] + publicVariablesSerializationDataFormat: 0 +--- !u!1 &5664538367531851972 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7419379726722327803} + - component: {fileID: 7235251681700086747} + - component: {fileID: 6708963052229100093} + m_Layer: 0 + m_Name: BlackListedPlayers + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7419379726722327803 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5664538367531851972} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 5282955951685947598} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &7235251681700086747 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5664538367531851972} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6a95d77ea9524c9499e23f1c6f0e121b, type: 3} + m_Name: + m_EditorClassIdentifier: + serializationData: + SerializedFormat: 2 + SerializedBytes: + ReferencedUnityObjects: [] + SerializedBytesString: + Prefab: {fileID: 0} + PrefabModificationsReferencedUnityObjects: [] + PrefabModifications: [] + SerializationNodes: [] + _udonSharpBackingUdonBehaviour: {fileID: 6708963052229100093} + Severity: 3 + EventInstigator: {fileID: 0} + Pool: {fileID: 0} + PoolableInUse: 0 + Listeners: [] + RaiseOnEnable: 0 + RaiseOnStart: 0 + ListenerMethod: OnRaised + FastSync: 0 + Calls: 0 + Values: [] +--- !u!114 &6708963052229100093 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5664538367531851972} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 45115577ef41a5b4ca741ed302693907, type: 3} + m_Name: + m_EditorClassIdentifier: + interactTextPlacement: {fileID: 0} + interactText: Use + interactTextGO: {fileID: 0} + proximity: 2 + SynchronizePosition: 0 + AllowCollisionOwnershipTransfer: 0 + Reliable: 0 + _syncMethod: 3 + serializedProgramAsset: {fileID: 11400000, guid: 79098f38ba326f14195be22cc00656ef, + type: 2} + programSource: {fileID: 11400000, guid: 77a735fdd8cf6ba49aa979e0eb722c64, type: 2} + serializedPublicVariablesBytesString: Ai8AAAAAATIAAABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlAFQAYQBiAGwAZQAsACAAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4AAAAAAAYBAAAAAAAAACcBBAAAAHQAeQBwAGUAAWgAAABTAHkAcwB0AGUAbQAuAEMAbwBsAGwAZQBjAHQAaQBvAG4AcwAuAEcAZQBuAGUAcgBpAGMALgBMAGkAcwB0AGAAMQBbAFsAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4ALgBJAG4AdABlAHIAZgBhAGMAZQBzAC4ASQBVAGQAbwBuAFYAYQByAGkAYQBiAGwAZQAsACAAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4AXQBdACwAIABtAHMAYwBvAHIAbABpAGIAAQEJAAAAVgBhAHIAaQBhAGIAbABlAHMALwEAAAABaAAAAFMAeQBzAHQAZQBtAC4AQwBvAGwAbABlAGMAdABpAG8AbgBzAC4ARwBlAG4AZQByAGkAYwAuAEwAaQBzAHQAYAAxAFsAWwBWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAEkAbgB0AGUAcgBmAGEAYwBlAHMALgBJAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlACwAIABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgBdAF0ALAAgAG0AcwBjAG8AcgBsAGkAYgABAAAABgEAAAAAAAAAAi8CAAAAAUkAAABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlAGAAMQBbAFsAUwB5AHMAdABlAG0ALgBJAG4AdAAzADIALAAgAG0AcwBjAG8AcgBsAGkAYgBdAF0ALAAgAFYAUgBDAC4AVQBkAG8AbgAuAEMAbwBtAG0AbwBuAAIAAAAGAgAAAAAAAAAnAQQAAAB0AHkAcABlAAEXAAAAUwB5AHMAdABlAG0ALgBTAHQAcgBpAG4AZwAsACAAbQBzAGMAbwByAGwAaQBiACcBCgAAAFMAeQBtAGIAbwBsAE4AYQBtAGUAAR8AAABfAF8AXwBVAGQAbwBuAFMAaABhAHIAcABCAGUAaABhAHYAaQBvAHUAcgBWAGUAcgBzAGkAbwBuAF8AXwBfACcBBAAAAHQAeQBwAGUAARYAAABTAHkAcwB0AGUAbQAuAEkAbgB0ADMAMgAsACAAbQBzAGMAbwByAGwAaQBiABcBBQAAAFYAYQBsAHUAZQACAAAABwUHBQcF + publicVariablesUnityEngineObjects: [] + publicVariablesSerializationDataFormat: 0 diff --git a/Prefabs/UdonCommon.prefab.meta b/Packages/tlp.udonutils/Runtime/Prefabs/BlackList.prefab.meta similarity index 74% rename from Prefabs/UdonCommon.prefab.meta rename to Packages/tlp.udonutils/Runtime/Prefabs/BlackList.prefab.meta index 7202c45..f273f35 100644 --- a/Prefabs/UdonCommon.prefab.meta +++ b/Packages/tlp.udonutils/Runtime/Prefabs/BlackList.prefab.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: e9285a00f7474c345bd781c6abf07ba9 +guid: 9f43631b0f7c24e4dab2007df4cbf821 PrefabImporter: externalObjects: {} userData: diff --git a/Packages/tlp.udonutils/Runtime/Prefabs/TLP_Logger.prefab b/Packages/tlp.udonutils/Runtime/Prefabs/TLP_Logger.prefab new file mode 100644 index 0000000..a1790c0 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Prefabs/TLP_Logger.prefab @@ -0,0 +1,89 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &7267592404545306744 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7267592404545306746} + - component: {fileID: 7932554065880862758} + - component: {fileID: -3009787490407523672} + m_Layer: 0 + m_Name: TLP_Logger + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7267592404545306746 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7267592404545306744} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &7932554065880862758 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7267592404545306744} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 43266f688d95c0340a72883e181fea7a, type: 3} + m_Name: + m_EditorClassIdentifier: + serializationData: + SerializedFormat: 2 + SerializedBytes: + ReferencedUnityObjects: [] + SerializedBytesString: + Prefab: {fileID: 0} + PrefabModificationsReferencedUnityObjects: [] + PrefabModifications: [] + SerializationNodes: [] + _udonSharpBackingUdonBehaviour: {fileID: -3009787490407523672} + Severity: 4 + EventInstigator: {fileID: 0} + Pool: {fileID: 0} + PoolableInUse: 0 + DetailedPlayerInfo: 1 + DetailedContextInfo: 1 + CreateDebugFrameLog: 0 +--- !u!114 &-3009787490407523672 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7267592404545306744} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 45115577ef41a5b4ca741ed302693907, type: 3} + m_Name: + m_EditorClassIdentifier: + interactTextPlacement: {fileID: 0} + interactText: Use + interactTextGO: {fileID: 0} + proximity: 2 + SynchronizePosition: 0 + AllowCollisionOwnershipTransfer: 0 + Reliable: 0 + _syncMethod: 2 + serializedProgramAsset: {fileID: 11400000, guid: cb4a4d56777598746b830c4a06d01508, + type: 2} + programSource: {fileID: 11400000, guid: 4f06f9d2e68d8114ab22a62bbf43f319, type: 2} + serializedPublicVariablesBytesString: Ai8AAAAAATIAAABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlAFQAYQBiAGwAZQAsACAAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4AAAAAAAYBAAAAAAAAACcBBAAAAHQAeQBwAGUAAWgAAABTAHkAcwB0AGUAbQAuAEMAbwBsAGwAZQBjAHQAaQBvAG4AcwAuAEcAZQBuAGUAcgBpAGMALgBMAGkAcwB0AGAAMQBbAFsAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4ALgBJAG4AdABlAHIAZgBhAGMAZQBzAC4ASQBVAGQAbwBuAFYAYQByAGkAYQBiAGwAZQAsACAAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4AXQBdACwAIABtAHMAYwBvAHIAbABpAGIAAQEJAAAAVgBhAHIAaQBhAGIAbABlAHMALwEAAAABaAAAAFMAeQBzAHQAZQBtAC4AQwBvAGwAbABlAGMAdABpAG8AbgBzAC4ARwBlAG4AZQByAGkAYwAuAEwAaQBzAHQAYAAxAFsAWwBWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAEkAbgB0AGUAcgBmAGEAYwBlAHMALgBJAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlACwAIABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgBdAF0ALAAgAG0AcwBjAG8AcgBsAGkAYgABAAAABgIAAAAAAAAAAi8CAAAAAUkAAABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlAGAAMQBbAFsAUwB5AHMAdABlAG0ALgBJAG4AdAAzADIALAAgAG0AcwBjAG8AcgBsAGkAYgBdAF0ALAAgAFYAUgBDAC4AVQBkAG8AbgAuAEMAbwBtAG0AbwBuAAIAAAAGAgAAAAAAAAAnAQQAAAB0AHkAcABlAAEXAAAAUwB5AHMAdABlAG0ALgBTAHQAcgBpAG4AZwAsACAAbQBzAGMAbwByAGwAaQBiACcBCgAAAFMAeQBtAGIAbwBsAE4AYQBtAGUAAR8AAABfAF8AXwBVAGQAbwBuAFMAaABhAHIAcABCAGUAaABhAHYAaQBvAHUAcgBWAGUAcgBzAGkAbwBuAF8AXwBfACcBBAAAAHQAeQBwAGUAARYAAABTAHkAcwB0AGUAbQAuAEkAbgB0ADMAMgAsACAAbQBzAGMAbwByAGwAaQBiABcBBQAAAFYAYQBsAHUAZQACAAAABwUCLwMAAAABSwAAAFYAUgBDAC4AVQBkAG8AbgAuAEMAbwBtAG0AbwBuAC4AVQBkAG8AbgBWAGEAcgBpAGEAYgBsAGUAYAAxAFsAWwBTAHkAcwB0AGUAbQAuAEIAbwBvAGwAZQBhAG4ALAAgAG0AcwBjAG8AcgBsAGkAYgBdAF0ALAAgAFYAUgBDAC4AVQBkAG8AbgAuAEMAbwBtAG0AbwBuAAMAAAAGAgAAAAAAAAAnAQQAAAB0AHkAcABlAAEXAAAAUwB5AHMAdABlAG0ALgBTAHQAcgBpAG4AZwAsACAAbQBzAGMAbwByAGwAaQBiACcBCgAAAFMAeQBtAGIAbwBsAE4AYQBtAGUAASsAAABfAF8AXwBVAGQAbwBuAFMAaABhAHIAcABCAGUAaABhAHYAaQBvAHUAcgBIAGEAcwBEAG8AbgBlAFMAYwBlAG4AZQBVAHAAZwByAGEAZABlAF8AXwBfACcBBAAAAHQAeQBwAGUAARgAAABTAHkAcwB0AGUAbQAuAEIAbwBvAGwAZQBhAG4ALAAgAG0AcwBjAG8AcgBsAGkAYgArAQUAAABWAGEAbAB1AGUAAQcFBwUHBQ== + publicVariablesUnityEngineObjects: [] + publicVariablesSerializationDataFormat: 0 diff --git a/Prefabs/ILookAtTheLocalPlayer.prefab.meta b/Packages/tlp.udonutils/Runtime/Prefabs/TLP_Logger.prefab.meta similarity index 74% rename from Prefabs/ILookAtTheLocalPlayer.prefab.meta rename to Packages/tlp.udonutils/Runtime/Prefabs/TLP_Logger.prefab.meta index 923e228..e1d544a 100644 --- a/Prefabs/ILookAtTheLocalPlayer.prefab.meta +++ b/Packages/tlp.udonutils/Runtime/Prefabs/TLP_Logger.prefab.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: c37760ba6c479a640a62f1d11cba4560 +guid: 9aa3664ebac948042a90fd58d2355175 PrefabImporter: externalObjects: {} userData: diff --git a/Packages/tlp.udonutils/Runtime/Prefabs/TLP_NetworkTime.prefab b/Packages/tlp.udonutils/Runtime/Prefabs/TLP_NetworkTime.prefab new file mode 100644 index 0000000..82db17f --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Prefabs/TLP_NetworkTime.prefab @@ -0,0 +1,89 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &3998673604075715721 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7353425252576164752} + - component: {fileID: 6353367027617780638} + - component: {fileID: 7652272344857267978} + m_Layer: 2 + m_Name: TLP_NetworkTime + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 4294967295 + m_IsActive: 1 +--- !u!4 &7353425252576164752 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3998673604075715721} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &6353367027617780638 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3998673604075715721} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 45990c67ea094d78a242286122c11715, type: 3} + m_Name: + m_EditorClassIdentifier: + serializationData: + SerializedFormat: 2 + SerializedBytes: + ReferencedUnityObjects: [] + SerializedBytesString: + Prefab: {fileID: 0} + PrefabModificationsReferencedUnityObjects: [] + PrefabModifications: [] + SerializationNodes: [] + _udonSharpBackingUdonBehaviour: {fileID: 7652272344857267978} + Severity: 2 + EventInstigator: {fileID: 0} + Pool: {fileID: 0} + PoolableInUse: 0 + UseOwnServerTime: 0 + SyncedMasterTime: 0 + SyncInterval: 15 +--- !u!114 &7652272344857267978 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3998673604075715721} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 45115577ef41a5b4ca741ed302693907, type: 3} + m_Name: + m_EditorClassIdentifier: + interactTextPlacement: {fileID: 0} + interactText: Use + interactTextGO: {fileID: 0} + proximity: 2 + SynchronizePosition: 0 + AllowCollisionOwnershipTransfer: 0 + Reliable: 0 + _syncMethod: 3 + serializedProgramAsset: {fileID: 11400000, guid: 6f8d1123d681bfb42ba100e8cca07419, + type: 2} + programSource: {fileID: 11400000, guid: c0ca3e6c22fee2540a8bd4729b9e98e7, type: 2} + serializedPublicVariablesBytesString: Ai8AAAAAATIAAABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlAFQAYQBiAGwAZQAsACAAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4AAAAAAAYBAAAAAAAAACcBBAAAAHQAeQBwAGUAAWgAAABTAHkAcwB0AGUAbQAuAEMAbwBsAGwAZQBjAHQAaQBvAG4AcwAuAEcAZQBuAGUAcgBpAGMALgBMAGkAcwB0AGAAMQBbAFsAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4ALgBJAG4AdABlAHIAZgBhAGMAZQBzAC4ASQBVAGQAbwBuAFYAYQByAGkAYQBiAGwAZQAsACAAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4AXQBdACwAIABtAHMAYwBvAHIAbABpAGIAAQEJAAAAVgBhAHIAaQBhAGIAbABlAHMALwEAAAABaAAAAFMAeQBzAHQAZQBtAC4AQwBvAGwAbABlAGMAdABpAG8AbgBzAC4ARwBlAG4AZQByAGkAYwAuAEwAaQBzAHQAYAAxAFsAWwBWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAEkAbgB0AGUAcgBmAGEAYwBlAHMALgBJAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlACwAIABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgBdAF0ALAAgAG0AcwBjAG8AcgBsAGkAYgABAAAABgEAAAAAAAAAAi8CAAAAAUkAAABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlAGAAMQBbAFsAUwB5AHMAdABlAG0ALgBJAG4AdAAzADIALAAgAG0AcwBjAG8AcgBsAGkAYgBdAF0ALAAgAFYAUgBDAC4AVQBkAG8AbgAuAEMAbwBtAG0AbwBuAAIAAAAGAgAAAAAAAAAnAQQAAAB0AHkAcABlAAEXAAAAUwB5AHMAdABlAG0ALgBTAHQAcgBpAG4AZwAsACAAbQBzAGMAbwByAGwAaQBiACcBCgAAAFMAeQBtAGIAbwBsAE4AYQBtAGUAAR8AAABfAF8AXwBVAGQAbwBuAFMAaABhAHIAcABCAGUAaABhAHYAaQBvAHUAcgBWAGUAcgBzAGkAbwBuAF8AXwBfACcBBAAAAHQAeQBwAGUAARYAAABTAHkAcwB0AGUAbQAuAEkAbgB0ADMAMgAsACAAbQBzAGMAbwByAGwAaQBiABcBBQAAAFYAYQBsAHUAZQACAAAABwUHBQcF + publicVariablesUnityEngineObjects: [] + publicVariablesSerializationDataFormat: 0 diff --git a/Prefabs/ILookAtTheLocalPlayerUdonGraph.prefab.meta b/Packages/tlp.udonutils/Runtime/Prefabs/TLP_NetworkTime.prefab.meta similarity index 74% rename from Prefabs/ILookAtTheLocalPlayerUdonGraph.prefab.meta rename to Packages/tlp.udonutils/Runtime/Prefabs/TLP_NetworkTime.prefab.meta index 1128a06..ef51efd 100644 --- a/Prefabs/ILookAtTheLocalPlayerUdonGraph.prefab.meta +++ b/Packages/tlp.udonutils/Runtime/Prefabs/TLP_NetworkTime.prefab.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: f1c4a76783eadf74bb0ec9e4e89cdc0c +guid: 74db761ed76dac04188103d5ff12572c PrefabImporter: externalObjects: {} userData: diff --git a/Scenes.meta b/Packages/tlp.udonutils/Runtime/Scenes.meta similarity index 77% rename from Scenes.meta rename to Packages/tlp.udonutils/Runtime/Scenes.meta index 29f2ee1..2823a56 100644 --- a/Scenes.meta +++ b/Packages/tlp.udonutils/Runtime/Scenes.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: c60c4baa668df094899576a833cd1438 +guid: 1fffa34b0ce1f0f4e8a0a3a6879498cc folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Scripts/Examples.meta b/Packages/tlp.udonutils/Runtime/Scenes/Examples.meta similarity index 77% rename from Scripts/Examples.meta rename to Packages/tlp.udonutils/Runtime/Scenes/Examples.meta index 7b2ca53..4e0025b 100644 --- a/Scripts/Examples.meta +++ b/Packages/tlp.udonutils/Runtime/Scenes/Examples.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 4feef0aa5ac16e34e99cf4ed1ea4ae6c +guid: 6fc023a47f136d64ca4022f60e569f35 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Packages/tlp.udonutils/Runtime/Scenes/Examples/BlackListing.meta b/Packages/tlp.udonutils/Runtime/Scenes/Examples/BlackListing.meta new file mode 100644 index 0000000..52f1934 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Scenes/Examples/BlackListing.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 783500001fd988c46a338e9000ae1d59 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/tlp.udonutils/Runtime/Scenes/Examples/BlackListing/DemoBlackListToggle.asset b/Packages/tlp.udonutils/Runtime/Scenes/Examples/BlackListing/DemoBlackListToggle.asset new file mode 100644 index 0000000..79516b0 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Scenes/Examples/BlackListing/DemoBlackListToggle.asset @@ -0,0 +1,587 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3} + m_Name: DemoBlackListToggle + m_EditorClassIdentifier: + serializedUdonProgramAsset: {fileID: 11400000, guid: 0dd576717d427ea49a5a44ddceb674f3, + type: 2} + udonAssembly: + assemblyError: + sourceCsScript: {fileID: 11500000, guid: d059cfc1960275945be609d0234fba07, type: 3} + scriptVersion: 2 + compiledVersion: 2 + behaviourSyncMode: 1 + hasInteractEvent: 0 + scriptID: -3392681707186647654 + serializationData: + SerializedFormat: 2 + SerializedBytes: + ReferencedUnityObjects: [] + SerializedBytesString: + Prefab: {fileID: 0} + PrefabModificationsReferencedUnityObjects: [] + PrefabModifications: [] + SerializationNodes: + - Name: fieldDefinitions + Entry: 7 + Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition, + UdonSharp.Editor]], mscorlib + - Name: comparer + Entry: 7 + Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String, + mscorlib]], mscorlib + - Name: + Entry: 8 + Data: + - Name: + Entry: 12 + Data: 9 + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: PendingSerializations + - Name: $v + Entry: 7 + Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: PendingSerializations + - Name: k__BackingField + Entry: 7 + Data: 3|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Int32, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 4|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: Severity + - Name: $v + Entry: 7 + Data: 5|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Severity + - Name: k__BackingField + Entry: 7 + Data: 6|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.Logger.ELogLevel, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: 7|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 8|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 9|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 7 + Data: 10|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.Logger.TlpLogger, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: 11|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: VRC.Udon.UdonBehaviour, VRC.Udon + - Name: + Entry: 8 + Data: + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 12|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: EventInstigator + - Name: $v + Entry: 7 + Data: 13|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: EventInstigator + - Name: k__BackingField + Entry: 7 + Data: 14|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.TlpBaseBehaviour, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: 15|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 3 + - Name: + Entry: 7 + Data: 16|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 17|UnityEngine.HideInInspector, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 18|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - 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: Pool + - Name: $v + Entry: 7 + Data: 19|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Pool + - Name: k__BackingField + Entry: 9 + Data: 14 + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: 20|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 3 + - Name: + Entry: 7 + Data: 21|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 22|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 23|UnityEngine.HideInInspector, UnityEngine.CoreModule + - 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: PoolableInUse + - Name: $v + Entry: 7 + Data: 24|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: PoolableInUse + - Name: k__BackingField + Entry: 7 + Data: 25|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Boolean, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 26|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 27|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 28|UnityEngine.HideInInspector, UnityEngine.CoreModule + - 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: WhiteListButton + - Name: $v + Entry: 7 + Data: 29|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: WhiteListButton + - Name: k__BackingField + Entry: 7 + Data: 30|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: UnityEngine.UI.Button, UnityEngine.UI + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 30 + - 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: 31|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: BlackListButton + - Name: $v + Entry: 7 + Data: 32|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: BlackListButton + - Name: k__BackingField + Entry: 9 + Data: 30 + - Name: k__BackingField + Entry: 9 + Data: 30 + - 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: 33|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: PlayerBlackList + - Name: $v + Entry: 7 + Data: 34|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: PlayerBlackList + - Name: k__BackingField + Entry: 7 + Data: 35|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.Player.PlayerBlackList, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: 36|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: diff --git a/Packages/tlp.udonutils/Runtime/Scenes/Examples/BlackListing/DemoBlackListToggle.asset.meta b/Packages/tlp.udonutils/Runtime/Scenes/Examples/BlackListing/DemoBlackListToggle.asset.meta new file mode 100644 index 0000000..03c601a --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Scenes/Examples/BlackListing/DemoBlackListToggle.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b35a7dbb4e652f748a8bd23a38b21abb +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/tlp.udonutils/Runtime/Scenes/Examples/BlackListing/DemoBlackListToggle.cs b/Packages/tlp.udonutils/Runtime/Scenes/Examples/BlackListing/DemoBlackListToggle.cs new file mode 100644 index 0000000..a9da775 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Scenes/Examples/BlackListing/DemoBlackListToggle.cs @@ -0,0 +1,69 @@ +using System; +using JetBrains.Annotations; +using TLP.UdonUtils; +using TLP.UdonUtils.Extensions; +using TLP.UdonUtils.Player; +using UdonSharp; +using UnityEngine; +using UnityEngine.UI; +using VRC.SDKBase; +using VRC.Udon; + +[DefaultExecutionOrder(ExecutionOrder)] +[UdonBehaviourSyncMode(BehaviourSyncMode.None)] +public class DemoBlackListToggle : TlpBaseBehaviour +{ + protected override int ExecutionOrderReadOnly => ExecutionOrder; + + [PublicAPI] + public new const int ExecutionOrder = TlpExecutionOrder.UiStart; + + public Button WhiteListButton; + public Button BlackListButton; + + public PlayerBlackList PlayerBlackList; + + public void OnEnable() + { + WhiteListButton.gameObject.SetActive(PlayerBlackList.IsBlackListed(Networking.LocalPlayer.DisplayNameSafe())); + BlackListButton.gameObject.SetActive(PlayerBlackList.IsWhiteListed(Networking.LocalPlayer.DisplayNameSafe())); + } + + [PublicAPI] + public void AddLocalPlayerToBlackList() + { + #region TLP_DEBUG + +#if TLP_DEBUG + DebugLog(nameof(AddLocalPlayerToBlackList)); +#endif + + #endregion + + if (!PlayerBlackList.AddToBlackList(Networking.LocalPlayer.DisplayNameSafe())) + { + Warn($"Failed to add '{Networking.LocalPlayer.DisplayNameSafe()}' to blacklist"); + } + + OnEnable(); + } + + [PublicAPI] + public void AddLocalPlayerToWhiteList() + { + #region TLP_DEBUG + +#if TLP_DEBUG + DebugLog(nameof(AddLocalPlayerToWhiteList)); +#endif + + #endregion + + if (!PlayerBlackList.AddToWhiteList(Networking.LocalPlayer.DisplayNameSafe())) + { + Warn($"Failed to add '{Networking.LocalPlayer.DisplayNameSafe()}' to whitelist"); + } + + OnEnable(); + } +} \ No newline at end of file diff --git a/Packages/tlp.udonutils/Runtime/Scenes/Examples/BlackListing/DemoBlackListToggle.cs.meta b/Packages/tlp.udonutils/Runtime/Scenes/Examples/BlackListing/DemoBlackListToggle.cs.meta new file mode 100644 index 0000000..6bf2db9 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Scenes/Examples/BlackListing/DemoBlackListToggle.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d059cfc1960275945be609d0234fba07 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/tlp.udonutils/Runtime/Sync.meta b/Packages/tlp.udonutils/Runtime/Sync.meta new file mode 100644 index 0000000..f4c67e0 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Sync.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 42443f615d233884b84729880bcda07b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/tlp.udonutils/Runtime/Sync/NetworkTime.asset b/Packages/tlp.udonutils/Runtime/Sync/NetworkTime.asset new file mode 100644 index 0000000..8b8631a --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Sync/NetworkTime.asset @@ -0,0 +1,1049 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3} + m_Name: NetworkTime + m_EditorClassIdentifier: + serializedUdonProgramAsset: {fileID: 11400000, guid: 634b0cba14bfb1a41bf93a191f93d659, + type: 2} + udonAssembly: + assemblyError: + sourceCsScript: {fileID: 11500000, guid: 45990c67ea094d78a242286122c11715, type: 3} + scriptVersion: 2 + compiledVersion: 2 + behaviourSyncMode: 4 + hasInteractEvent: 0 + scriptID: -2079866603995555484 + serializationData: + SerializedFormat: 2 + SerializedBytes: + ReferencedUnityObjects: [] + SerializedBytesString: + Prefab: {fileID: 0} + PrefabModificationsReferencedUnityObjects: [] + PrefabModifications: [] + SerializationNodes: + - Name: fieldDefinitions + Entry: 7 + Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition, + UdonSharp.Editor]], mscorlib + - Name: comparer + Entry: 7 + Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String, + mscorlib]], mscorlib + - Name: + Entry: 8 + Data: + - Name: + Entry: 12 + Data: 18 + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: PendingSerializations + - Name: $v + Entry: 7 + Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: PendingSerializations + - Name: k__BackingField + Entry: 7 + Data: 3|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Int32, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 4|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: Severity + - Name: $v + Entry: 7 + Data: 5|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Severity + - Name: k__BackingField + Entry: 7 + Data: 6|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.Logger.ELogLevel, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: 7|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 8|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 9|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 7 + Data: 10|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.Logger.TlpLogger, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: 11|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: VRC.Udon.UdonBehaviour, VRC.Udon + - Name: + Entry: 8 + Data: + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 12|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: EventInstigator + - Name: $v + Entry: 7 + Data: 13|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: EventInstigator + - Name: k__BackingField + Entry: 7 + Data: 14|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.TlpBaseBehaviour, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: 15|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 3 + - Name: + Entry: 7 + Data: 16|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 17|UnityEngine.HideInInspector, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 18|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - 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: Pool + - Name: $v + Entry: 7 + Data: 19|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Pool + - Name: k__BackingField + Entry: 9 + Data: 14 + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: 20|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 3 + - Name: + Entry: 7 + Data: 21|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 22|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 23|UnityEngine.HideInInspector, UnityEngine.CoreModule + - 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: PoolableInUse + - Name: $v + Entry: 7 + Data: 24|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: PoolableInUse + - Name: k__BackingField + Entry: 7 + Data: 25|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Boolean, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 26|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 27|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 28|UnityEngine.HideInInspector, UnityEngine.CoreModule + - 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: UseOwnServerTime + - Name: $v + Entry: 7 + Data: 29|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: UseOwnServerTime + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 30|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 31|UnityEngine.SerializeField, UnityEngine.CoreModule + - 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: SyncedMasterTime + - Name: $v + Entry: 7 + Data: 32|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: SyncedMasterTime + - Name: k__BackingField + Entry: 7 + Data: 33|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Double, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 33 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 3 + Data: 1 + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 34|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 35|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 36|UnityEngine.SerializeField, UnityEngine.CoreModule + - 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: _lastUpdate + - Name: $v + Entry: 7 + Data: 37|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _lastUpdate + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 38|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _vrcServerTime + - Name: $v + Entry: 7 + Data: 39|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _vrcServerTime + - Name: k__BackingField + Entry: 9 + Data: 33 + - Name: k__BackingField + Entry: 9 + Data: 33 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 40|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _realTime + - Name: $v + Entry: 7 + Data: 41|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _realTime + - Name: k__BackingField + Entry: 7 + Data: 42|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Diagnostics.Stopwatch, System + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 42 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 43|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _latestRealTimeSnapshot + - Name: $v + Entry: 7 + Data: 44|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _latestRealTimeSnapshot + - Name: k__BackingField + Entry: 9 + Data: 33 + - Name: k__BackingField + Entry: 9 + Data: 33 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 45|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _serverTimeCurrentFrame + - Name: $v + Entry: 7 + Data: 46|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _serverTimeCurrentFrame + - Name: k__BackingField + Entry: 9 + Data: 33 + - Name: k__BackingField + Entry: 9 + Data: 33 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 47|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _vrcServerTimeCurrentFrame + - Name: $v + Entry: 7 + Data: 48|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _vrcServerTimeCurrentFrame + - Name: k__BackingField + Entry: 9 + Data: 33 + - Name: k__BackingField + Entry: 9 + Data: 33 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 49|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _nextSerialization + - Name: $v + Entry: 7 + Data: 50|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _nextSerialization + - Name: k__BackingField + Entry: 7 + Data: 51|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Single, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 51 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 52|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _realTimeCurrentFrame + - Name: $v + Entry: 7 + Data: 53|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _realTimeCurrentFrame + - Name: k__BackingField + Entry: 9 + Data: 51 + - Name: k__BackingField + Entry: 9 + Data: 51 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 54|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: SyncInterval + - Name: $v + Entry: 7 + Data: 55|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: SyncInterval + - Name: k__BackingField + Entry: 9 + Data: 51 + - Name: k__BackingField + Entry: 9 + Data: 51 + - 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: 56|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 57|UnityEngine.SerializeField, UnityEngine.CoreModule + - 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: _averageDelta + - Name: $v + Entry: 7 + Data: 58|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _averageDelta + - Name: k__BackingField + Entry: 9 + Data: 33 + - Name: k__BackingField + Entry: 9 + Data: 33 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 59|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: diff --git a/Packages/tlp.udonutils/Runtime/Sync/NetworkTime.asset.meta b/Packages/tlp.udonutils/Runtime/Sync/NetworkTime.asset.meta new file mode 100644 index 0000000..10c169c --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Sync/NetworkTime.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c0ca3e6c22fee2540a8bd4729b9e98e7 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/tlp.udonutils/Runtime/Sync/NetworkTime.cs b/Packages/tlp.udonutils/Runtime/Sync/NetworkTime.cs new file mode 100644 index 0000000..61e96be --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Sync/NetworkTime.cs @@ -0,0 +1,253 @@ +using System; +using System.Diagnostics; +using JetBrains.Annotations; +using TLP.UdonUtils.Extensions; +using TLP.UdonUtils.Logger; +using UdonSharp; +using UnityEngine; +using VRC.SDKBase; +using VRC.Udon.Common; + +namespace TLP.UdonUtils.Sync +{ + [UdonBehaviourSyncMode(BehaviourSyncMode.Manual)] + [DefaultExecutionOrder(ExecutionOrder)] + public class NetworkTime : TlpBaseBehaviour + { + [SerializeField] + private bool UseOwnServerTime; + + protected override int ExecutionOrderReadOnly => ExecutionOrder; + + [PublicAPI] + public new const int ExecutionOrder = TlpLogger.ExecutionOrder + 1; + + [UdonSynced] + [SerializeField] + private double SyncedMasterTime; + + private int _lastUpdate; + private double _vrcServerTime; + private readonly Stopwatch _realTime = new Stopwatch(); + private double _latestRealTimeSnapshot; + private double _serverTimeCurrentFrame; + private double _vrcServerTimeCurrentFrame; + private float _nextSerialization; + private float _realTimeCurrentFrame; + + + [SerializeField] + private float SyncInterval = 15f; + + private void OnEnable() + { + #region TLP_DEBUG + +#if TLP_DEBUG + DebugLog(nameof(OnEnable)); +#endif + + #endregion + + _realTime.Start(); + _vrcServerTime = Networking.GetServerTimeInMilliseconds() * 0.001; + _CreateNewSnapshot(0, 0); + } + + public double GetTimeForCurrentFrame() + { + #region TLP_DEBUG + +#if TLP_DEBUG + DebugLog(nameof(GetTimeForCurrentFrame)); +#endif + + #endregion + + double timeForCurrentFrame = _GetTimeForCurrentFrame(); + if (Math.Abs(_averageDelta) > 0.01) + { + // temporarily return the less accurate time with ms accuracy until the _averageDelta has settled + Warn($"Time accuracy still exceeds 10 ms: {_averageDelta * 1000}ms"); + return Networking.GetServerTimeInMilliseconds() * 0.001; + } + + return timeForCurrentFrame + _averageDelta; + } + + public float GetRealTimeForCurrentFrame() + { + #region TLP_DEBUG + +#if TLP_DEBUG + DebugLog(nameof(GetRealTimeForCurrentFrame)); +#endif + + #endregion + + + double _ = _GetTimeForCurrentFrame(); + + return _realTimeCurrentFrame; + } + + public double GetVrcServerTimeForCurrentFrame() + { + #region TLP_DEBUG + +#if TLP_DEBUG + DebugLog(nameof(GetVrcServerTimeForCurrentFrame)); +#endif + + #endregion + + + double _ = _GetTimeForCurrentFrame(); + + return _vrcServerTimeCurrentFrame; + } + + public double GetVrcServerTimeDelta => _vrcServerTimeCurrentFrame - GetTimeForCurrentFrame(); + + private double _GetTimeForCurrentFrame() + { + #region TLP_DEBUG + +#if TLP_DEBUG + DebugLog(nameof(_GetTimeForCurrentFrame)); +#endif + + #endregion + + if (Time.frameCount == _lastUpdate) + { + // already calculated + return _serverTimeCurrentFrame; + } + + _lastUpdate = Time.frameCount; + _realTimeCurrentFrame = Time.realtimeSinceStartup; + _vrcServerTimeCurrentFrame = Networking.GetServerTimeInMilliseconds() * 0.001; + double secondsSinceStart = _realTime.Elapsed.TotalSeconds; + double secondsSinceLastSnapShot = secondsSinceStart - _latestRealTimeSnapshot; + if (Math.Abs(secondsSinceLastSnapShot) > SyncInterval) + { + _CreateNewSnapshot(secondsSinceStart, secondsSinceLastSnapShot); + } + else + { + _serverTimeCurrentFrame = _vrcServerTime + secondsSinceLastSnapShot; + } + + if (UseOwnServerTime && Networking.IsOwner(gameObject) && Time.timeSinceLevelLoad > _nextSerialization) + { + _nextSerialization = Time.timeSinceLevelLoad + 0.5f; + RequestSerialization(); + } + + return _serverTimeCurrentFrame; + } + + private void _CreateNewSnapshot(double secondsSinceStart, double secondsSinceLastSnapShot) + { + #region TLP_DEBUG + +#if TLP_DEBUG + DebugLog(nameof(_CreateNewSnapshot)); +#endif + + #endregion + + _latestRealTimeSnapshot = secondsSinceStart; + + double expectedTime = _vrcServerTime + secondsSinceLastSnapShot; + _vrcServerTime = _vrcServerTime + secondsSinceLastSnapShot + _averageDelta; + _averageDelta = 0; + + double drift = expectedTime - _vrcServerTime; + if (Math.Abs(drift) > 0.01) + { + Warn($"Time drift exceeded 10 ms: {drift * 1000} ms"); + } +#if TLP_DEBUG + DebugLog($"Time drift: {drift * 1000} ms"); +#endif + _serverTimeCurrentFrame = _vrcServerTime; + } + + private double _averageDelta; + private void Update() + { + #region TLP_DEBUG + +#if TLP_DEBUG + DebugLog(nameof(Update)); +#endif + + #endregion + + if (UseOwnServerTime) + { + if (Networking.LocalPlayer.isMaster && !Networking.IsOwner(gameObject)) + { + Networking.SetOwner(Networking.LocalPlayer, gameObject); + } + + if (!Networking.IsOwner(gameObject)) + { + return; + } + } + + + _UpdateDrift(GetVrcServerTimeForCurrentFrame()); + } + + private void _UpdateDrift(double vrcServerTime) + { + double currentTime = _GetTimeForCurrentFrame(); + double delta = vrcServerTime - currentTime; + if (Math.Abs(_averageDelta - delta) > 1) + { + _averageDelta = delta; + } + else + { + _averageDelta = 0.001 * delta + 0.999 * _averageDelta; + } +#if TLP_DEBUG + if (Time.frameCount % 60 == 0) + { + Info( + $"Real nt: {vrcServerTime:F5}s; " + + $"Own nt: {currentTime:F5}s; " + + $"Corrected own nt: {GetTimeForCurrentFrame():F5}s; " + + $"dt: {delta * 1000:F2}ms; " + + $"Avg. dt: {_averageDelta * 1000:F2}ms" + ); + } +#endif + } + + + public override void OnPreSerialization() + { + base.OnPreSerialization(); + if (UseOwnServerTime) + { + SyncedMasterTime = _serverTimeCurrentFrame + (Time.realtimeSinceStartup - _realTimeCurrentFrame); + } + } + + public override void OnDeserialization(DeserializationResult deserializationResult) + { + base.OnDeserialization(deserializationResult); + + if (UseOwnServerTime) + { + double masterServerTime = deserializationResult.Latency() + SyncedMasterTime; + _UpdateDrift(masterServerTime); + } + } + } +} \ No newline at end of file diff --git a/Packages/tlp.udonutils/Runtime/Sync/NetworkTime.cs.meta b/Packages/tlp.udonutils/Runtime/Sync/NetworkTime.cs.meta new file mode 100644 index 0000000..7c32467 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Sync/NetworkTime.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 45990c67ea094d78a242286122c11715 +timeCreated: 1690579540 \ No newline at end of file diff --git a/Packages/tlp.udonutils/Runtime/Sync/OwnershipTransfer.cs b/Packages/tlp.udonutils/Runtime/Sync/OwnershipTransfer.cs new file mode 100644 index 0000000..5b8d8f2 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Sync/OwnershipTransfer.cs @@ -0,0 +1,156 @@ +using TLP.UdonUtils.Common; +using UdonSharp; +using UnityEngine; +using VRC.SDK3.Components; +using VRC.SDKBase; +using VRC.Udon; + +namespace TLP.UdonUtils.Sync +{ + public static class OwnershipTransfer + { + /// + /// Changes the ownership of the entire hierarchy of the GameObject provided, including all relevant parents + /// and their children + /// + /// + /// + /// If set to true it is checked that we are the owner after ownership transfer, + /// if transfer was denied then false is returned. + /// If set to false the result of the ownership transfer is ignored and true is returned + /// True on success or false of transfer failed or is incomplete + public static bool TransferOwnership(GameObject go, VRCPlayerApi newOwner, bool requireTransferSuccess) + { + return TransferOwnershipFrom(go, null, newOwner, requireTransferSuccess); + } + + public static bool TransferOwnershipFrom( + GameObject go, + GameObject start, + VRCPlayerApi newOwner, + bool requireTransferSuccess + ) + { + if (!Utilities.IsValid(go)) + { + Debug.LogError($"{nameof(TransferOwnership)}: Invalid gameobject"); + return !requireTransferSuccess; + } + + if (!Utilities.IsValid(newOwner)) + { + Debug.LogError($"{nameof(TransferOwnership)}: Invalid new owner"); + return !requireTransferSuccess; + } + + Component topBehaviour; + if (!Utilities.IsValid(start)) + { + // find the top most udon behaviour + topBehaviour = UdonCommon.FindTopComponent(typeof(UdonBehaviour), go.transform); + if (!Utilities.IsValid(topBehaviour)) + { + Debug.LogWarning( + $"{nameof(TransferOwnership)}: GameObject {go.name} " + + $"has no parent UdonBehaviour which could change ownership" + ); + + topBehaviour = UdonCommon.FindTopComponent(typeof(UdonSharpBehaviour), go.transform); + if (!Utilities.IsValid(topBehaviour)) + { + Debug.LogError( + $"{nameof(TransferOwnership)}: GameObject {go.name} " + + $"also has no parent UdonSharpBehaviour which could change ownership" + ); + return false; + } + } + } + else + { + topBehaviour = start.transform; + } + + + var allTransforms = topBehaviour.transform.GetComponentsInChildren(true); + + if (allTransforms == null || allTransforms.Length == 0) + { + Debug.LogError( + $"{nameof(TransferOwnership)}: GameObject {go.name} " + + $"has no udon behaviours it its hierarchy" + ); + return false; + } + + bool anyFailures = false; + int newOwnerPlayerId = newOwner.playerId; + + foreach (var childTransform in allTransforms) + { + if (!Utilities.IsValid(childTransform)) + { + Debug.LogWarning($"{nameof(TransferOwnership)}: invalid transform found. Skipping."); + continue; + } + + var childGo = childTransform.gameObject; + // make sure to not overload the network by only taking ownership of objects that have synced components + if (Utilities.IsValid(childGo.GetComponent(typeof(UdonBehaviour))) + || Utilities.IsValid(childGo.GetComponent(typeof(UdonSharpBehaviour))) + || Utilities.IsValid(childGo.GetComponent(typeof(VRC.SDKBase.VRCStation))) + || Utilities.IsValid(childGo.GetComponent(typeof(VRC_Pickup))) + || Utilities.IsValid(childGo.GetComponent(typeof(VRCObjectSync)))) + { + int oldOwnerId = -1; + var oldOwner = Networking.GetOwner(childTransform.gameObject); + if (Utilities.IsValid(oldOwner)) + { + oldOwnerId = oldOwner.playerId; + } + + Debug.Log( + $"{nameof(TransferOwnership)}: setting owner of " + + $"'{childTransform.gameObject.name}' " + + $"from player {oldOwnerId} to player {newOwnerPlayerId}" + ); + + if (!Networking.IsOwner(childTransform.gameObject)) + { + Networking.SetOwner(newOwner, childTransform.gameObject); + + // check, if required whether we are the owner now + if (requireTransferSuccess && !Networking.IsOwner(childTransform.gameObject)) + { + anyFailures = true; + } + } + } + } + + return !requireTransferSuccess || !anyFailures; + } + + public static bool TakeOwnership(this UdonSharpBehaviour behaviour) + { + return Utilities.IsValid(behaviour) && behaviour.gameObject.TakeOwnership(); + } + + public static bool TakeOwnership(this GameObject gameObject) + { + if (!Utilities.IsValid(gameObject)) + { + return false; + } + + var vrcPlayerApi = Networking.LocalPlayer; + if (Networking.IsOwner(vrcPlayerApi, gameObject)) + { + return true; + } + + Networking.SetOwner(vrcPlayerApi, gameObject); + return Networking.IsOwner(vrcPlayerApi, gameObject); + } + } +} \ No newline at end of file diff --git a/Packages/tlp.udonutils/Runtime/Sync/OwnershipTransfer.cs.meta b/Packages/tlp.udonutils/Runtime/Sync/OwnershipTransfer.cs.meta new file mode 100644 index 0000000..4cb73d1 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Sync/OwnershipTransfer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fd5fbfc5cfc648088b9f4d0a579f38e9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents.meta b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents.meta new file mode 100644 index 0000000..649ab0a --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2b085b3def8953f44b9a9da7412c2f39 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEvent.asset b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEvent.asset new file mode 100644 index 0000000..cbbedb6 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEvent.asset @@ -0,0 +1,966 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3} + m_Name: SyncedEvent + m_EditorClassIdentifier: + serializedUdonProgramAsset: {fileID: 11400000, guid: 9972fdd2b707fe346959a1f28ab10cb3, + type: 2} + udonAssembly: + assemblyError: + sourceCsScript: {fileID: 11500000, guid: 64666944214747afa5ceb92bfdf6af6a, type: 3} + scriptVersion: 2 + compiledVersion: 2 + behaviourSyncMode: 4 + hasInteractEvent: 0 + scriptID: -6228987107858273628 + serializationData: + SerializedFormat: 2 + SerializedBytes: + ReferencedUnityObjects: [] + SerializedBytesString: + Prefab: {fileID: 0} + PrefabModificationsReferencedUnityObjects: [] + PrefabModifications: [] + SerializationNodes: + - Name: fieldDefinitions + Entry: 7 + Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition, + UdonSharp.Editor]], mscorlib + - Name: comparer + Entry: 7 + Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String, + mscorlib]], mscorlib + - Name: + Entry: 8 + Data: + - Name: + Entry: 12 + Data: 16 + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: PendingSerializations + - Name: $v + Entry: 7 + Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: PendingSerializations + - Name: k__BackingField + Entry: 7 + Data: 3|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Int32, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 4|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: Severity + - Name: $v + Entry: 7 + Data: 5|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Severity + - Name: k__BackingField + Entry: 7 + Data: 6|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.Logger.ELogLevel, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: 7|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 8|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 9|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 7 + Data: 10|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.Logger.TlpLogger, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: 11|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: VRC.Udon.UdonBehaviour, VRC.Udon + - Name: + Entry: 8 + Data: + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 12|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: EventInstigator + - Name: $v + Entry: 7 + Data: 13|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: EventInstigator + - Name: k__BackingField + Entry: 7 + Data: 14|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.TlpBaseBehaviour, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: 15|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 3 + - Name: + Entry: 7 + Data: 16|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 17|UnityEngine.HideInInspector, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 18|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - 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: Pool + - Name: $v + Entry: 7 + Data: 19|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Pool + - Name: k__BackingField + Entry: 9 + Data: 14 + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: 20|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 3 + - Name: + Entry: 7 + Data: 21|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 22|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 23|UnityEngine.HideInInspector, UnityEngine.CoreModule + - 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: PoolableInUse + - Name: $v + Entry: 7 + Data: 24|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: PoolableInUse + - Name: k__BackingField + Entry: 7 + Data: 25|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Boolean, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 26|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 27|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 28|UnityEngine.HideInInspector, UnityEngine.CoreModule + - 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: Listeners + - Name: $v + Entry: 7 + Data: 29|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Listeners + - Name: k__BackingField + Entry: 7 + Data: 30|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.TlpBaseBehaviour[], TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: 31|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: UnityEngine.Component[], UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - 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: 32|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 33|UnityEngine.SerializeField, UnityEngine.CoreModule + - 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: RaiseOnEnable + - Name: $v + Entry: 7 + Data: 34|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: RaiseOnEnable + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 35|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: RaiseOnStart + - Name: $v + Entry: 7 + Data: 36|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: RaiseOnStart + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 37|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: ListenerMethod + - Name: $v + Entry: 7 + Data: 38|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: ListenerMethod + - Name: k__BackingField + Entry: 7 + Data: 39|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.String, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 39 + - 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: 40|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 41|UnityEngine.TooltipAttribute, UnityEngine.CoreModule + - Name: tooltip + Entry: 1 + Data: Name of the method to be called on each listener + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 42|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 43|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 44|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _nextInvocationFrame + - Name: $v + Entry: 7 + Data: 45|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _nextInvocationFrame + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 46|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _instigator + - Name: $v + Entry: 7 + Data: 47|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _instigator + - Name: k__BackingField + Entry: 9 + Data: 14 + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 48|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 49|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 50|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: FastSync + - Name: $v + Entry: 7 + Data: 51|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: FastSync + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 1 + - Name: + Entry: 7 + Data: 53|UnityEngine.TooltipAttribute, UnityEngine.CoreModule + - Name: tooltip + Entry: 1 + Data: If enabled synchronisation is requested instantly instead of on the next + frame, off by default + - 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: Calls + - Name: $v + Entry: 7 + Data: 54|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Calls + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 3 + Data: 1 + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 55|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 56|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: diff --git a/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEvent.asset.meta b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEvent.asset.meta new file mode 100644 index 0000000..7ea9089 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEvent.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 754195db25415454eb46f7cab9b591ad +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEvent.cs b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEvent.cs new file mode 100644 index 0000000..25f8cdb --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEvent.cs @@ -0,0 +1,109 @@ +using JetBrains.Annotations; +using TLP.UdonUtils.Events; +using UdonSharp; +using UnityEngine; +using VRC.Udon.Common; + +namespace TLP.UdonUtils.Sync.SyncedEvents +{ + [UdonBehaviourSyncMode(BehaviourSyncMode.Manual)] + [DefaultExecutionOrder(ExecutionOrder)] + public class SyncedEvent : UdonEvent + { + #region Executionorder + + protected override int ExecutionOrderReadOnly => ExecutionOrder; + + [PublicAPI] + public new const int ExecutionOrder = TlpExecutionOrder.DefaultStart + 1; + + [Tooltip( + "If enabled synchronisation is requested instantly instead of on the next frame, " + + "off by default" + )] + public bool FastSync; + + #endregion + + [UdonSynced] + public int Calls; + + /// + /// Raises the event locally and remotely + /// + /// + /// + public override bool Raise(TlpBaseBehaviour instigator) + { + if (!MarkNetworkDirty()) + { + // as this is a networked event treat it as a failure when the player can not request sync + return false; + } + + if (!base.Raise(instigator)) + { + DropPendingSerializations(); + return false; + } + + ++Calls; // can be changed here as the actual sync request is delayed by one frame + if (FastSync) + { + // skip the default delay of 1 frame imposed by MarkNetworkDirty(), may lead to more network traffic + RequestSerialization(); + } + + return true; + } + + /// + /// Raises the event on all non-local clients + /// + /// + /// + public bool RaiseRemoteOnly(TlpBaseBehaviour instigator) + { + #region TLP_DEBUG + +#if TLP_DEBUG + DebugLog(nameof(RaiseRemoteOnly)); +#endif + + #endregion + + if (!MarkNetworkDirty()) + { + // as this is a networked event treat it as a failure when the player can not request sync + return false; + } + + ++Calls; // can be changed here as the actual sync request is delayed by one frame + if (FastSync) + { + // skip the default delay of 1 frame imposed by MarkNetworkDirty(), may lead to more network traffic + RequestSerialization(); + } + + return true; + } + + public override void OnDeserialization(DeserializationResult deserializationResult) + { + base.OnDeserialization(deserializationResult); + + // raise without requesting another serialization by using the base implementation + base.Raise(this); + } + + public override void OnPostSerialization(SerializationResult result) + { + base.OnPostSerialization(result); + + if (result.success) + { + Calls = 0; + } + } + } +} \ No newline at end of file diff --git a/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEvent.cs.meta b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEvent.cs.meta new file mode 100644 index 0000000..59373e2 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEvent.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 64666944214747afa5ceb92bfdf6af6a +timeCreated: 1687117612 \ No newline at end of file diff --git a/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventBool.asset b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventBool.asset new file mode 100644 index 0000000..c647bf1 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventBool.asset @@ -0,0 +1,1026 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3} + m_Name: SyncedEventBool + m_EditorClassIdentifier: + serializedUdonProgramAsset: {fileID: 11400000, guid: d25b882e7190d6f44aacba7e7359fc98, + type: 2} + udonAssembly: + assemblyError: + sourceCsScript: {fileID: 11500000, guid: e7f24cbd18d0429eb5b4955428266e03, type: 3} + scriptVersion: 2 + compiledVersion: 2 + behaviourSyncMode: 4 + hasInteractEvent: 0 + scriptID: -2793295714587266486 + serializationData: + SerializedFormat: 2 + SerializedBytes: + ReferencedUnityObjects: [] + SerializedBytesString: + Prefab: {fileID: 0} + PrefabModificationsReferencedUnityObjects: [] + PrefabModifications: [] + SerializationNodes: + - Name: fieldDefinitions + Entry: 7 + Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition, + UdonSharp.Editor]], mscorlib + - Name: comparer + Entry: 7 + Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String, + mscorlib]], mscorlib + - Name: + Entry: 8 + Data: + - Name: + Entry: 12 + Data: 17 + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: PendingSerializations + - Name: $v + Entry: 7 + Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: PendingSerializations + - Name: k__BackingField + Entry: 7 + Data: 3|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Int32, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 4|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: Severity + - Name: $v + Entry: 7 + Data: 5|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Severity + - Name: k__BackingField + Entry: 7 + Data: 6|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.Logger.ELogLevel, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: 7|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 8|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 9|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 7 + Data: 10|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.Logger.TlpLogger, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: 11|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: VRC.Udon.UdonBehaviour, VRC.Udon + - Name: + Entry: 8 + Data: + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 12|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: EventInstigator + - Name: $v + Entry: 7 + Data: 13|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: EventInstigator + - Name: k__BackingField + Entry: 7 + Data: 14|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.TlpBaseBehaviour, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: 15|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 3 + - Name: + Entry: 7 + Data: 16|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 17|UnityEngine.HideInInspector, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 18|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - 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: Pool + - Name: $v + Entry: 7 + Data: 19|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Pool + - Name: k__BackingField + Entry: 9 + Data: 14 + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: 20|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 3 + - Name: + Entry: 7 + Data: 21|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 22|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 23|UnityEngine.HideInInspector, UnityEngine.CoreModule + - 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: PoolableInUse + - Name: $v + Entry: 7 + Data: 24|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: PoolableInUse + - Name: k__BackingField + Entry: 7 + Data: 25|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Boolean, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 26|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 27|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 28|UnityEngine.HideInInspector, UnityEngine.CoreModule + - 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: Listeners + - Name: $v + Entry: 7 + Data: 29|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Listeners + - Name: k__BackingField + Entry: 7 + Data: 30|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.TlpBaseBehaviour[], TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: 31|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: UnityEngine.Component[], UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - 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: 32|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 33|UnityEngine.SerializeField, UnityEngine.CoreModule + - 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: RaiseOnEnable + - Name: $v + Entry: 7 + Data: 34|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: RaiseOnEnable + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 35|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: RaiseOnStart + - Name: $v + Entry: 7 + Data: 36|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: RaiseOnStart + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 37|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: ListenerMethod + - Name: $v + Entry: 7 + Data: 38|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: ListenerMethod + - Name: k__BackingField + Entry: 7 + Data: 39|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.String, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 39 + - 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: 40|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 41|UnityEngine.TooltipAttribute, UnityEngine.CoreModule + - Name: tooltip + Entry: 1 + Data: Name of the method to be called on each listener + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 42|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 43|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 44|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _nextInvocationFrame + - Name: $v + Entry: 7 + Data: 45|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _nextInvocationFrame + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 46|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _instigator + - Name: $v + Entry: 7 + Data: 47|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _instigator + - Name: k__BackingField + Entry: 9 + Data: 14 + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 48|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 49|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 50|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: FastSync + - Name: $v + Entry: 7 + Data: 51|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: FastSync + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 1 + - Name: + Entry: 7 + Data: 53|UnityEngine.TooltipAttribute, UnityEngine.CoreModule + - Name: tooltip + Entry: 1 + Data: If enabled synchronisation is requested instantly instead of on the next + frame, off by default + - 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: Calls + - Name: $v + Entry: 7 + Data: 54|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Calls + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 3 + Data: 1 + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 55|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 56|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime + - 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: Value + - Name: $v + Entry: 7 + Data: 57|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Value + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 3 + Data: 1 + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 58|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 59|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 60|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: diff --git a/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventBool.asset.meta b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventBool.asset.meta new file mode 100644 index 0000000..a652ceb --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventBool.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 86bac5e28acf55745bef8956d6209da4 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventBool.cs b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventBool.cs new file mode 100644 index 0000000..54a9dcc --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventBool.cs @@ -0,0 +1,15 @@ +using JetBrains.Annotations; +using UdonSharp; +using UnityEngine; + +namespace TLP.UdonUtils.Sync.SyncedEvents +{ + [UdonBehaviourSyncMode(BehaviourSyncMode.Manual)] + [DefaultExecutionOrder(ExecutionOrder)] + public class SyncedEventBool : SyncedEvent + { + [PublicAPI] + [UdonSynced] + public bool Value; + } +} \ No newline at end of file diff --git a/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventBool.cs.meta b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventBool.cs.meta new file mode 100644 index 0000000..07bbb46 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventBool.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: e7f24cbd18d0429eb5b4955428266e03 +timeCreated: 1687550028 \ No newline at end of file diff --git a/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventDouble.asset b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventDouble.asset new file mode 100644 index 0000000..c898683 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventDouble.asset @@ -0,0 +1,1032 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3} + m_Name: SyncedEventDouble + m_EditorClassIdentifier: + serializedUdonProgramAsset: {fileID: 11400000, guid: b44bfedf84e4f5448ae1cba704c0dae7, + type: 2} + udonAssembly: + assemblyError: + sourceCsScript: {fileID: 11500000, guid: a4fc1b7ad6f5494b9567befc2c6a9463, type: 3} + scriptVersion: 2 + compiledVersion: 2 + behaviourSyncMode: 4 + hasInteractEvent: 0 + scriptID: 5078100993476646364 + serializationData: + SerializedFormat: 2 + SerializedBytes: + ReferencedUnityObjects: [] + SerializedBytesString: + Prefab: {fileID: 0} + PrefabModificationsReferencedUnityObjects: [] + PrefabModifications: [] + SerializationNodes: + - Name: fieldDefinitions + Entry: 7 + Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition, + UdonSharp.Editor]], mscorlib + - Name: comparer + Entry: 7 + Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String, + mscorlib]], mscorlib + - Name: + Entry: 8 + Data: + - Name: + Entry: 12 + Data: 17 + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: PendingSerializations + - Name: $v + Entry: 7 + Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: PendingSerializations + - Name: k__BackingField + Entry: 7 + Data: 3|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Int32, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 4|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: Severity + - Name: $v + Entry: 7 + Data: 5|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Severity + - Name: k__BackingField + Entry: 7 + Data: 6|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.Logger.ELogLevel, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: 7|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 8|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 9|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 7 + Data: 10|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.Logger.TlpLogger, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: 11|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: VRC.Udon.UdonBehaviour, VRC.Udon + - Name: + Entry: 8 + Data: + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 12|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: EventInstigator + - Name: $v + Entry: 7 + Data: 13|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: EventInstigator + - Name: k__BackingField + Entry: 7 + Data: 14|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.TlpBaseBehaviour, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: 15|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 3 + - Name: + Entry: 7 + Data: 16|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 17|UnityEngine.HideInInspector, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 18|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - 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: Pool + - Name: $v + Entry: 7 + Data: 19|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Pool + - Name: k__BackingField + Entry: 9 + Data: 14 + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: 20|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 3 + - Name: + Entry: 7 + Data: 21|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 22|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 23|UnityEngine.HideInInspector, UnityEngine.CoreModule + - 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: PoolableInUse + - Name: $v + Entry: 7 + Data: 24|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: PoolableInUse + - Name: k__BackingField + Entry: 7 + Data: 25|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Boolean, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 26|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 27|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 28|UnityEngine.HideInInspector, UnityEngine.CoreModule + - 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: Listeners + - Name: $v + Entry: 7 + Data: 29|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Listeners + - Name: k__BackingField + Entry: 7 + Data: 30|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.TlpBaseBehaviour[], TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: 31|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: UnityEngine.Component[], UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - 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: 32|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 33|UnityEngine.SerializeField, UnityEngine.CoreModule + - 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: RaiseOnEnable + - Name: $v + Entry: 7 + Data: 34|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: RaiseOnEnable + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 35|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: RaiseOnStart + - Name: $v + Entry: 7 + Data: 36|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: RaiseOnStart + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 37|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: ListenerMethod + - Name: $v + Entry: 7 + Data: 38|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: ListenerMethod + - Name: k__BackingField + Entry: 7 + Data: 39|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.String, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 39 + - 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: 40|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 41|UnityEngine.TooltipAttribute, UnityEngine.CoreModule + - Name: tooltip + Entry: 1 + Data: Name of the method to be called on each listener + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 42|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 43|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 44|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _nextInvocationFrame + - Name: $v + Entry: 7 + Data: 45|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _nextInvocationFrame + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 46|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _instigator + - Name: $v + Entry: 7 + Data: 47|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _instigator + - Name: k__BackingField + Entry: 9 + Data: 14 + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 48|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 49|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 50|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: FastSync + - Name: $v + Entry: 7 + Data: 51|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: FastSync + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 1 + - Name: + Entry: 7 + Data: 53|UnityEngine.TooltipAttribute, UnityEngine.CoreModule + - Name: tooltip + Entry: 1 + Data: If enabled synchronisation is requested instantly instead of on the next + frame, off by default + - 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: Calls + - Name: $v + Entry: 7 + Data: 54|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Calls + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 3 + Data: 1 + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 55|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 56|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime + - 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: Value + - Name: $v + Entry: 7 + Data: 57|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Value + - Name: k__BackingField + Entry: 7 + Data: 58|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Double, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 58 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 3 + Data: 1 + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 59|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 60|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 61|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: diff --git a/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventDouble.asset.meta b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventDouble.asset.meta new file mode 100644 index 0000000..bc74a00 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventDouble.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 48f8a7528456bda4fb4810a74ea6018c +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventDouble.cs b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventDouble.cs new file mode 100644 index 0000000..0484497 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventDouble.cs @@ -0,0 +1,15 @@ +using JetBrains.Annotations; +using UdonSharp; +using UnityEngine; + +namespace TLP.UdonUtils.Sync.SyncedEvents +{ + [UdonBehaviourSyncMode(BehaviourSyncMode.Manual)] + [DefaultExecutionOrder(ExecutionOrder)] + public class SyncedEventDouble : SyncedEvent + { + [PublicAPI] + [UdonSynced] + public double Value; + } +} \ No newline at end of file diff --git a/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventDouble.cs.meta b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventDouble.cs.meta new file mode 100644 index 0000000..a952845 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventDouble.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: a4fc1b7ad6f5494b9567befc2c6a9463 +timeCreated: 1687550353 \ No newline at end of file diff --git a/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventFloat.asset b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventFloat.asset new file mode 100644 index 0000000..a9da23a --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventFloat.asset @@ -0,0 +1,1032 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3} + m_Name: SyncedEventFloat + m_EditorClassIdentifier: + serializedUdonProgramAsset: {fileID: 11400000, guid: d19bf3bac1e7ff04e8d4c787dbdee69b, + type: 2} + udonAssembly: + assemblyError: + sourceCsScript: {fileID: 11500000, guid: 9b1458a4eaa846b69073087a19c86f25, type: 3} + scriptVersion: 2 + compiledVersion: 2 + behaviourSyncMode: 4 + hasInteractEvent: 0 + scriptID: -5370709378228247622 + serializationData: + SerializedFormat: 2 + SerializedBytes: + ReferencedUnityObjects: [] + SerializedBytesString: + Prefab: {fileID: 0} + PrefabModificationsReferencedUnityObjects: [] + PrefabModifications: [] + SerializationNodes: + - Name: fieldDefinitions + Entry: 7 + Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition, + UdonSharp.Editor]], mscorlib + - Name: comparer + Entry: 7 + Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String, + mscorlib]], mscorlib + - Name: + Entry: 8 + Data: + - Name: + Entry: 12 + Data: 17 + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: PendingSerializations + - Name: $v + Entry: 7 + Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: PendingSerializations + - Name: k__BackingField + Entry: 7 + Data: 3|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Int32, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 4|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: Severity + - Name: $v + Entry: 7 + Data: 5|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Severity + - Name: k__BackingField + Entry: 7 + Data: 6|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.Logger.ELogLevel, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: 7|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 8|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 9|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 7 + Data: 10|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.Logger.TlpLogger, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: 11|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: VRC.Udon.UdonBehaviour, VRC.Udon + - Name: + Entry: 8 + Data: + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 12|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: EventInstigator + - Name: $v + Entry: 7 + Data: 13|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: EventInstigator + - Name: k__BackingField + Entry: 7 + Data: 14|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.TlpBaseBehaviour, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: 15|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 3 + - Name: + Entry: 7 + Data: 16|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 17|UnityEngine.HideInInspector, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 18|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - 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: Pool + - Name: $v + Entry: 7 + Data: 19|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Pool + - Name: k__BackingField + Entry: 9 + Data: 14 + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: 20|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 3 + - Name: + Entry: 7 + Data: 21|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 22|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 23|UnityEngine.HideInInspector, UnityEngine.CoreModule + - 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: PoolableInUse + - Name: $v + Entry: 7 + Data: 24|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: PoolableInUse + - Name: k__BackingField + Entry: 7 + Data: 25|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Boolean, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 26|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 27|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 28|UnityEngine.HideInInspector, UnityEngine.CoreModule + - 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: Listeners + - Name: $v + Entry: 7 + Data: 29|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Listeners + - Name: k__BackingField + Entry: 7 + Data: 30|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.TlpBaseBehaviour[], TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: 31|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: UnityEngine.Component[], UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - 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: 32|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 33|UnityEngine.SerializeField, UnityEngine.CoreModule + - 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: RaiseOnEnable + - Name: $v + Entry: 7 + Data: 34|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: RaiseOnEnable + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 35|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: RaiseOnStart + - Name: $v + Entry: 7 + Data: 36|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: RaiseOnStart + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 37|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: ListenerMethod + - Name: $v + Entry: 7 + Data: 38|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: ListenerMethod + - Name: k__BackingField + Entry: 7 + Data: 39|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.String, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 39 + - 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: 40|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 41|UnityEngine.TooltipAttribute, UnityEngine.CoreModule + - Name: tooltip + Entry: 1 + Data: Name of the method to be called on each listener + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 42|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 43|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 44|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _nextInvocationFrame + - Name: $v + Entry: 7 + Data: 45|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _nextInvocationFrame + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 46|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _instigator + - Name: $v + Entry: 7 + Data: 47|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _instigator + - Name: k__BackingField + Entry: 9 + Data: 14 + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 48|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 49|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 50|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: FastSync + - Name: $v + Entry: 7 + Data: 51|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: FastSync + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 1 + - Name: + Entry: 7 + Data: 53|UnityEngine.TooltipAttribute, UnityEngine.CoreModule + - Name: tooltip + Entry: 1 + Data: If enabled synchronisation is requested instantly instead of on the next + frame, off by default + - 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: Calls + - Name: $v + Entry: 7 + Data: 54|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Calls + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 3 + Data: 1 + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 55|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 56|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime + - 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: Value + - Name: $v + Entry: 7 + Data: 57|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Value + - Name: k__BackingField + Entry: 7 + Data: 58|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Single, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 58 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 3 + Data: 1 + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 59|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 60|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 61|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: diff --git a/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventFloat.asset.meta b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventFloat.asset.meta new file mode 100644 index 0000000..f0b14f4 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventFloat.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: dfad1df8db705f24a87a495a863b9ae3 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventFloat.cs b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventFloat.cs new file mode 100644 index 0000000..96a7b4d --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventFloat.cs @@ -0,0 +1,15 @@ +using JetBrains.Annotations; +using UdonSharp; +using UnityEngine; + +namespace TLP.UdonUtils.Sync.SyncedEvents +{ + [UdonBehaviourSyncMode(BehaviourSyncMode.Manual)] + [DefaultExecutionOrder(ExecutionOrder)] + public class SyncedEventFloat : SyncedEvent + { + [PublicAPI] + [UdonSynced] + public float Value; + } +} \ No newline at end of file diff --git a/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventFloat.cs.meta b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventFloat.cs.meta new file mode 100644 index 0000000..226ed70 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventFloat.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 9b1458a4eaa846b69073087a19c86f25 +timeCreated: 1687550328 \ No newline at end of file diff --git a/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventInt.asset b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventInt.asset new file mode 100644 index 0000000..5961bcf --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventInt.asset @@ -0,0 +1,1026 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3} + m_Name: SyncedEventInt + m_EditorClassIdentifier: + serializedUdonProgramAsset: {fileID: 11400000, guid: 90954748697f6074c9f9b911a693c7d7, + type: 2} + udonAssembly: + assemblyError: + sourceCsScript: {fileID: 11500000, guid: e0f786a8681a491697e9a6f16b81be5f, type: 3} + scriptVersion: 2 + compiledVersion: 2 + behaviourSyncMode: 4 + hasInteractEvent: 0 + scriptID: -6518366009285739174 + serializationData: + SerializedFormat: 2 + SerializedBytes: + ReferencedUnityObjects: [] + SerializedBytesString: + Prefab: {fileID: 0} + PrefabModificationsReferencedUnityObjects: [] + PrefabModifications: [] + SerializationNodes: + - Name: fieldDefinitions + Entry: 7 + Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition, + UdonSharp.Editor]], mscorlib + - Name: comparer + Entry: 7 + Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String, + mscorlib]], mscorlib + - Name: + Entry: 8 + Data: + - Name: + Entry: 12 + Data: 17 + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: PendingSerializations + - Name: $v + Entry: 7 + Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: PendingSerializations + - Name: k__BackingField + Entry: 7 + Data: 3|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Int32, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 4|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: Severity + - Name: $v + Entry: 7 + Data: 5|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Severity + - Name: k__BackingField + Entry: 7 + Data: 6|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.Logger.ELogLevel, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: 7|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 8|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 9|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 7 + Data: 10|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.Logger.TlpLogger, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: 11|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: VRC.Udon.UdonBehaviour, VRC.Udon + - Name: + Entry: 8 + Data: + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 12|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: EventInstigator + - Name: $v + Entry: 7 + Data: 13|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: EventInstigator + - Name: k__BackingField + Entry: 7 + Data: 14|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.TlpBaseBehaviour, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: 15|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 3 + - Name: + Entry: 7 + Data: 16|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 17|UnityEngine.HideInInspector, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 18|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - 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: Pool + - Name: $v + Entry: 7 + Data: 19|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Pool + - Name: k__BackingField + Entry: 9 + Data: 14 + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: 20|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 3 + - Name: + Entry: 7 + Data: 21|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 22|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 23|UnityEngine.HideInInspector, UnityEngine.CoreModule + - 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: PoolableInUse + - Name: $v + Entry: 7 + Data: 24|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: PoolableInUse + - Name: k__BackingField + Entry: 7 + Data: 25|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Boolean, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 26|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 27|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 28|UnityEngine.HideInInspector, UnityEngine.CoreModule + - 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: Listeners + - Name: $v + Entry: 7 + Data: 29|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Listeners + - Name: k__BackingField + Entry: 7 + Data: 30|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.TlpBaseBehaviour[], TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: 31|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: UnityEngine.Component[], UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - 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: 32|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 33|UnityEngine.SerializeField, UnityEngine.CoreModule + - 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: RaiseOnEnable + - Name: $v + Entry: 7 + Data: 34|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: RaiseOnEnable + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 35|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: RaiseOnStart + - Name: $v + Entry: 7 + Data: 36|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: RaiseOnStart + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 37|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: ListenerMethod + - Name: $v + Entry: 7 + Data: 38|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: ListenerMethod + - Name: k__BackingField + Entry: 7 + Data: 39|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.String, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 39 + - 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: 40|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 41|UnityEngine.TooltipAttribute, UnityEngine.CoreModule + - Name: tooltip + Entry: 1 + Data: Name of the method to be called on each listener + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 42|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 43|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 44|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _nextInvocationFrame + - Name: $v + Entry: 7 + Data: 45|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _nextInvocationFrame + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 46|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _instigator + - Name: $v + Entry: 7 + Data: 47|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _instigator + - Name: k__BackingField + Entry: 9 + Data: 14 + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 48|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 49|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 50|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: FastSync + - Name: $v + Entry: 7 + Data: 51|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: FastSync + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 1 + - Name: + Entry: 7 + Data: 53|UnityEngine.TooltipAttribute, UnityEngine.CoreModule + - Name: tooltip + Entry: 1 + Data: If enabled synchronisation is requested instantly instead of on the next + frame, off by default + - 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: Calls + - Name: $v + Entry: 7 + Data: 54|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Calls + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 3 + Data: 1 + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 55|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 56|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime + - 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: Value + - Name: $v + Entry: 7 + Data: 57|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Value + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 3 + Data: 1 + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 58|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 59|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 60|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: diff --git a/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventInt.asset.meta b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventInt.asset.meta new file mode 100644 index 0000000..6e12aa2 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventInt.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8a5bd5a001c1281498462c655a9db654 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventInt.cs b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventInt.cs new file mode 100644 index 0000000..e248174 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventInt.cs @@ -0,0 +1,15 @@ +using JetBrains.Annotations; +using UdonSharp; +using UnityEngine; + +namespace TLP.UdonUtils.Sync.SyncedEvents +{ + [UdonBehaviourSyncMode(BehaviourSyncMode.Manual)] + [DefaultExecutionOrder(ExecutionOrder)] + public class SyncedEventInt : SyncedEvent + { + [PublicAPI] + [UdonSynced] + public int Value; + } +} \ No newline at end of file diff --git a/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventInt.cs.meta b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventInt.cs.meta new file mode 100644 index 0000000..3e8f5d2 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventInt.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: e0f786a8681a491697e9a6f16b81be5f +timeCreated: 1687122298 \ No newline at end of file diff --git a/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventIntArray.asset b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventIntArray.asset new file mode 100644 index 0000000..5a8a16e --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventIntArray.asset @@ -0,0 +1,1032 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3} + m_Name: SyncedEventIntArray + m_EditorClassIdentifier: + serializedUdonProgramAsset: {fileID: 11400000, guid: b15558f56487c2d4d8c0f11455d937fe, + type: 2} + udonAssembly: + assemblyError: + sourceCsScript: {fileID: 11500000, guid: e2d8d5505af049718d00140ce43ae29c, type: 3} + scriptVersion: 2 + compiledVersion: 2 + behaviourSyncMode: 4 + hasInteractEvent: 0 + scriptID: -9090892128845929912 + serializationData: + SerializedFormat: 2 + SerializedBytes: + ReferencedUnityObjects: [] + SerializedBytesString: + Prefab: {fileID: 0} + PrefabModificationsReferencedUnityObjects: [] + PrefabModifications: [] + SerializationNodes: + - Name: fieldDefinitions + Entry: 7 + Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition, + UdonSharp.Editor]], mscorlib + - Name: comparer + Entry: 7 + Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String, + mscorlib]], mscorlib + - Name: + Entry: 8 + Data: + - Name: + Entry: 12 + Data: 17 + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: PendingSerializations + - Name: $v + Entry: 7 + Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: PendingSerializations + - Name: k__BackingField + Entry: 7 + Data: 3|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Int32, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 4|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: Severity + - Name: $v + Entry: 7 + Data: 5|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Severity + - Name: k__BackingField + Entry: 7 + Data: 6|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.Logger.ELogLevel, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: 7|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 8|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 9|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 7 + Data: 10|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.Logger.TlpLogger, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: 11|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: VRC.Udon.UdonBehaviour, VRC.Udon + - Name: + Entry: 8 + Data: + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 12|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: EventInstigator + - Name: $v + Entry: 7 + Data: 13|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: EventInstigator + - Name: k__BackingField + Entry: 7 + Data: 14|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.TlpBaseBehaviour, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: 15|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 3 + - Name: + Entry: 7 + Data: 16|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 17|UnityEngine.HideInInspector, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 18|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - 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: Pool + - Name: $v + Entry: 7 + Data: 19|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Pool + - Name: k__BackingField + Entry: 9 + Data: 14 + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: 20|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 3 + - Name: + Entry: 7 + Data: 21|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 22|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 23|UnityEngine.HideInInspector, UnityEngine.CoreModule + - 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: PoolableInUse + - Name: $v + Entry: 7 + Data: 24|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: PoolableInUse + - Name: k__BackingField + Entry: 7 + Data: 25|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Boolean, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 26|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 27|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 28|UnityEngine.HideInInspector, UnityEngine.CoreModule + - 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: Listeners + - Name: $v + Entry: 7 + Data: 29|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Listeners + - Name: k__BackingField + Entry: 7 + Data: 30|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.TlpBaseBehaviour[], TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: 31|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: UnityEngine.Component[], UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - 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: 32|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 33|UnityEngine.SerializeField, UnityEngine.CoreModule + - 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: RaiseOnEnable + - Name: $v + Entry: 7 + Data: 34|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: RaiseOnEnable + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 35|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: RaiseOnStart + - Name: $v + Entry: 7 + Data: 36|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: RaiseOnStart + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 37|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: ListenerMethod + - Name: $v + Entry: 7 + Data: 38|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: ListenerMethod + - Name: k__BackingField + Entry: 7 + Data: 39|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.String, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 39 + - 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: 40|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 41|UnityEngine.TooltipAttribute, UnityEngine.CoreModule + - Name: tooltip + Entry: 1 + Data: Name of the method to be called on each listener + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 42|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 43|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 44|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _nextInvocationFrame + - Name: $v + Entry: 7 + Data: 45|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _nextInvocationFrame + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 46|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _instigator + - Name: $v + Entry: 7 + Data: 47|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _instigator + - Name: k__BackingField + Entry: 9 + Data: 14 + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 48|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 49|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 50|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: FastSync + - Name: $v + Entry: 7 + Data: 51|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: FastSync + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 1 + - Name: + Entry: 7 + Data: 53|UnityEngine.TooltipAttribute, UnityEngine.CoreModule + - Name: tooltip + Entry: 1 + Data: If enabled synchronisation is requested instantly instead of on the next + frame, off by default + - 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: Calls + - Name: $v + Entry: 7 + Data: 54|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Calls + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 3 + Data: 1 + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 55|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 56|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime + - 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: Values + - Name: $v + Entry: 7 + Data: 57|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Values + - Name: k__BackingField + Entry: 7 + Data: 58|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Int32[], mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 58 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 3 + Data: 1 + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 59|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 60|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 61|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: diff --git a/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventIntArray.asset.meta b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventIntArray.asset.meta new file mode 100644 index 0000000..90b6bf8 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventIntArray.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 616453d4987e26b4eb66ed8347b56e27 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventIntArray.cs b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventIntArray.cs new file mode 100644 index 0000000..a03f625 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventIntArray.cs @@ -0,0 +1,15 @@ +using JetBrains.Annotations; +using UdonSharp; +using UnityEngine; + +namespace TLP.UdonUtils.Sync.SyncedEvents +{ + [UdonBehaviourSyncMode(BehaviourSyncMode.Manual)] + [DefaultExecutionOrder(ExecutionOrder)] + public class SyncedEventIntArray : SyncedEvent + { + [PublicAPI] + [UdonSynced] + public int[] Values = new int[0]; + } +} \ No newline at end of file diff --git a/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventIntArray.cs.meta b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventIntArray.cs.meta new file mode 100644 index 0000000..c0ec73a --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventIntArray.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: e2d8d5505af049718d00140ce43ae29c +timeCreated: 1687550088 \ No newline at end of file diff --git a/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventString.asset b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventString.asset new file mode 100644 index 0000000..cc321c7 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventString.asset @@ -0,0 +1,1026 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3} + m_Name: SyncedEventString + m_EditorClassIdentifier: + serializedUdonProgramAsset: {fileID: 11400000, guid: 2c99786c9d35c0141b268d2ac7263802, + type: 2} + udonAssembly: + assemblyError: + sourceCsScript: {fileID: 11500000, guid: 7484d8449b6344b093f447749e01871f, type: 3} + scriptVersion: 2 + compiledVersion: 2 + behaviourSyncMode: 4 + hasInteractEvent: 0 + scriptID: 2098068930761303202 + serializationData: + SerializedFormat: 2 + SerializedBytes: + ReferencedUnityObjects: [] + SerializedBytesString: + Prefab: {fileID: 0} + PrefabModificationsReferencedUnityObjects: [] + PrefabModifications: [] + SerializationNodes: + - Name: fieldDefinitions + Entry: 7 + Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition, + UdonSharp.Editor]], mscorlib + - Name: comparer + Entry: 7 + Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String, + mscorlib]], mscorlib + - Name: + Entry: 8 + Data: + - Name: + Entry: 12 + Data: 17 + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: PendingSerializations + - Name: $v + Entry: 7 + Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: PendingSerializations + - Name: k__BackingField + Entry: 7 + Data: 3|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Int32, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 4|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: Severity + - Name: $v + Entry: 7 + Data: 5|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Severity + - Name: k__BackingField + Entry: 7 + Data: 6|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.Logger.ELogLevel, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: 7|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 8|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 9|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 7 + Data: 10|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.Logger.TlpLogger, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: 11|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: VRC.Udon.UdonBehaviour, VRC.Udon + - Name: + Entry: 8 + Data: + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 12|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: EventInstigator + - Name: $v + Entry: 7 + Data: 13|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: EventInstigator + - Name: k__BackingField + Entry: 7 + Data: 14|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.TlpBaseBehaviour, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: 15|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 3 + - Name: + Entry: 7 + Data: 16|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 17|UnityEngine.HideInInspector, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 18|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - 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: Pool + - Name: $v + Entry: 7 + Data: 19|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Pool + - Name: k__BackingField + Entry: 9 + Data: 14 + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: 20|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 3 + - Name: + Entry: 7 + Data: 21|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 22|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 23|UnityEngine.HideInInspector, UnityEngine.CoreModule + - 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: PoolableInUse + - Name: $v + Entry: 7 + Data: 24|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: PoolableInUse + - Name: k__BackingField + Entry: 7 + Data: 25|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Boolean, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 26|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 27|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 28|UnityEngine.HideInInspector, UnityEngine.CoreModule + - 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: Listeners + - Name: $v + Entry: 7 + Data: 29|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Listeners + - Name: k__BackingField + Entry: 7 + Data: 30|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.TlpBaseBehaviour[], TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: 31|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: UnityEngine.Component[], UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - 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: 32|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 33|UnityEngine.SerializeField, UnityEngine.CoreModule + - 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: RaiseOnEnable + - Name: $v + Entry: 7 + Data: 34|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: RaiseOnEnable + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 35|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: RaiseOnStart + - Name: $v + Entry: 7 + Data: 36|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: RaiseOnStart + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 37|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: ListenerMethod + - Name: $v + Entry: 7 + Data: 38|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: ListenerMethod + - Name: k__BackingField + Entry: 7 + Data: 39|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.String, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 39 + - 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: 40|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 41|UnityEngine.TooltipAttribute, UnityEngine.CoreModule + - Name: tooltip + Entry: 1 + Data: Name of the method to be called on each listener + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 42|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 43|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 44|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _nextInvocationFrame + - Name: $v + Entry: 7 + Data: 45|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _nextInvocationFrame + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 46|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _instigator + - Name: $v + Entry: 7 + Data: 47|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _instigator + - Name: k__BackingField + Entry: 9 + Data: 14 + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 48|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 49|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 50|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: FastSync + - Name: $v + Entry: 7 + Data: 51|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: FastSync + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 1 + - Name: + Entry: 7 + Data: 53|UnityEngine.TooltipAttribute, UnityEngine.CoreModule + - Name: tooltip + Entry: 1 + Data: If enabled synchronisation is requested instantly instead of on the next + frame, off by default + - 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: Calls + - Name: $v + Entry: 7 + Data: 54|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Calls + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 3 + Data: 1 + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 55|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 56|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime + - 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: Value + - Name: $v + Entry: 7 + Data: 57|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Value + - Name: k__BackingField + Entry: 9 + Data: 39 + - Name: k__BackingField + Entry: 9 + Data: 39 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 3 + Data: 1 + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 58|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 59|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 60|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: diff --git a/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventString.asset.meta b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventString.asset.meta new file mode 100644 index 0000000..4729e97 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventString.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d62a7e56981557a45885059f71241f95 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventString.cs b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventString.cs new file mode 100644 index 0000000..d974092 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventString.cs @@ -0,0 +1,15 @@ +using JetBrains.Annotations; +using UdonSharp; +using UnityEngine; + +namespace TLP.UdonUtils.Sync.SyncedEvents +{ + [UdonBehaviourSyncMode(BehaviourSyncMode.Manual)] + [DefaultExecutionOrder(ExecutionOrder)] + public class SyncedEventString : SyncedEvent + { + [PublicAPI] + [UdonSynced] + public string Value; + } +} \ No newline at end of file diff --git a/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventString.cs.meta b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventString.cs.meta new file mode 100644 index 0000000..fe621f6 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventString.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 7484d8449b6344b093f447749e01871f +timeCreated: 1687550056 \ No newline at end of file diff --git a/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventStringArray.asset b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventStringArray.asset new file mode 100644 index 0000000..24b2611 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventStringArray.asset @@ -0,0 +1,1032 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3} + m_Name: SyncedEventStringArray + m_EditorClassIdentifier: + serializedUdonProgramAsset: {fileID: 11400000, guid: 79098f38ba326f14195be22cc00656ef, + type: 2} + udonAssembly: + assemblyError: + sourceCsScript: {fileID: 11500000, guid: 6a95d77ea9524c9499e23f1c6f0e121b, type: 3} + scriptVersion: 2 + compiledVersion: 2 + behaviourSyncMode: 4 + hasInteractEvent: 0 + scriptID: 1580525600718544152 + serializationData: + SerializedFormat: 2 + SerializedBytes: + ReferencedUnityObjects: [] + SerializedBytesString: + Prefab: {fileID: 0} + PrefabModificationsReferencedUnityObjects: [] + PrefabModifications: [] + SerializationNodes: + - Name: fieldDefinitions + Entry: 7 + Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition, + UdonSharp.Editor]], mscorlib + - Name: comparer + Entry: 7 + Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String, + mscorlib]], mscorlib + - Name: + Entry: 8 + Data: + - Name: + Entry: 12 + Data: 17 + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: PendingSerializations + - Name: $v + Entry: 7 + Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: PendingSerializations + - Name: k__BackingField + Entry: 7 + Data: 3|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Int32, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 4|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: Severity + - Name: $v + Entry: 7 + Data: 5|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Severity + - Name: k__BackingField + Entry: 7 + Data: 6|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.Logger.ELogLevel, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: 7|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 8|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 9|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 7 + Data: 10|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.Logger.TlpLogger, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: 11|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: VRC.Udon.UdonBehaviour, VRC.Udon + - Name: + Entry: 8 + Data: + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 12|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: EventInstigator + - Name: $v + Entry: 7 + Data: 13|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: EventInstigator + - Name: k__BackingField + Entry: 7 + Data: 14|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.TlpBaseBehaviour, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: 15|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 3 + - Name: + Entry: 7 + Data: 16|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 17|UnityEngine.HideInInspector, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 18|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - 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: Pool + - Name: $v + Entry: 7 + Data: 19|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Pool + - Name: k__BackingField + Entry: 9 + Data: 14 + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: 20|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 3 + - Name: + Entry: 7 + Data: 21|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 22|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 23|UnityEngine.HideInInspector, UnityEngine.CoreModule + - 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: PoolableInUse + - Name: $v + Entry: 7 + Data: 24|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: PoolableInUse + - Name: k__BackingField + Entry: 7 + Data: 25|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Boolean, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 26|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 27|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 28|UnityEngine.HideInInspector, UnityEngine.CoreModule + - 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: Listeners + - Name: $v + Entry: 7 + Data: 29|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Listeners + - Name: k__BackingField + Entry: 7 + Data: 30|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.TlpBaseBehaviour[], TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: 31|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: UnityEngine.Component[], UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - 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: 32|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 33|UnityEngine.SerializeField, UnityEngine.CoreModule + - 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: RaiseOnEnable + - Name: $v + Entry: 7 + Data: 34|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: RaiseOnEnable + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 35|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: RaiseOnStart + - Name: $v + Entry: 7 + Data: 36|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: RaiseOnStart + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 37|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: ListenerMethod + - Name: $v + Entry: 7 + Data: 38|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: ListenerMethod + - Name: k__BackingField + Entry: 7 + Data: 39|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.String, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 39 + - 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: 40|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 41|UnityEngine.TooltipAttribute, UnityEngine.CoreModule + - Name: tooltip + Entry: 1 + Data: Name of the method to be called on each listener + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 42|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 43|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 44|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _nextInvocationFrame + - Name: $v + Entry: 7 + Data: 45|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _nextInvocationFrame + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 46|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _instigator + - Name: $v + Entry: 7 + Data: 47|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _instigator + - Name: k__BackingField + Entry: 9 + Data: 14 + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 48|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 49|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 50|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: FastSync + - Name: $v + Entry: 7 + Data: 51|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: FastSync + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 1 + - Name: + Entry: 7 + Data: 53|UnityEngine.TooltipAttribute, UnityEngine.CoreModule + - Name: tooltip + Entry: 1 + Data: If enabled synchronisation is requested instantly instead of on the next + frame, off by default + - 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: Calls + - Name: $v + Entry: 7 + Data: 54|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Calls + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 3 + Data: 1 + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 55|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 56|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime + - 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: Values + - Name: $v + Entry: 7 + Data: 57|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Values + - Name: k__BackingField + Entry: 7 + Data: 58|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.String[], mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 58 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 3 + Data: 1 + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 59|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 60|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 61|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: diff --git a/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventStringArray.asset.meta b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventStringArray.asset.meta new file mode 100644 index 0000000..c0a3839 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventStringArray.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 77a735fdd8cf6ba49aa979e0eb722c64 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventStringArray.cs b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventStringArray.cs new file mode 100644 index 0000000..62ba7b2 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventStringArray.cs @@ -0,0 +1,15 @@ +using JetBrains.Annotations; +using UdonSharp; +using UnityEngine; + +namespace TLP.UdonUtils.Sync.SyncedEvents +{ + [UdonBehaviourSyncMode(BehaviourSyncMode.Manual)] + [DefaultExecutionOrder(ExecutionOrder)] + public class SyncedEventStringArray : SyncedEvent + { + [PublicAPI] + [UdonSynced] + public string[] Values = new string[0]; + } +} \ No newline at end of file diff --git a/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventStringArray.cs.meta b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventStringArray.cs.meta new file mode 100644 index 0000000..6283623 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventStringArray.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 6a95d77ea9524c9499e23f1c6f0e121b +timeCreated: 1694114827 \ No newline at end of file diff --git a/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventUrl.asset b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventUrl.asset new file mode 100644 index 0000000..a1eb32c --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventUrl.asset @@ -0,0 +1,1032 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3} + m_Name: SyncedEventUrl + m_EditorClassIdentifier: + serializedUdonProgramAsset: {fileID: 11400000, guid: 42948d121d7c92a4e80397ac12492f30, + type: 2} + udonAssembly: + assemblyError: + sourceCsScript: {fileID: 11500000, guid: d2da0c550e9c4f9e9fc94d8f7699f0d4, type: 3} + scriptVersion: 2 + compiledVersion: 2 + behaviourSyncMode: 4 + hasInteractEvent: 0 + scriptID: -934522631598445531 + serializationData: + SerializedFormat: 2 + SerializedBytes: + ReferencedUnityObjects: [] + SerializedBytesString: + Prefab: {fileID: 0} + PrefabModificationsReferencedUnityObjects: [] + PrefabModifications: [] + SerializationNodes: + - Name: fieldDefinitions + Entry: 7 + Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition, + UdonSharp.Editor]], mscorlib + - Name: comparer + Entry: 7 + Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String, + mscorlib]], mscorlib + - Name: + Entry: 8 + Data: + - Name: + Entry: 12 + Data: 17 + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: PendingSerializations + - Name: $v + Entry: 7 + Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: PendingSerializations + - Name: k__BackingField + Entry: 7 + Data: 3|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Int32, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 4|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: Severity + - Name: $v + Entry: 7 + Data: 5|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Severity + - Name: k__BackingField + Entry: 7 + Data: 6|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.Logger.ELogLevel, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: 7|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 8|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 9|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 7 + Data: 10|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.Logger.TlpLogger, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: 11|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: VRC.Udon.UdonBehaviour, VRC.Udon + - Name: + Entry: 8 + Data: + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 12|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: EventInstigator + - Name: $v + Entry: 7 + Data: 13|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: EventInstigator + - Name: k__BackingField + Entry: 7 + Data: 14|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.TlpBaseBehaviour, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: 15|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 3 + - Name: + Entry: 7 + Data: 16|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 17|UnityEngine.HideInInspector, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 18|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - 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: Pool + - Name: $v + Entry: 7 + Data: 19|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Pool + - Name: k__BackingField + Entry: 9 + Data: 14 + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: 20|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 3 + - Name: + Entry: 7 + Data: 21|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 22|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 23|UnityEngine.HideInInspector, UnityEngine.CoreModule + - 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: PoolableInUse + - Name: $v + Entry: 7 + Data: 24|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: PoolableInUse + - Name: k__BackingField + Entry: 7 + Data: 25|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Boolean, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 26|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 27|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 28|UnityEngine.HideInInspector, UnityEngine.CoreModule + - 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: Listeners + - Name: $v + Entry: 7 + Data: 29|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Listeners + - Name: k__BackingField + Entry: 7 + Data: 30|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.TlpBaseBehaviour[], TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: 31|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: UnityEngine.Component[], UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - 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: 32|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 33|UnityEngine.SerializeField, UnityEngine.CoreModule + - 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: RaiseOnEnable + - Name: $v + Entry: 7 + Data: 34|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: RaiseOnEnable + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 35|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: RaiseOnStart + - Name: $v + Entry: 7 + Data: 36|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: RaiseOnStart + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 37|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: ListenerMethod + - Name: $v + Entry: 7 + Data: 38|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: ListenerMethod + - Name: k__BackingField + Entry: 7 + Data: 39|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.String, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 39 + - 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: 40|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 41|UnityEngine.TooltipAttribute, UnityEngine.CoreModule + - Name: tooltip + Entry: 1 + Data: Name of the method to be called on each listener + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 42|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 43|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 44|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _nextInvocationFrame + - Name: $v + Entry: 7 + Data: 45|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _nextInvocationFrame + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 46|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _instigator + - Name: $v + Entry: 7 + Data: 47|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _instigator + - Name: k__BackingField + Entry: 9 + Data: 14 + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 48|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 49|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 50|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: FastSync + - Name: $v + Entry: 7 + Data: 51|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: FastSync + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 1 + - Name: + Entry: 7 + Data: 53|UnityEngine.TooltipAttribute, UnityEngine.CoreModule + - Name: tooltip + Entry: 1 + Data: If enabled synchronisation is requested instantly instead of on the next + frame, off by default + - 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: Calls + - Name: $v + Entry: 7 + Data: 54|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Calls + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 3 + Data: 1 + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 55|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 56|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime + - 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: Value + - Name: $v + Entry: 7 + Data: 57|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Value + - Name: k__BackingField + Entry: 7 + Data: 58|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: VRC.SDKBase.VRCUrl, VRCSDKBase + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 58 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 3 + Data: 1 + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 59|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 60|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 61|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: diff --git a/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventUrl.asset.meta b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventUrl.asset.meta new file mode 100644 index 0000000..87bb0ea --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventUrl.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: cb31e78c53dfaa5428df595dc23218df +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventUrl.cs b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventUrl.cs new file mode 100644 index 0000000..399d21c --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventUrl.cs @@ -0,0 +1,16 @@ +using JetBrains.Annotations; +using UdonSharp; +using UnityEngine; +using VRC.SDKBase; + +namespace TLP.UdonUtils.Sync.SyncedEvents +{ + [UdonBehaviourSyncMode(BehaviourSyncMode.Manual)] + [DefaultExecutionOrder(ExecutionOrder)] + public class SyncedEventUrl : SyncedEvent + { + [PublicAPI] + [UdonSynced] + public VRCUrl Value; + } +} \ No newline at end of file diff --git a/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventUrl.cs.meta b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventUrl.cs.meta new file mode 100644 index 0000000..eacd35f --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Sync/SyncedEvents/SyncedEventUrl.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: d2da0c550e9c4f9e9fc94d8f7699f0d4 +timeCreated: 1687550295 \ No newline at end of file diff --git a/Packages/tlp.udonutils/Runtime/Sync/TlpAccurateSyncBehaviour.cs b/Packages/tlp.udonutils/Runtime/Sync/TlpAccurateSyncBehaviour.cs new file mode 100644 index 0000000..8d3a270 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Sync/TlpAccurateSyncBehaviour.cs @@ -0,0 +1,181 @@ +using System; +using JetBrains.Annotations; +using TLP.UdonUtils.Extensions; +using UdonSharp; +using UnityEngine; +using UnityEngine.UI; +using VRC.SDKBase; +using VRC.Udon.Common; + +namespace TLP.UdonUtils.Sync +{ + [DefaultExecutionOrder(ExecutionOrder)] + [UdonBehaviourSyncMode(BehaviourSyncMode.Manual)] + public abstract class TlpAccurateSyncBehaviour : TlpBaseBehaviour + { + protected override int ExecutionOrderReadOnly => ExecutionOrder; + + [PublicAPI] + public new const int ExecutionOrder = TlpBaseBehaviour.ExecutionOrder + 1; + + [UdonSynced] + public float SyncedGameTime; + + [UdonSynced] + public double SyncedServerSendTime; + + [UdonSynced] + public float SyncedSnapshotGameTime; + + [SerializeField] + protected NetworkTime NetworkTime; + + private const float ElapsedCompensation = 0.007f; + + private float _gameTimeDifference; + private float _previousGameTimeDifference; + private float _smoothingSpeedGameTimeDifference; + + public bool UseFixedUpdate; + + + public override void OnPreSerialization() + { + base.OnPreSerialization(); + SyncedGameTime = Time.timeSinceLevelLoad - Time.smoothDeltaTime; + SyncedServerSendTime = NetworkTime.GetTimeForCurrentFrame(); + } + + public Text Text; + + public override void OnDeserialization(DeserializationResult deserializationResult) + { + base.OnDeserialization(deserializationResult); + + DebugLog( + $"Latency VRC = {deserializationResult.Latency()} vs own {NetworkTime.GetTimeForCurrentFrame() - SyncedServerSendTime}" + ); + //_UpdateGameTimeDeltaToSender(deserializationResult.Latency()); + _UpdateGameTimeDeltaToSender((float)(NetworkTime.GetTimeForCurrentFrame() - SyncedServerSendTime)); + + float elapsed = _GetElapsed(); + PredictMovement(elapsed, 0f); + if (Text) + { + Text.text = $"_gameTimeDifference = {_gameTimeDifference}\nelapsed = {elapsed}"; + } + } + + public virtual void Update() + { + if (UseFixedUpdate) + { + return; + } + + if (Networking.IsOwner(gameObject)) + { + return; + } + + PredictMovement(_GetElapsed(), Time.deltaTime); + } + + public virtual void FixedUpdate() + { + if (!UseFixedUpdate) + { + return; + } + + if (Networking.IsOwner(gameObject)) + { + return; + } + + PredictMovement(_GetElapsed(), Time.fixedDeltaTime); + } + + protected abstract void PredictMovement(float elapsed, float deltaTime); + + private void _UpdateGameTimeDeltaToSender(float latency) + { + float gameTimeDifference = GameTimeDifference( + SyncedGameTime, + latency, + Time.timeSinceLevelLoad + ); + + if (Mathf.Abs(_gameTimeDifference - gameTimeDifference) > 1.0) + { + _gameTimeDifference = gameTimeDifference; + } + + UpdateAverageGameTimeDifference( + ref _gameTimeDifference, + ref _previousGameTimeDifference, + gameTimeDifference - Time.smoothDeltaTime + ); + } + + internal float _GetElapsed() + { + return GetElapsedTime( + SyncedSnapshotGameTime, + SyncedGameTime, + Time.timeSinceLevelLoad, + _gameTimeDifference + ) - ElapsedCompensation; + } + + public static float GetElapsedTime( + float gameTimeSenderOnSnapshot, + float gameTimeSenderOnSend, + float gameTimeReceiverOnUpdate, + float estimatedGameTimeDifference + ) + { + return gameTimeReceiverOnUpdate - (gameTimeSenderOnSend + estimatedGameTimeDifference - + (gameTimeSenderOnSend - gameTimeSenderOnSnapshot)); + } + + public static float GameTimeDifference( + float gameTimeOnSend, + float transmitDuration, + float gameTimeOnReceive + ) + { + return gameTimeOnReceive - (gameTimeOnSend + transmitDuration); + } + + public static void UpdateAverageGameTimeDifference( + ref float averageGameTimeDifference, + ref float previousAverageGameTimeDifference, + float gameTimeDifference + ) + { + float change = Mathf.Abs(averageGameTimeDifference - previousAverageGameTimeDifference); + previousAverageGameTimeDifference = averageGameTimeDifference; + if (change > 0.1f * 0.1f) + { + averageGameTimeDifference = (float)(0.9 * + averageGameTimeDifference + 0.1 * gameTimeDifference); + } + else if (change > 0.01f * 0.01f) + { + averageGameTimeDifference = (float)(0.99 * + averageGameTimeDifference + 0.01 * gameTimeDifference); + } + else if (change > 0.001f * 0.001f) + { + averageGameTimeDifference = (float)(0.999 * + averageGameTimeDifference + 0.001 * gameTimeDifference); + } + else + { + averageGameTimeDifference = (float)(0.99995 * + averageGameTimeDifference + 0.00005 * gameTimeDifference); + } + } + } +} \ No newline at end of file diff --git a/Packages/tlp.udonutils/Runtime/Sync/TlpAccurateSyncBehaviour.cs.meta b/Packages/tlp.udonutils/Runtime/Sync/TlpAccurateSyncBehaviour.cs.meta new file mode 100644 index 0000000..a95723a --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Sync/TlpAccurateSyncBehaviour.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 4e8036305fa84ae1b492ed9994399e54 +timeCreated: 1691590254 \ No newline at end of file diff --git a/Packages/tlp.udonutils/Runtime/TLP.UdonUtils.Runtime.asmdef b/Packages/tlp.udonutils/Runtime/TLP.UdonUtils.Runtime.asmdef new file mode 100644 index 0000000..02a6e1d --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/TLP.UdonUtils.Runtime.asmdef @@ -0,0 +1,16 @@ +{ + "name": "TLP.UdonUtils.Runtime", + "references": [ + "GUID:99835874ee819da44948776e0df4ff1d", + "GUID:3c1bc1267eab5884ebe7f232c09ee0d9" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/LICENSE.meta b/Packages/tlp.udonutils/Runtime/TLP.UdonUtils.Runtime.asmdef.meta similarity index 59% rename from LICENSE.meta rename to Packages/tlp.udonutils/Runtime/TLP.UdonUtils.Runtime.asmdef.meta index 0403145..692e290 100644 --- a/LICENSE.meta +++ b/Packages/tlp.udonutils/Runtime/TLP.UdonUtils.Runtime.asmdef.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: a875f4555ad48d14ba2114090bbbeac2 -DefaultImporter: +guid: 5ffc5658c86203349b4ced03f037df1f +AssemblyDefinitionImporter: externalObjects: {} userData: assetBundleName: diff --git a/Packages/tlp.udonutils/Runtime/TLP.UdonUtils.Runtime.asset b/Packages/tlp.udonutils/Runtime/TLP.UdonUtils.Runtime.asset new file mode 100644 index 0000000..48ff970 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/TLP.UdonUtils.Runtime.asset @@ -0,0 +1,16 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5136146375e9a0a498a72a0091b40cc1, type: 3} + m_Name: TLP.UdonUtils.Runtime + m_EditorClassIdentifier: + sourceAssembly: {fileID: 5897886265953266890, guid: 5ffc5658c86203349b4ced03f037df1f, + type: 3} diff --git a/Packages/tlp.udonutils/Runtime/TLP.UdonUtils.Runtime.asset.meta b/Packages/tlp.udonutils/Runtime/TLP.UdonUtils.Runtime.asset.meta new file mode 100644 index 0000000..ba9f86d --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/TLP.UdonUtils.Runtime.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8b5382dc4339b4942806b9d1fc2104f8 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/tlp.udonutils/Runtime/Testing.meta b/Packages/tlp.udonutils/Runtime/Testing.meta new file mode 100644 index 0000000..2872581 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Testing.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1cc5e5d813e72164ab12dfe052cad79b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/tlp.udonutils/Runtime/Testing/TestCase.cs b/Packages/tlp.udonutils/Runtime/Testing/TestCase.cs new file mode 100644 index 0000000..7d13b79 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Testing/TestCase.cs @@ -0,0 +1,123 @@ +using System; +using UdonSharp; +using UnityEngine; +using VRC.SDKBase; + +namespace TLP.UdonUtils.Testing +{ + /// + /// Component which implements the base of a test case, includes preparation, execution and cleanup methods + /// to be copied to new test scripts and filled for each individual test case. + /// + /// Behaviour sync mode can be changed depending on the test performed, default is no variable sync + /// + [UdonBehaviourSyncMode(BehaviourSyncMode.None)] + public abstract class TestCase : TlpBaseBehaviour + { + [NonSerialized] + public TestController TestController; + + public void Initialize() + { + if (!TestController) + { + Error( + "[UdonUtils] [Testing] Test.Initialize: invalid test controller" + ); + return; + } + + Info("[UdonUtils] [Testing] Test.Initialize"); + InitializeTest(); + } + + public void Run() + { + if (!TestController) + { + Error( + "[UdonUtils] [Testing] Test.Run: invalid test controller" + ); + return; + } + + Info("[UdonUtils] [Testing] Test.Run"); + RunTest(); + } + + public void CleanUp() + { + if (!TestController) + { + Error( + "[UdonUtils] [Testing] Test.CleanUp: invalid test controller" + ); + return; + } + + Info("[UdonUtils] [Testing] Test.CleanUp"); + CleanUpTest(); + } + + + #region Hooks + + protected virtual void InitializeTest() + { + // TODO your init behaviour here + // ... + + // whenever the test is ready to be started call TestController.TestInitialized, + // can be later in update or whenever but MUST be called at some point + TestController.TestInitialized(true); + } + + protected virtual void RunTest() + { + // TODO your test behaviour here + // ... + + // whenever the test is completed call TestController.TestCompleted, + // can be later in update or whenever but MUST be called at some point + TestController.TestCompleted(true); + } + + protected virtual void CleanUpTest() + { + // TODO your clean up behaviour here + // ... + + // whenever the test is cleaned up call TestController.TestCleanedUp, + // can be later in update or whenever but MUST be called at some point + TestController.TestCleanedUp(true); + } + + protected bool Assert(bool condition, string message) + { + if (!condition) + { + if (Utilities.IsValid(this)) + { + Error( + "[UdonUtils] [Testing] Assertion failed : '" + + GetType() + " : " + message + "'" + ); + } + else + { + Error( + "[UdonUtils] [Testing] Assertion failed : 'UNKNOWN TYPE: " + + message + "'" + ); + } + + return false; + } + + Debug.Assert(condition, message); + return true; + } + + #endregion + } +} \ No newline at end of file diff --git a/Scripts/Testing/TestTemplate.cs.meta b/Packages/tlp.udonutils/Runtime/Testing/TestCase.cs.meta similarity index 100% rename from Scripts/Testing/TestTemplate.cs.meta rename to Packages/tlp.udonutils/Runtime/Testing/TestCase.cs.meta diff --git a/Packages/tlp.udonutils/Runtime/Testing/TestController.asset b/Packages/tlp.udonutils/Runtime/Testing/TestController.asset new file mode 100644 index 0000000..747bed1 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Testing/TestController.asset @@ -0,0 +1,1250 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3} + m_Name: TestController + m_EditorClassIdentifier: + serializedUdonProgramAsset: {fileID: 11400000, guid: 239df54ef337e3e4ca0b9b1c01f61f0b, + type: 2} + udonAssembly: + assemblyError: + sourceCsScript: {fileID: 11500000, guid: 633845384acec5440afe0af63e8253f2, type: 3} + scriptVersion: 2 + compiledVersion: 2 + behaviourSyncMode: 1 + hasInteractEvent: 0 + scriptID: 6812286732357705012 + serializationData: + SerializedFormat: 2 + SerializedBytes: + ReferencedUnityObjects: [] + SerializedBytesString: + Prefab: {fileID: 0} + PrefabModificationsReferencedUnityObjects: [] + PrefabModifications: [] + SerializationNodes: + - Name: fieldDefinitions + Entry: 7 + Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition, + UdonSharp.Editor]], mscorlib + - Name: comparer + Entry: 7 + Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String, + mscorlib]], mscorlib + - Name: + Entry: 8 + Data: + - Name: + Entry: 12 + Data: 21 + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: PendingSerializations + - Name: $v + Entry: 7 + Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: PendingSerializations + - Name: k__BackingField + Entry: 7 + Data: 3|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Int32, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 4|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: Severity + - Name: $v + Entry: 7 + Data: 5|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Severity + - Name: k__BackingField + Entry: 7 + Data: 6|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.Logger.ELogLevel, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: 7|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 8|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - 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: k__BackingField + - Name: $v + Entry: 7 + Data: 9|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 7 + Data: 10|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.Logger.TlpLogger, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: 11|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: VRC.Udon.UdonBehaviour, VRC.Udon + - Name: + Entry: 8 + Data: + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 12|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: EventInstigator + - Name: $v + Entry: 7 + Data: 13|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: EventInstigator + - Name: k__BackingField + Entry: 7 + Data: 14|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.TlpBaseBehaviour, TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: 15|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 3 + - Name: + Entry: 7 + Data: 16|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 17|UnityEngine.HideInInspector, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 18|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - 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: Pool + - Name: $v + Entry: 7 + Data: 19|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Pool + - Name: k__BackingField + Entry: 9 + Data: 14 + - Name: k__BackingField + Entry: 9 + Data: 11 + - 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: 20|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 3 + - Name: + Entry: 7 + Data: 21|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 22|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 23|UnityEngine.HideInInspector, UnityEngine.CoreModule + - 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: PoolableInUse + - Name: $v + Entry: 7 + Data: 24|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: PoolableInUse + - Name: k__BackingField + Entry: 7 + Data: 25|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Boolean, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 26|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 27|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 28|UnityEngine.HideInInspector, UnityEngine.CoreModule + - 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: OnlyMasterCanStart + - Name: $v + Entry: 7 + Data: 29|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: OnlyMasterCanStart + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 30|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 2 + - Name: + Entry: 7 + Data: 31|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 32|UnityEngine.HeaderAttribute, UnityEngine.CoreModule + - Name: header + Entry: 1 + Data: Start Input + - 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: StartKey0 + - Name: $v + Entry: 7 + Data: 33|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: StartKey0 + - Name: k__BackingField + Entry: 7 + Data: 34|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: UnityEngine.KeyCode, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 34 + - 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: 35|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 36|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - 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: StartKey1 + - Name: $v + Entry: 7 + Data: 37|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: StartKey1 + - Name: k__BackingField + Entry: 9 + Data: 34 + - Name: k__BackingField + Entry: 9 + Data: 34 + - 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: 1 + - Name: + Entry: 7 + Data: 39|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - 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: StartKey2 + - Name: $v + Entry: 7 + Data: 40|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: StartKey2 + - Name: k__BackingField + Entry: 9 + Data: 34 + - Name: k__BackingField + Entry: 9 + Data: 34 + - 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: 41|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 42|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - 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: AbortKey0 + - Name: $v + Entry: 7 + Data: 43|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: AbortKey0 + - Name: k__BackingField + Entry: 9 + Data: 34 + - Name: k__BackingField + Entry: 9 + Data: 34 + - 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.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 46|UnityEngine.HeaderAttribute, UnityEngine.CoreModule + - Name: header + Entry: 1 + Data: Abort Input + - 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: AbortKey1 + - Name: $v + Entry: 7 + Data: 47|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: AbortKey1 + - Name: k__BackingField + Entry: 9 + Data: 34 + - Name: k__BackingField + Entry: 9 + Data: 34 + - 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: 1 + - Name: + Entry: 7 + Data: 49|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - 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: StartOnLocalPlayerJoin + - Name: $v + Entry: 7 + Data: 50|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: StartOnLocalPlayerJoin + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 51|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 3 + - Name: + Entry: 7 + Data: 52|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 53|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 54|UnityEngine.HeaderAttribute, UnityEngine.CoreModule + - Name: header + Entry: 1 + Data: Tests + - 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: StartOnOtherPlayerJoin + - Name: $v + Entry: 7 + Data: 55|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: StartOnOtherPlayerJoin + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: 56|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: Tests + - Name: $v + Entry: 7 + Data: 57|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: Tests + - Name: k__BackingField + Entry: 7 + Data: 58|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TLP.UdonUtils.Testing.TestCase[], TLP.UdonUtils.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: 59|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: UnityEngine.Component[], UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - 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: 60|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 61|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule + - 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: _isTesting + - Name: $v + Entry: 7 + Data: 62|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _isTesting + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 63|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _testInitialized + - Name: $v + Entry: 7 + Data: 64|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _testInitialized + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 65|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _testCompleted + - Name: $v + Entry: 7 + Data: 66|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _testCompleted + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 67|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _testCleanedUp + - Name: $v + Entry: 7 + Data: 68|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _testCleanedUp + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 69|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _testIndex + - Name: $v + Entry: 7 + Data: 70|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _testIndex + - Name: k__BackingField + Entry: 9 + Data: 3 + - Name: k__BackingField + Entry: 9 + Data: 3 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 71|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: _pendingNextStep + - Name: $v + Entry: 7 + Data: 72|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _pendingNextStep + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - 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: false + - Name: _fieldAttributes + Entry: 7 + Data: 73|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: diff --git a/Scripts/Testing/TestController.asset.meta b/Packages/tlp.udonutils/Runtime/Testing/TestController.asset.meta similarity index 100% rename from Scripts/Testing/TestController.asset.meta rename to Packages/tlp.udonutils/Runtime/Testing/TestController.asset.meta diff --git a/Packages/tlp.udonutils/Runtime/Testing/TestController.cs b/Packages/tlp.udonutils/Runtime/Testing/TestController.cs new file mode 100644 index 0000000..ad665a3 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/Testing/TestController.cs @@ -0,0 +1,269 @@ +using JetBrains.Annotations; +using TLP.UdonUtils.Extensions; +using UdonSharp; +using UnityEngine; +using UnityEngine.Serialization; +using VRC.SDKBase; + +namespace TLP.UdonUtils.Testing +{ + [UdonBehaviourSyncMode(BehaviourSyncMode.None)] + [DefaultExecutionOrder(ExecutionOrder)] + public class TestController : TlpBaseBehaviour + { + protected override int ExecutionOrderReadOnly => ExecutionOrder; + + [PublicAPI] + public new const int ExecutionOrder = TlpExecutionOrder.Max; + + private const string LogPrefix = "[UdonUtils] [Testing]"; + + [FormerlySerializedAs("onlyMasterCanStart")] + [Header("Start Input")] + public bool OnlyMasterCanStart; + + [FormerlySerializedAs("startKey0")] + public KeyCode StartKey0 = KeyCode.T; + + [FormerlySerializedAs("startKey1")] + public KeyCode StartKey1 = KeyCode.E; + + [FormerlySerializedAs("startKey2")] + public KeyCode StartKey2 = KeyCode.S; + + [FormerlySerializedAs("abortKey0")] + [Header("Abort Input")] + public KeyCode AbortKey0 = KeyCode.LeftControl; + + [FormerlySerializedAs("abortKey1")] + public KeyCode AbortKey1 = KeyCode.C; + + [FormerlySerializedAs("StartOnPlayerJoin")] + [FormerlySerializedAs("startOnPlayerJoin")] + [Header("Tests")] + public bool StartOnLocalPlayerJoin; + + public bool StartOnOtherPlayerJoin; + + [FormerlySerializedAs("tests")] + public TestCase[] Tests; + + private bool _isTesting; + private bool _testInitialized; + private bool _testCompleted; + private bool _testCleanedUp; + + private int _testIndex; + private bool _pendingNextStep; + + public override void OnPlayerJoined(VRCPlayerApi player) + { + #region TLP_DEBUG + +#if TLP_DEBUG + DebugLog($"{nameof(OnPlayerJoined)} {player.ToStringSafe()}"); +#endif + + #endregion + + + if (OnlyMasterCanStart && !Networking.IsMaster) + { + Info($"{LogPrefix} {name}.OnPlayerJoined: Only master can start test"); + return; + } + + if (StartOnLocalPlayerJoin && player.IsLocalSafe()) + { + Info($"{LogPrefix} {name}.OnPlayerJoined: starting after local player {player.ToStringSafe()} joined"); + // start the tests + _isTesting = true; + ContinueTesting(); + return; + } + + if (StartOnOtherPlayerJoin) + { + Info($"{LogPrefix} {name}.OnPlayerJoined: starting after other player {player.ToStringSafe()} joined"); + // start the tests + _isTesting = true; + ContinueTesting(); + return; + } + + Info($"{LogPrefix} {name}.OnPlayerJoined: not started due to settings"); + } + + public void Update() + { + if (OnlyMasterCanStart && !Networking.IsMaster) + { + return; + } + + if (_pendingNextStep) + { + _pendingNextStep = false; + ContinueTesting(); + } + + if (_isTesting) + { + if (Input.GetKey(AbortKey0) + && Input.GetKey(AbortKey1)) + { + AbortTestRun(); + } + } + else + { + if (Input.GetKey(StartKey0) + && Input.GetKey(StartKey1) + && Input.GetKey(StartKey2)) + { + StartTestRun(); + } + } + } + + private void AbortTestRun() + { + Info($"{LogPrefix} {name}.AbortTestRun: aborting after current test"); + + // set the index to the lenght of the list of tests to prevent continuation + _testIndex = Tests.Length; + } + + public void StartTestRun() + { + if (_isTesting) + { + Warn( + $"{LogPrefix} {name}.StartTestRun: can not start a new test while another " + + $"one is still running" + ); + return; + } + + Info($"{LogPrefix} {name}.StartTestRun"); + + _isTesting = true; + _testIndex = 0; + _pendingNextStep = true; + } + + private void ContinueTesting() + { + int numberOfTests = Tests.LengthSafe(); + if (numberOfTests > 0 && _testIndex > -1 && _testIndex < numberOfTests) + { + var testCase = Tests[_testIndex]; + if (!testCase) + { + Error($"{LogPrefix} {name}.ContinueTesting: tests contains invalid behaviour"); + return; + } + + var context = testCase.gameObject; + if (!_testInitialized) + { + Info($"{LogPrefix} {name}.ContinueTesting: Initializing test {context}"); + testCase.TestController = this; + testCase.Initialize(); + return; + } + + if (!_testCompleted) + { + Info($"{LogPrefix} {name}.ContinueTesting: Running test {context}"); + testCase.Run(); + return; + } + + if (!_testCleanedUp) + { + Info($"{LogPrefix} {name}.ContinueTesting: Cleaning up test {context}"); + testCase.CleanUp(); + return; + } + + ++_testIndex; + _isTesting = _testIndex < Tests.Length; + + _testInitialized = false; + _testCompleted = false; + _testCleanedUp = false; + + _pendingNextStep = _isTesting; + + if (!_isTesting) + { + Info($"{LogPrefix} {name}.ContinueTesting: All test completed"); + } + } + else + { + Warn($"{LogPrefix} {name}.ContinueTesting: test run aborted"); + _testIndex = 0; + _isTesting = false; + _testInitialized = false; + _testCompleted = false; + _testCleanedUp = false; + _pendingNextStep = false; + } + } + + public void TestInitialized(bool success) + { + if (success) + { + Info($"{LogPrefix} {name}.TestInitialized: Initialized test successfully"); + } + else + { + Error($"{LogPrefix} {name}.TestInitialized: Test initialization failed"); + } + + _testInitialized = true; + if (!success) + { + _testCompleted = true; + } + + _pendingNextStep = true; + } + + public void TestCompleted(bool success) + { + if (success) + { + Info($"{LogPrefix} {name}.TestCompleted: PASS"); + } + else + { + Error($"{LogPrefix} {name}.TestCompleted: FAIL"); + } + + _testCompleted = true; + _pendingNextStep = true; + } + + public void TestCleanedUp(bool success) + { + if (success) + { + Info($"{LogPrefix} {name}.TestCleanedUp: Cleaned up test successfully"); + } + else + { + Error($"{LogPrefix} {name}.TestCleanedUp: Test cleanup failed"); + } + + // ensure we don't get any more messages from the test + Tests[_testIndex].TestController = null; + + _testCleanedUp = true; + _pendingNextStep = true; + } + } +} \ No newline at end of file diff --git a/Scripts/Testing/TestController.cs.meta b/Packages/tlp.udonutils/Runtime/Testing/TestController.cs.meta similarity index 100% rename from Scripts/Testing/TestController.cs.meta rename to Packages/tlp.udonutils/Runtime/Testing/TestController.cs.meta diff --git a/Packages/tlp.udonutils/Runtime/TlpBaseBehaviour.cs b/Packages/tlp.udonutils/Runtime/TlpBaseBehaviour.cs new file mode 100644 index 0000000..df38c5d --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/TlpBaseBehaviour.cs @@ -0,0 +1,396 @@ +using System; +using JetBrains.Annotations; +using TLP.UdonUtils.Common; +using TLP.UdonUtils.Logger; +using UdonSharp; +using UnityEngine; +using UnityEngine.Serialization; +using VRC.SDKBase; +using VRC.Udon.Common; + +namespace TLP.UdonUtils +{ + /// + /// UdonSharpBehaviour Lifecycle
+ /// + /// 1. OnEnable
+ /// 2. Start
+ /// 3. OnDeserialization, OnOwnershipTransferred etc. (Networking Events)
+ /// 4. FixedUpdate
+ /// 5. AnimationEvents
+ /// 6. CollisionEvents (OnPlayer[...], OnTrigger[...], OnCollision[...])
+ /// 7. InputEvents (InPickup, InputJump, etc.)
+ /// 8. Update
+ /// 9. AnimationEvents
+ /// 10. LateUpdate
+ /// 11. PostLateUpdate (most accurate player position)
+ /// 12. RenderingEvents (OnBecameVisible, OnRenderImage, etc.)
+ /// 13. OnDisable
+ /// 14. OnDestroy
+ /// + /// https://docs.vrchat.com/docs/event-execution-order + ///
+ [DefaultExecutionOrder(ExecutionOrder)] + public abstract class TlpBaseBehaviour : UdonSharpBehaviour + { + protected virtual int ExecutionOrderReadOnly => ExecutionOrder; + + [PublicAPI] + public const int ExecutionOrder = TlpExecutionOrder.DefaultStart; + + #region Constants + + protected const int False = 0; + protected const int True = 1; + + protected const int InvalidPlayer = -1; + protected const int NoUser = InvalidPlayer; + public const string TlpLoggerGameObjectName = "TLP_Logger"; + + #endregion + + #region Networking + + [PublicAPI] + public bool IsPendingSerialization() + { + return PendingSerializations > 0; + } + + [PublicAPI] + public bool DropPendingSerializations() + { + #region TLP_DEBUG + +#if TLP_DEBUG + DebugLog(nameof(DropPendingSerializations)); +#endif + + #endregion + + bool hadPending = IsPendingSerialization(); + PendingSerializations = 0; + return hadPending; + } + + internal int PendingSerializations; + + [PublicAPI] + public bool MarkNetworkDirty() + { +#if TLP_DEBUG + DebugLog(nameof(MarkNetworkDirty)); +#endif + if (!Networking.IsOwner(gameObject)) + { + Warn("Can not mark network dirty, not owner"); + return false; + } + + PendingSerializations = Math.Max(1, PendingSerializations + 1); + SendCustomEventDelayedFrames(nameof(ExecuteScheduledSerialization), 0); + return true; + } + + public void ExecuteScheduledSerialization() + { +#if TLP_DEBUG + DebugLog(nameof(ExecuteScheduledSerialization)); +#endif + if (PendingSerializations < 1) + { + return; + } + + if (!Networking.IsOwner(gameObject)) + { + PendingSerializations = 0; + return; + } + + RequestSerialization(); + } + + public override void OnPreSerialization() + { +#if TLP_DEBUG + DebugLog(nameof(OnPreSerialization)); +#endif + if (PendingSerializations < 1) + { + PendingSerializations = 1; + } + } + + public override void OnPostSerialization(SerializationResult result) + { +#if TLP_DEBUG + DebugLog(nameof(OnPostSerialization)); +#endif + if (result.success) + { +#if TLP_DEBUG + DebugLog( + $"{nameof(OnPostSerialization)} wrote {result.byteCount} bytes of {PendingSerializations} serialization requests to the network" + ); +#endif + PendingSerializations = 0; + return; + } + + MarkNetworkDirty(); + } + + public override void OnDeserialization(DeserializationResult deserializationResult) + { +#if TLP_DEBUG + DebugLog("OnDeserialization"); +#endif + } + + #endregion + + #region Logging + + [FormerlySerializedAs("severity")] + public ELogLevel Severity = ELogLevel.Debug; + + private string LOGPrefix => + $"[{ExecutionOrderReadOnly} {gameObject.name}/{UdonCommon.UdonTypeNameShort(GetUdonTypeName())}]"; + + + protected TlpLogger Logger { private set; get; } + + protected void DebugLog(string message) + { +#if TLP_DEBUG + if ((int)Severity < (int)ELogLevel.Debug) + { + return; + } + + if (GetLogger()) + { + Logger.DebugLog(LOGPrefix, message, ExecutionOrder, this); + } + else + { + Debug.Log(LOGPrefix + message, this); + } +#endif + } + + protected void Info(string message) + { + if ((int)Severity < (int)ELogLevel.Info) + { + return; + } + + if (GetLogger()) + { + Logger.Info(LOGPrefix, message, this); + } + else + { + Debug.Log(LOGPrefix + message, this); + } + } + + protected void Warn(string message) + { + if ((int)Severity < (int)ELogLevel.Warning) + { + return; + } + + if (GetLogger()) + { + Logger.Warn(LOGPrefix, message, this); + } + else + { + Debug.LogWarning(LOGPrefix + message, this); + } + } + + protected void ErrorAndDisableComponent(string message) + { + Error(message); + enabled = false; + } + + protected void ErrorAndDisableGameObject(string message) + { + Error(message); + gameObject.SetActive(false); + } + + protected void Error(string message) + { + if ((int)Severity < (int)ELogLevel.Assertion) + { + return; + } + + if (GetLogger()) + { + Logger.Error(LOGPrefix, message, this); + } + else + { + Debug.LogError(LOGPrefix + message, this); + } + } + + private bool GetLogger() + { + if (Utilities.IsValid(Logger)) + { + return true; + } + + var logger = GameObject.Find(TlpLoggerGameObjectName); + if (!Utilities.IsValid(logger)) + { + Debug.LogError(LOGPrefix + " : Logger does not exist in the scene or is already destroyed", this); + return false; + } + + Logger = logger.GetComponent(); + + return Utilities.IsValid(Logger); + } + + /// + /// Notes: Has no effect unless the corresponding compiler flag is set in Unity via the menu + /// TLP/UdonUtils/Log Assertion Errors/Enable.
+ /// The option is saved in the Editor Preferences and will be the same across multiple Unity projects that use + /// the same Unity version! + ///

+ /// When active it will return false if the condition is false, it will log an error message filled + /// with the name of the context object the error occurred on and with the given error message. + ///
+ /// Condition expected to be true, false with log the error message + /// Compact error message, will be surrounded by context info + /// Object which is relevant to the condition failing, usually a behaviour or GameObject + /// The value of condition + protected bool Assert(bool condition, string message, UnityEngine.Object context) + { +#if !TLP_DEBUG + return condition; +#else + if ((int)Severity < (int)ELogLevel.Assertion) + { + return condition; + } + + if (condition) + { + return true; + } + + if (Utilities.IsValid(context)) + { + var udonSharpBehaviour = (UdonSharpBehaviour)context; + // ReSharper disable once ConvertIfStatementToConditionalTernaryExpression + if (Utilities.IsValid(udonSharpBehaviour)) + { + Error($"Assertion failed : '{udonSharpBehaviour.gameObject.name} : {message}'"); + } + else + { + Error($"Assertion failed : '{context.GetType()} : {message}'"); + } + } + else + { + Error("Assertion failed : '" + message + "'"); + } + + Debug.Assert(condition, message); + return false; +#endif + } + + #endregion + + #region Event listening + + [FormerlySerializedAs("eventInstigator")] + [HideInInspector] + [PublicAPI] + public TlpBaseBehaviour EventInstigator; + + [PublicAPI] + public virtual void OnEvent(string eventName) + { +#if TLP_DEBUG + DebugLog($"{nameof(OnEvent)} {eventName}"); +#endif + Error($"Unhandled event '{eventName}'"); + } + + #endregion + + #region Pool + + #region UdonPool Interface + + [FormerlySerializedAs("pool")] + [PublicAPI] + [HideInInspector] + public TlpBaseBehaviour Pool; + + // true if retrieved from the pool (use the pool reference to return it) + [PublicAPI] + [HideInInspector] + public bool PoolableInUse; + + /// + /// Called after instantiation (before OnReadyForUse) by the pool if this is a new instances that was never in the pool. + /// + /// (Called regardless of whether the created instance GameObject is active or not) + /// + /// Note: Pooled objects returned from the pool have this method called before they are enabled! + /// + [PublicAPI] + public virtual void OnCreated() + { +#if TLP_DEBUG + DebugLog(nameof(OnCreated)); +#endif + } + + /// + /// Called when this instance is no longer controlled by the pool (got removed from the pool to be used) + /// + /// Note: Pooled objects returned from the pool have this method called before they are enabled! + /// + [PublicAPI] + public virtual void OnReadyForUse() + { +#if TLP_DEBUG + DebugLog(nameof(OnReadyForUse)); +#endif + } + + /// + /// Called by the pool just before the instance is returned to the pool. + /// Shall be used to reset the state of this instance. + /// + /// Note: Pooled objects returning to the pool have this method called after they are disabled! + /// + [PublicAPI] + public virtual void OnPrepareForReturnToPool() + { +#if TLP_DEBUG + DebugLog(nameof(OnPrepareForReturnToPool)); +#endif + } + + #endregion + + #endregion + } +} \ No newline at end of file diff --git a/Packages/tlp.udonutils/Runtime/TlpBaseBehaviour.cs.meta b/Packages/tlp.udonutils/Runtime/TlpBaseBehaviour.cs.meta new file mode 100644 index 0000000..3d03553 --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/TlpBaseBehaviour.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ed91993f927dd6a47be10c55ca8ec9f0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/tlp.udonutils/Runtime/TlpExecutionOrder.cs b/Packages/tlp.udonutils/Runtime/TlpExecutionOrder.cs new file mode 100644 index 0000000..8bd93ad --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/TlpExecutionOrder.cs @@ -0,0 +1,24 @@ +namespace TLP.UdonUtils +{ + public static class TlpExecutionOrder + { + public const int Min = int.MinValue + 1_000_000; + public const int Max = AudioEnd + 1; + + public const int DefaultOffset = 150_000; + public const int DirectInputStart = -1_000 + DefaultOffset; + public const int DirectInputEnd = -1 + DefaultOffset; + public const int DefaultStart = 0 + DefaultOffset; + public const int DefaultEnd = 999 + DefaultOffset; + public const int VehicleMotionStart = 1_000 + DefaultOffset; + public const int VehicleMotionEnd = 1_999 + DefaultOffset; + public const int PlayerMotionStart = 2_000 + DefaultOffset; + public const int PlayerMotionEnd = 2_999 + DefaultOffset; + public const int WeaponsStart = 3_000 + DefaultOffset; + public const int WeaponsEnd = 3_999 + DefaultOffset; + public const int UiStart = 10_000 + DefaultOffset; + public const int UiEnd = 10_999 + DefaultOffset; + public const int AudioStart = 11_000 + DefaultOffset; + public const int AudioEnd = 11_999 + DefaultOffset; + } +} \ No newline at end of file diff --git a/Packages/tlp.udonutils/Runtime/TlpExecutionOrder.cs.meta b/Packages/tlp.udonutils/Runtime/TlpExecutionOrder.cs.meta new file mode 100644 index 0000000..614813a --- /dev/null +++ b/Packages/tlp.udonutils/Runtime/TlpExecutionOrder.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 1e3fb27ff73a4695b75c4071be439787 +timeCreated: 1675967220 \ No newline at end of file diff --git a/Packages/tlp.udonutils/package.json b/Packages/tlp.udonutils/package.json new file mode 100644 index 0000000..1baf41e --- /dev/null +++ b/Packages/tlp.udonutils/package.json @@ -0,0 +1,15 @@ +{ + "name": "tlp.udonutils", + "displayName": "TLP UdonUtils", + "version": "1.0.0", + "description": "Prefabs and potentially helpful examples for working with Udon/UdonSharp for VRChat Worlds.", + "gitDependencies": {}, + "author": { + "name": "Guribo", + "url": "https://github.com/Guribo" + }, + "vpmDependencies": { + "com.vrchat.udonsharp": "^1.1.x" + }, + "unity": "2019.4" +} \ No newline at end of file diff --git a/README.md.meta b/Packages/tlp.udonutils/package.json.meta similarity index 75% rename from README.md.meta rename to Packages/tlp.udonutils/package.json.meta index 4fcdfc0..25ec488 100644 --- a/README.md.meta +++ b/Packages/tlp.udonutils/package.json.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: b1c8baae57a510d4a87bf27586924dcd +guid: d74329d7a33298a4a9f6989517934db7 TextScriptImporter: externalObjects: {} userData: diff --git a/Prefabs/ILookAtTheLocalPlayer.prefab b/Prefabs/ILookAtTheLocalPlayer.prefab deleted file mode 100644 index aab86de..0000000 --- a/Prefabs/ILookAtTheLocalPlayer.prefab +++ /dev/null @@ -1,150 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!1 &2269216540744754717 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 2269216540744754719} - - component: {fileID: 2269216540744754718} - m_Layer: 0 - m_Name: ILookAtTheLocalPlayer - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &2269216540744754719 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2269216540744754717} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 2269216541675983627} - m_Father: {fileID: 0} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &2269216540744754718 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2269216540744754717} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 45115577ef41a5b4ca741ed302693907, type: 3} - m_Name: - m_EditorClassIdentifier: - interactTextPlacement: {fileID: 0} - interactText: Use - interactTextGO: {fileID: 0} - proximity: 2 - SynchronizePosition: 0 - AllowCollisionOwnershipTransfer: 0 - Reliable: 0 - serializedProgramAsset: {fileID: 11400000, guid: b126f87a17287974a8e0af0ada790138, - type: 2} - programSource: {fileID: 11400000, guid: a37533707706cdc4ba5293865ef9c38c, type: 2} - serializedPublicVariablesBytesString: Ai8AAAAAATIAAABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlAFQAYQBiAGwAZQAsACAAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4AAAAAAAYBAAAAAAAAACcBBAAAAHQAeQBwAGUAAWgAAABTAHkAcwB0AGUAbQAuAEMAbwBsAGwAZQBjAHQAaQBvAG4AcwAuAEcAZQBuAGUAcgBpAGMALgBMAGkAcwB0AGAAMQBbAFsAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4ALgBJAG4AdABlAHIAZgBhAGMAZQBzAC4ASQBVAGQAbwBuAFYAYQByAGkAYQBiAGwAZQAsACAAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4AXQBdACwAIABtAHMAYwBvAHIAbABpAGIAAQEJAAAAVgBhAHIAaQBhAGIAbABlAHMALwEAAAABaAAAAFMAeQBzAHQAZQBtAC4AQwBvAGwAbABlAGMAdABpAG8AbgBzAC4ARwBlAG4AZQByAGkAYwAuAEwAaQBzAHQAYAAxAFsAWwBWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAEkAbgB0AGUAcgBmAGEAYwBlAHMALgBJAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlACwAIABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgBdAF0ALAAgAG0AcwBjAG8AcgBsAGkAYgABAAAABgEAAAAAAAAAAi8CAAAAAUoAAABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlAGAAMQBbAFsAUwB5AHMAdABlAG0ALgBTAGkAbgBnAGwAZQAsACAAbQBzAGMAbwByAGwAaQBiAF0AXQAsACAAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4AAgAAAAYCAAAAAAAAACcBBAAAAHQAeQBwAGUAARcAAABTAHkAcwB0AGUAbQAuAFMAdAByAGkAbgBnACwAIABtAHMAYwBvAHIAbABpAGIAJwEKAAAAUwB5AG0AYgBvAGwATgBhAG0AZQABBgAAAHcAZQBpAGcAaAB0ACcBBAAAAHQAeQBwAGUAARcAAABTAHkAcwB0AGUAbQAuAFMAaQBuAGcAbABlACwAIABtAHMAYwBvAHIAbABpAGIAHwEFAAAAVgBhAGwAdQBlAAAAgD8HBQcFBwU= - publicVariablesUnityEngineObjects: [] - publicVariablesSerializationDataFormat: 0 ---- !u!1 &2269216541675983626 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 2269216541675983627} - - component: {fileID: 2269216541675983630} - - component: {fileID: 2269216541675983629} - - component: {fileID: 2269216541675983628} - m_Layer: 0 - m_Name: ExampleCube - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &2269216541675983627 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2269216541675983626} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 2269216540744754719} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!33 &2269216541675983630 -MeshFilter: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2269216541675983626} - m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} ---- !u!23 &2269216541675983629 -MeshRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2269216541675983626} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_DynamicOccludee: 1 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_RenderingLayerMask: 1 - m_RendererPriority: 0 - m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 0 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 ---- !u!65 &2269216541675983628 -BoxCollider: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2269216541675983626} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Size: {x: 1, y: 1, z: 1} - m_Center: {x: 0, y: 0, z: 0} diff --git a/Prefabs/ILookAtTheLocalPlayerUdonGraph.prefab b/Prefabs/ILookAtTheLocalPlayerUdonGraph.prefab deleted file mode 100644 index 2f321c9..0000000 --- a/Prefabs/ILookAtTheLocalPlayerUdonGraph.prefab +++ /dev/null @@ -1,150 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!1 &5887523046960514955 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 5887523046960514953} - - component: {fileID: 2686884558796281000} - m_Layer: 0 - m_Name: ILookAtTheLocalPlayerUdonGraph - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &5887523046960514953 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 5887523046960514955} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 5887523047639904925} - m_Father: {fileID: 0} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &2686884558796281000 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 5887523046960514955} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 45115577ef41a5b4ca741ed302693907, type: 3} - m_Name: - m_EditorClassIdentifier: - interactTextPlacement: {fileID: 0} - interactText: Use - interactTextGO: {fileID: 0} - proximity: 2 - SynchronizePosition: 0 - AllowCollisionOwnershipTransfer: 1 - Reliable: 0 - serializedProgramAsset: {fileID: 11400000, guid: d6bdc5fdaa093bc4b8bf3c34220f70bd, - type: 2} - programSource: {fileID: 11400000, guid: 282ba712dfa27c246b44b2c9e30d749c, type: 2} - serializedPublicVariablesBytesString: Ai8AAAAAATIAAABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlAFQAYQBiAGwAZQAsACAAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4AAAAAAAYBAAAAAAAAACcBBAAAAHQAeQBwAGUAAWgAAABTAHkAcwB0AGUAbQAuAEMAbwBsAGwAZQBjAHQAaQBvAG4AcwAuAEcAZQBuAGUAcgBpAGMALgBMAGkAcwB0AGAAMQBbAFsAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4ALgBJAG4AdABlAHIAZgBhAGMAZQBzAC4ASQBVAGQAbwBuAFYAYQByAGkAYQBiAGwAZQAsACAAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4AXQBdACwAIABtAHMAYwBvAHIAbABpAGIAAQEJAAAAVgBhAHIAaQBhAGIAbABlAHMALwEAAAABaAAAAFMAeQBzAHQAZQBtAC4AQwBvAGwAbABlAGMAdABpAG8AbgBzAC4ARwBlAG4AZQByAGkAYwAuAEwAaQBzAHQAYAAxAFsAWwBWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAEkAbgB0AGUAcgBmAGEAYwBlAHMALgBJAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlACwAIABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgBdAF0ALAAgAG0AcwBjAG8AcgBsAGkAYgABAAAABgEAAAAAAAAAAi8CAAAAAUoAAABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlAGAAMQBbAFsAUwB5AHMAdABlAG0ALgBTAGkAbgBnAGwAZQAsACAAbQBzAGMAbwByAGwAaQBiAF0AXQAsACAAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4AAgAAAAYCAAAAAAAAACcBBAAAAHQAeQBwAGUAARcAAABTAHkAcwB0AGUAbQAuAFMAdAByAGkAbgBnACwAIABtAHMAYwBvAHIAbABpAGIAJwEKAAAAUwB5AG0AYgBvAGwATgBhAG0AZQABBgAAAHcAZQBpAGcAaAB0ACcBBAAAAHQAeQBwAGUAARcAAABTAHkAcwB0AGUAbQAuAFMAaQBuAGcAbABlACwAIABtAHMAYwBvAHIAbABpAGIAHwEFAAAAVgBhAGwAdQBlAAAAgD8HBQcFBwU= - publicVariablesUnityEngineObjects: [] - publicVariablesSerializationDataFormat: 0 ---- !u!1 &5887523047639904924 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 5887523047639904925} - - component: {fileID: 5887523047639904920} - - component: {fileID: 5887523047639904923} - - component: {fileID: 5887523047639904922} - m_Layer: 0 - m_Name: ExampleCube - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &5887523047639904925 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 5887523047639904924} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 5887523046960514953} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!33 &5887523047639904920 -MeshFilter: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 5887523047639904924} - m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} ---- !u!23 &5887523047639904923 -MeshRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 5887523047639904924} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_DynamicOccludee: 1 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_RenderingLayerMask: 1 - m_RendererPriority: 0 - m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 0 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 ---- !u!65 &5887523047639904922 -BoxCollider: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 5887523047639904924} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Size: {x: 1, y: 1, z: 1} - m_Center: {x: 0, y: 0, z: 0} diff --git a/Prefabs/UdonCommon.prefab b/Prefabs/UdonCommon.prefab deleted file mode 100644 index 67ce29e..0000000 --- a/Prefabs/UdonCommon.prefab +++ /dev/null @@ -1,169 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!1 &3605882566993856259 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 2332087467844710116} - - component: {fileID: 6139366856658744666} - m_Layer: 0 - m_Name: Networking - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &2332087467844710116 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 3605882566993856259} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 8836536511599812955} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &6139366856658744666 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 3605882566993856259} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 45115577ef41a5b4ca741ed302693907, type: 3} - m_Name: - m_EditorClassIdentifier: - interactTextPlacement: {fileID: 0} - interactText: Use - interactTextGO: {fileID: 0} - proximity: 2 - SynchronizePosition: 0 - AllowCollisionOwnershipTransfer: 0 - Reliable: 0 - serializedProgramAsset: {fileID: 11400000, guid: c965fd3bcc7dce44eaf328e87588983f, - type: 2} - programSource: {fileID: 11400000, guid: 777efcf936ab8264b9f792163a8f4ae2, type: 2} - serializedPublicVariablesBytesString: Ai8AAAAAATIAAABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlAFQAYQBiAGwAZQAsACAAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4AAAAAAAYBAAAAAAAAACcBBAAAAHQAeQBwAGUAAWgAAABTAHkAcwB0AGUAbQAuAEMAbwBsAGwAZQBjAHQAaQBvAG4AcwAuAEcAZQBuAGUAcgBpAGMALgBMAGkAcwB0AGAAMQBbAFsAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4ALgBJAG4AdABlAHIAZgBhAGMAZQBzAC4ASQBVAGQAbwBuAFYAYQByAGkAYQBiAGwAZQAsACAAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4AXQBdACwAIABtAHMAYwBvAHIAbABpAGIAAQEJAAAAVgBhAHIAaQBhAGIAbABlAHMALwEAAAABaAAAAFMAeQBzAHQAZQBtAC4AQwBvAGwAbABlAGMAdABpAG8AbgBzAC4ARwBlAG4AZQByAGkAYwAuAEwAaQBzAHQAYAAxAFsAWwBWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAEkAbgB0AGUAcgBmAGEAYwBlAHMALgBJAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlACwAIABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgBdAF0ALAAgAG0AcwBjAG8AcgBsAGkAYgABAAAABgIAAAAAAAAAAi8CAAAAAVMAAABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlAGAAMQBbAFsAVgBSAEMALgBVAGQAbwBuAC4AVQBkAG8AbgBCAGUAaABhAHYAaQBvAHUAcgAsACAAVgBSAEMALgBVAGQAbwBuAF0AXQAsACAAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4AAgAAAAYCAAAAAAAAACcBBAAAAHQAeQBwAGUAARcAAABTAHkAcwB0AGUAbQAuAFMAdAByAGkAbgBnACwAIABtAHMAYwBvAHIAbABpAGIAJwEKAAAAUwB5AG0AYgBvAGwATgBhAG0AZQABCgAAAHUAZABvAG4AQwBvAG0AbQBvAG4AJwEEAAAAdAB5AHAAZQABIAAAAFYAUgBDAC4AVQBkAG8AbgAuAFUAZABvAG4AQgBlAGgAYQB2AGkAbwB1AHIALAAgAFYAUgBDAC4AVQBkAG8AbgALAQUAAABWAGEAbAB1AGUAAAAAAAcFAjACAAAAAwAAAAYCAAAAAAAAACcBBAAAAHQAeQBwAGUAARcAAABTAHkAcwB0AGUAbQAuAFMAdAByAGkAbgBnACwAIABtAHMAYwBvAHIAbABpAGIAJwEKAAAAUwB5AG0AYgBvAGwATgBhAG0AZQABCQAAAHUAZABvAG4ARABlAGIAdQBnACcBBAAAAHQAeQBwAGUAASAAAABWAFIAQwAuAFUAZABvAG4ALgBVAGQAbwBuAEIAZQBoAGEAdgBpAG8AdQByACwAIABWAFIAQwAuAFUAZABvAG4ACwEFAAAAVgBhAGwAdQBlAAEAAAAHBQcFBwU= - publicVariablesUnityEngineObjects: - - {fileID: 2633040723707340454} - - {fileID: 8836536511599812952} - publicVariablesSerializationDataFormat: 0 ---- !u!1 &8836536511599812901 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 8836536511599812955} - - component: {fileID: 8836536511599812954} - - component: {fileID: 8836536511599812952} - - component: {fileID: 2633040723707340454} - m_Layer: 0 - m_Name: UdonCommon - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 - m_IsActive: 1 ---- !u!4 &8836536511599812955 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8836536511599812901} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 2332087467844710116} - m_Father: {fileID: 0} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &8836536511599812954 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8836536511599812901} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 45115577ef41a5b4ca741ed302693907, type: 3} - m_Name: - m_EditorClassIdentifier: - interactTextPlacement: {fileID: 0} - interactText: Use - interactTextGO: {fileID: 0} - proximity: 2 - SynchronizePosition: 0 - AllowCollisionOwnershipTransfer: 0 - Reliable: 0 - serializedProgramAsset: {fileID: 11400000, guid: 5b10d8de98911b343bc4026f9301f605, - type: 2} - programSource: {fileID: 11400000, guid: e7ee04f28c429a6408a600a72eeede95, type: 2} - serializedPublicVariablesBytesString: Ai8AAAAAATIAAABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlAFQAYQBiAGwAZQAsACAAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4AAAAAAAYBAAAAAAAAACcBBAAAAHQAeQBwAGUAAWgAAABTAHkAcwB0AGUAbQAuAEMAbwBsAGwAZQBjAHQAaQBvAG4AcwAuAEcAZQBuAGUAcgBpAGMALgBMAGkAcwB0AGAAMQBbAFsAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4ALgBJAG4AdABlAHIAZgBhAGMAZQBzAC4ASQBVAGQAbwBuAFYAYQByAGkAYQBiAGwAZQAsACAAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4AXQBdACwAIABtAHMAYwBvAHIAbABpAGIAAQEJAAAAVgBhAHIAaQBhAGIAbABlAHMALwEAAAABaAAAAFMAeQBzAHQAZQBtAC4AQwBvAGwAbABlAGMAdABpAG8AbgBzAC4ARwBlAG4AZQByAGkAYwAuAEwAaQBzAHQAYAAxAFsAWwBWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAEkAbgB0AGUAcgBmAGEAYwBlAHMALgBJAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlACwAIABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgBdAF0ALAAgAG0AcwBjAG8AcgBsAGkAYgABAAAABgAAAAAAAAAABwUHBQ== - publicVariablesUnityEngineObjects: [] - publicVariablesSerializationDataFormat: 0 ---- !u!114 &8836536511599812952 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8836536511599812901} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 45115577ef41a5b4ca741ed302693907, type: 3} - m_Name: - m_EditorClassIdentifier: - interactTextPlacement: {fileID: 0} - interactText: Use - interactTextGO: {fileID: 0} - proximity: 2 - SynchronizePosition: 0 - AllowCollisionOwnershipTransfer: 0 - Reliable: 0 - serializedProgramAsset: {fileID: 11400000, guid: 38b8d3d02ad23bd468e0c49452e108cb, - type: 2} - programSource: {fileID: 11400000, guid: ccfba9ab8ff45f64c9539764aa13ec95, type: 2} - serializedPublicVariablesBytesString: Ai8AAAAAATIAAABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlAFQAYQBiAGwAZQAsACAAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4AAAAAAAYBAAAAAAAAACcBBAAAAHQAeQBwAGUAAWgAAABTAHkAcwB0AGUAbQAuAEMAbwBsAGwAZQBjAHQAaQBvAG4AcwAuAEcAZQBuAGUAcgBpAGMALgBMAGkAcwB0AGAAMQBbAFsAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4ALgBJAG4AdABlAHIAZgBhAGMAZQBzAC4ASQBVAGQAbwBuAFYAYQByAGkAYQBiAGwAZQAsACAAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4AXQBdACwAIABtAHMAYwBvAHIAbABpAGIAAQEJAAAAVgBhAHIAaQBhAGIAbABlAHMALwEAAAABaAAAAFMAeQBzAHQAZQBtAC4AQwBvAGwAbABlAGMAdABpAG8AbgBzAC4ARwBlAG4AZQByAGkAYwAuAEwAaQBzAHQAYAAxAFsAWwBWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAEkAbgB0AGUAcgBmAGEAYwBlAHMALgBJAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlACwAIABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgBdAF0ALAAgAG0AcwBjAG8AcgBsAGkAYgABAAAABgAAAAAAAAAABwUHBQ== - publicVariablesUnityEngineObjects: [] - publicVariablesSerializationDataFormat: 0 ---- !u!114 &2633040723707340454 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8836536511599812901} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 45115577ef41a5b4ca741ed302693907, type: 3} - m_Name: - m_EditorClassIdentifier: - interactTextPlacement: {fileID: 0} - interactText: Use - interactTextGO: {fileID: 0} - proximity: 2 - SynchronizePosition: 0 - AllowCollisionOwnershipTransfer: 0 - Reliable: 0 - serializedProgramAsset: {fileID: 11400000, guid: 376aa8c882e940b498a22f9c3dc109e3, - type: 2} - programSource: {fileID: 11400000, guid: f1a80167fd5f061499c834bb971daf3b, type: 2} - serializedPublicVariablesBytesString: Ai8AAAAAATIAAABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlAFQAYQBiAGwAZQAsACAAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4AAAAAAAYBAAAAAAAAACcBBAAAAHQAeQBwAGUAAWgAAABTAHkAcwB0AGUAbQAuAEMAbwBsAGwAZQBjAHQAaQBvAG4AcwAuAEcAZQBuAGUAcgBpAGMALgBMAGkAcwB0AGAAMQBbAFsAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4ALgBJAG4AdABlAHIAZgBhAGMAZQBzAC4ASQBVAGQAbwBuAFYAYQByAGkAYQBiAGwAZQAsACAAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4AXQBdACwAIABtAHMAYwBvAHIAbABpAGIAAQEJAAAAVgBhAHIAaQBhAGIAbABlAHMALwEAAAABaAAAAFMAeQBzAHQAZQBtAC4AQwBvAGwAbABlAGMAdABpAG8AbgBzAC4ARwBlAG4AZQByAGkAYwAuAEwAaQBzAHQAYAAxAFsAWwBWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAEkAbgB0AGUAcgBmAGEAYwBlAHMALgBJAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlACwAIABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgBdAF0ALAAgAG0AcwBjAG8AcgBsAGkAYgABAAAABgAAAAAAAAAABwUHBQ== - publicVariablesUnityEngineObjects: [] - publicVariablesSerializationDataFormat: 0 diff --git a/README.md b/README.md deleted file mode 100644 index 00fac1c..0000000 --- a/README.md +++ /dev/null @@ -1,55 +0,0 @@ -# Udon Utilitiess - -Scripts that make developing with UDON for VRChat safer and more fun :) - -# Requirements - - - [UdonSharp](https://github.com/vrchat-community/UdonSharp#requirements) as described by [Merlin](https://github.com/MerlinVR) - -## Features - -#### Scene Checking -* automatically checks the scene for empty public variables (*null*) and logs to the console (every time assets get saved) -* allows checking manually via menu entry to allow instant navigation to errors - -#### Editor Scripting -* UdonBehaviour Extension methods for changing and reading UdonBehaviour variables in Edit mode have been added. - -## Usage and Examples - -### Scene Checking -Use via menu or silently by saving the scene (Ctrl+s): -![Menu](README/menu.png) - -Skip or show errors: -![Error Dialog](README/errorMessage.png) - -Locate empty variable by name and allow easy fixing of variable (optionally (¬‿¬) ): -![Error Location](README/errorLocation.png) - -Warns about potential errors is the console and clicking on the message will alos highlight the affected gameobject in the hierarchy: -![Error Navigation in Console](README/errorNavigationInConsole.png) - -In case all errors get skipped a conclusion will be presented: -![Conclusion on Skipping](README/conclusion.png) - -### Editor Scripting -> [Example script](Scripts/Examples/InspectorValueChangerExample.cs) -````c# -public UdonBehaviour editorTestingBehaviour; - -public void TrySetVariables() -{ - editorTestingBehaviour.SetInspectorVariable("testInt", 100); - editorTestingBehaviour.SetInspectorVariable("testString", "Hello World"); - editorTestingBehaviour.SetInspectorVariable("testTransform", gameObject.transform); - editorTestingBehaviour.SetInspectorVariable("testGameObject", gameObject); - editorTestingBehaviour.SetInspectorVariable("testScriptReference", editorTestingBehaviour); -} - -... -```` - -![Conclusion on Skipping](README/inspectorValueChangerExample.gif) -*Example scene and scripts are included* - diff --git a/README/conclusion.png b/README/conclusion.png deleted file mode 100644 index fec9baf..0000000 Binary files a/README/conclusion.png and /dev/null differ diff --git a/README/conclusion.png.meta b/README/conclusion.png.meta deleted file mode 100644 index f7ec1b3..0000000 --- a/README/conclusion.png.meta +++ /dev/null @@ -1,88 +0,0 @@ -fileFormatVersion: 2 -guid: dc9f0269d03d56d449f1df362b7f277b -TextureImporter: - fileIDToRecycleName: {} - externalObjects: {} - serializedVersion: 9 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - sRGBTexture: 1 - linearTexture: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapsPreserveCoverage: 0 - alphaTestReferenceValue: 0.5 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: 0.25 - normalMapFilter: 0 - isReadable: 0 - streamingMipmaps: 0 - streamingMipmapsPriority: 0 - grayScaleToAlpha: 0 - generateCubemap: 6 - cubemapConvolution: 0 - seamlessCubemap: 0 - textureFormat: 1 - maxTextureSize: 2048 - textureSettings: - serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 - wrapU: -1 - wrapV: -1 - wrapW: -1 - nPOTScale: 1 - lightmap: 0 - compressionQuality: 50 - spriteMode: 0 - spriteExtrude: 1 - spriteMeshType: 1 - alignment: 0 - spritePivot: {x: 0.5, y: 0.5} - spritePixelsToUnits: 100 - spriteBorder: {x: 0, y: 0, z: 0, w: 0} - spriteGenerateFallbackPhysicsShape: 1 - alphaUsage: 1 - alphaIsTransparency: 0 - spriteTessellationDetail: -1 - textureType: 0 - textureShape: 1 - singleChannelComponent: 0 - maxTextureSizeSet: 0 - compressionQualitySet: 0 - textureFormatSet: 0 - platformSettings: - - serializedVersion: 2 - buildTarget: DefaultTexturePlatform - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - androidETC2FallbackOverride: 0 - spriteSheet: - serializedVersion: 2 - sprites: [] - outline: [] - physicsShape: [] - bones: [] - spriteID: - vertices: [] - indices: - edges: [] - weights: [] - spritePackingTag: - pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 - userData: - assetBundleName: - assetBundleVariant: diff --git a/README/errorLocation.png b/README/errorLocation.png deleted file mode 100644 index cbcec46..0000000 Binary files a/README/errorLocation.png and /dev/null differ diff --git a/README/errorLocation.png.meta b/README/errorLocation.png.meta deleted file mode 100644 index 11aed7a..0000000 --- a/README/errorLocation.png.meta +++ /dev/null @@ -1,88 +0,0 @@ -fileFormatVersion: 2 -guid: aa3f2ff93b684394a808b18fa63ab521 -TextureImporter: - fileIDToRecycleName: {} - externalObjects: {} - serializedVersion: 9 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - sRGBTexture: 1 - linearTexture: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapsPreserveCoverage: 0 - alphaTestReferenceValue: 0.5 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: 0.25 - normalMapFilter: 0 - isReadable: 0 - streamingMipmaps: 0 - streamingMipmapsPriority: 0 - grayScaleToAlpha: 0 - generateCubemap: 6 - cubemapConvolution: 0 - seamlessCubemap: 0 - textureFormat: 1 - maxTextureSize: 2048 - textureSettings: - serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 - wrapU: -1 - wrapV: -1 - wrapW: -1 - nPOTScale: 1 - lightmap: 0 - compressionQuality: 50 - spriteMode: 0 - spriteExtrude: 1 - spriteMeshType: 1 - alignment: 0 - spritePivot: {x: 0.5, y: 0.5} - spritePixelsToUnits: 100 - spriteBorder: {x: 0, y: 0, z: 0, w: 0} - spriteGenerateFallbackPhysicsShape: 1 - alphaUsage: 1 - alphaIsTransparency: 0 - spriteTessellationDetail: -1 - textureType: 0 - textureShape: 1 - singleChannelComponent: 0 - maxTextureSizeSet: 0 - compressionQualitySet: 0 - textureFormatSet: 0 - platformSettings: - - serializedVersion: 2 - buildTarget: DefaultTexturePlatform - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - androidETC2FallbackOverride: 0 - spriteSheet: - serializedVersion: 2 - sprites: [] - outline: [] - physicsShape: [] - bones: [] - spriteID: - vertices: [] - indices: - edges: [] - weights: [] - spritePackingTag: - pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 - userData: - assetBundleName: - assetBundleVariant: diff --git a/README/errorMessage.png b/README/errorMessage.png deleted file mode 100644 index 1c6fb5a..0000000 Binary files a/README/errorMessage.png and /dev/null differ diff --git a/README/errorMessage.png.meta b/README/errorMessage.png.meta deleted file mode 100644 index 7e38b03..0000000 --- a/README/errorMessage.png.meta +++ /dev/null @@ -1,88 +0,0 @@ -fileFormatVersion: 2 -guid: 9fc8bace10af67d458d4b0bc83385694 -TextureImporter: - fileIDToRecycleName: {} - externalObjects: {} - serializedVersion: 9 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - sRGBTexture: 1 - linearTexture: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapsPreserveCoverage: 0 - alphaTestReferenceValue: 0.5 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: 0.25 - normalMapFilter: 0 - isReadable: 0 - streamingMipmaps: 0 - streamingMipmapsPriority: 0 - grayScaleToAlpha: 0 - generateCubemap: 6 - cubemapConvolution: 0 - seamlessCubemap: 0 - textureFormat: 1 - maxTextureSize: 2048 - textureSettings: - serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 - wrapU: -1 - wrapV: -1 - wrapW: -1 - nPOTScale: 1 - lightmap: 0 - compressionQuality: 50 - spriteMode: 0 - spriteExtrude: 1 - spriteMeshType: 1 - alignment: 0 - spritePivot: {x: 0.5, y: 0.5} - spritePixelsToUnits: 100 - spriteBorder: {x: 0, y: 0, z: 0, w: 0} - spriteGenerateFallbackPhysicsShape: 1 - alphaUsage: 1 - alphaIsTransparency: 0 - spriteTessellationDetail: -1 - textureType: 0 - textureShape: 1 - singleChannelComponent: 0 - maxTextureSizeSet: 0 - compressionQualitySet: 0 - textureFormatSet: 0 - platformSettings: - - serializedVersion: 2 - buildTarget: DefaultTexturePlatform - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - androidETC2FallbackOverride: 0 - spriteSheet: - serializedVersion: 2 - sprites: [] - outline: [] - physicsShape: [] - bones: [] - spriteID: - vertices: [] - indices: - edges: [] - weights: [] - spritePackingTag: - pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 - userData: - assetBundleName: - assetBundleVariant: diff --git a/README/errorNavigationInConsole.png b/README/errorNavigationInConsole.png deleted file mode 100644 index 73c5f95..0000000 Binary files a/README/errorNavigationInConsole.png and /dev/null differ diff --git a/README/errorNavigationInConsole.png.meta b/README/errorNavigationInConsole.png.meta deleted file mode 100644 index dadc0f4..0000000 --- a/README/errorNavigationInConsole.png.meta +++ /dev/null @@ -1,88 +0,0 @@ -fileFormatVersion: 2 -guid: d2b7c6cb4a9e298419bb755795008b3f -TextureImporter: - fileIDToRecycleName: {} - externalObjects: {} - serializedVersion: 9 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - sRGBTexture: 1 - linearTexture: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapsPreserveCoverage: 0 - alphaTestReferenceValue: 0.5 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: 0.25 - normalMapFilter: 0 - isReadable: 0 - streamingMipmaps: 0 - streamingMipmapsPriority: 0 - grayScaleToAlpha: 0 - generateCubemap: 6 - cubemapConvolution: 0 - seamlessCubemap: 0 - textureFormat: 1 - maxTextureSize: 2048 - textureSettings: - serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 - wrapU: -1 - wrapV: -1 - wrapW: -1 - nPOTScale: 1 - lightmap: 0 - compressionQuality: 50 - spriteMode: 0 - spriteExtrude: 1 - spriteMeshType: 1 - alignment: 0 - spritePivot: {x: 0.5, y: 0.5} - spritePixelsToUnits: 100 - spriteBorder: {x: 0, y: 0, z: 0, w: 0} - spriteGenerateFallbackPhysicsShape: 1 - alphaUsage: 1 - alphaIsTransparency: 0 - spriteTessellationDetail: -1 - textureType: 0 - textureShape: 1 - singleChannelComponent: 0 - maxTextureSizeSet: 0 - compressionQualitySet: 0 - textureFormatSet: 0 - platformSettings: - - serializedVersion: 2 - buildTarget: DefaultTexturePlatform - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - androidETC2FallbackOverride: 0 - spriteSheet: - serializedVersion: 2 - sprites: [] - outline: [] - physicsShape: [] - bones: [] - spriteID: - vertices: [] - indices: - edges: [] - weights: [] - spritePackingTag: - pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 - userData: - assetBundleName: - assetBundleVariant: diff --git a/README/inspectorValueChangerExample.gif b/README/inspectorValueChangerExample.gif deleted file mode 100644 index 965cb25..0000000 Binary files a/README/inspectorValueChangerExample.gif and /dev/null differ diff --git a/README/inspectorValueChangerExample.gif.meta b/README/inspectorValueChangerExample.gif.meta deleted file mode 100644 index 66e635a..0000000 --- a/README/inspectorValueChangerExample.gif.meta +++ /dev/null @@ -1,88 +0,0 @@ -fileFormatVersion: 2 -guid: 8e562fe3d4f2a1f43bfba5a71b1be4ae -TextureImporter: - fileIDToRecycleName: {} - externalObjects: {} - serializedVersion: 9 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - sRGBTexture: 1 - linearTexture: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapsPreserveCoverage: 0 - alphaTestReferenceValue: 0.5 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: 0.25 - normalMapFilter: 0 - isReadable: 0 - streamingMipmaps: 0 - streamingMipmapsPriority: 0 - grayScaleToAlpha: 0 - generateCubemap: 6 - cubemapConvolution: 0 - seamlessCubemap: 0 - textureFormat: 1 - maxTextureSize: 2048 - textureSettings: - serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 - wrapU: -1 - wrapV: -1 - wrapW: -1 - nPOTScale: 1 - lightmap: 0 - compressionQuality: 50 - spriteMode: 0 - spriteExtrude: 1 - spriteMeshType: 1 - alignment: 0 - spritePivot: {x: 0.5, y: 0.5} - spritePixelsToUnits: 100 - spriteBorder: {x: 0, y: 0, z: 0, w: 0} - spriteGenerateFallbackPhysicsShape: 1 - alphaUsage: 1 - alphaIsTransparency: 0 - spriteTessellationDetail: -1 - textureType: 0 - textureShape: 1 - singleChannelComponent: 0 - maxTextureSizeSet: 0 - compressionQualitySet: 0 - textureFormatSet: 0 - platformSettings: - - serializedVersion: 2 - buildTarget: DefaultTexturePlatform - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - androidETC2FallbackOverride: 0 - spriteSheet: - serializedVersion: 2 - sprites: [] - outline: [] - physicsShape: [] - bones: [] - spriteID: - vertices: [] - indices: - edges: [] - weights: [] - spritePackingTag: - pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 - userData: - assetBundleName: - assetBundleVariant: diff --git a/README/menu.png b/README/menu.png deleted file mode 100644 index e1ee7ae..0000000 Binary files a/README/menu.png and /dev/null differ diff --git a/README/menu.png.meta b/README/menu.png.meta deleted file mode 100644 index 2e9a0b2..0000000 --- a/README/menu.png.meta +++ /dev/null @@ -1,88 +0,0 @@ -fileFormatVersion: 2 -guid: ea7011410be28b740998bd549b526439 -TextureImporter: - fileIDToRecycleName: {} - externalObjects: {} - serializedVersion: 9 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - sRGBTexture: 1 - linearTexture: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapsPreserveCoverage: 0 - alphaTestReferenceValue: 0.5 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: 0.25 - normalMapFilter: 0 - isReadable: 0 - streamingMipmaps: 0 - streamingMipmapsPriority: 0 - grayScaleToAlpha: 0 - generateCubemap: 6 - cubemapConvolution: 0 - seamlessCubemap: 0 - textureFormat: 1 - maxTextureSize: 2048 - textureSettings: - serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 - wrapU: -1 - wrapV: -1 - wrapW: -1 - nPOTScale: 1 - lightmap: 0 - compressionQuality: 50 - spriteMode: 0 - spriteExtrude: 1 - spriteMeshType: 1 - alignment: 0 - spritePivot: {x: 0.5, y: 0.5} - spritePixelsToUnits: 100 - spriteBorder: {x: 0, y: 0, z: 0, w: 0} - spriteGenerateFallbackPhysicsShape: 1 - alphaUsage: 1 - alphaIsTransparency: 0 - spriteTessellationDetail: -1 - textureType: 0 - textureShape: 1 - singleChannelComponent: 0 - maxTextureSizeSet: 0 - compressionQualitySet: 0 - textureFormatSet: 0 - platformSettings: - - serializedVersion: 2 - buildTarget: DefaultTexturePlatform - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - androidETC2FallbackOverride: 0 - spriteSheet: - serializedVersion: 2 - sprites: [] - outline: [] - physicsShape: [] - bones: [] - spriteID: - vertices: [] - indices: - edges: [] - weights: [] - spritePackingTag: - pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Scenes/Examples/EditorTesting.unity b/Scenes/Examples/EditorTesting.unity deleted file mode 100644 index 5726615..0000000 --- a/Scenes/Examples/EditorTesting.unity +++ /dev/null @@ -1,335 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!29 &1 -OcclusionCullingSettings: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_OcclusionBakeSettings: - smallestOccluder: 5 - smallestHole: 0.25 - backfaceThreshold: 100 - m_SceneGUID: 00000000000000000000000000000000 - m_OcclusionCullingData: {fileID: 0} ---- !u!104 &2 -RenderSettings: - m_ObjectHideFlags: 0 - serializedVersion: 9 - m_Fog: 0 - m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} - m_FogMode: 3 - m_FogDensity: 0.01 - m_LinearFogStart: 0 - m_LinearFogEnd: 300 - m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} - m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} - m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} - m_AmbientIntensity: 1 - m_AmbientMode: 0 - m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} - m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} - m_HaloStrength: 0.5 - m_FlareStrength: 1 - m_FlareFadeSpeed: 3 - m_HaloTexture: {fileID: 0} - m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} - m_DefaultReflectionMode: 0 - m_DefaultReflectionResolution: 128 - m_ReflectionBounces: 1 - m_ReflectionIntensity: 1 - m_CustomReflection: {fileID: 0} - m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.18028378, g: 0.22571412, b: 0.30692285, a: 1} - m_UseRadianceAmbientProbe: 0 ---- !u!157 &3 -LightmapSettings: - m_ObjectHideFlags: 0 - serializedVersion: 11 - m_GIWorkflowMode: 0 - m_GISettings: - serializedVersion: 2 - m_BounceScale: 1 - m_IndirectOutputScale: 1 - m_AlbedoBoost: 1 - m_EnvironmentLightingMode: 0 - m_EnableBakedLightmaps: 1 - m_EnableRealtimeLightmaps: 1 - m_LightmapEditorSettings: - serializedVersion: 10 - m_Resolution: 2 - m_BakeResolution: 40 - m_AtlasSize: 1024 - m_AO: 0 - m_AOMaxDistance: 1 - m_CompAOExponent: 1 - m_CompAOExponentDirect: 0 - m_Padding: 2 - m_LightmapParameters: {fileID: 0} - m_LightmapsBakeMode: 1 - m_TextureCompression: 1 - m_FinalGather: 0 - m_FinalGatherFiltering: 1 - m_FinalGatherRayCount: 256 - m_ReflectionCompression: 2 - m_MixedBakeMode: 2 - m_BakeBackend: 1 - m_PVRSampling: 1 - m_PVRDirectSampleCount: 32 - m_PVRSampleCount: 500 - m_PVRBounces: 2 - m_PVRFilterTypeDirect: 0 - m_PVRFilterTypeIndirect: 0 - m_PVRFilterTypeAO: 0 - m_PVRFilteringMode: 1 - m_PVRCulling: 1 - m_PVRFilteringGaussRadiusDirect: 1 - m_PVRFilteringGaussRadiusIndirect: 5 - m_PVRFilteringGaussRadiusAO: 2 - m_PVRFilteringAtrousPositionSigmaDirect: 0.5 - m_PVRFilteringAtrousPositionSigmaIndirect: 2 - m_PVRFilteringAtrousPositionSigmaAO: 1 - m_ShowResolutionOverlay: 1 - m_LightingDataAsset: {fileID: 0} - m_UseShadowmask: 1 ---- !u!196 &4 -NavMeshSettings: - serializedVersion: 2 - m_ObjectHideFlags: 0 - m_BuildSettings: - serializedVersion: 2 - agentTypeID: 0 - agentRadius: 0.5 - agentHeight: 2 - agentSlope: 45 - agentClimb: 0.4 - ledgeDropHeight: 0 - maxJumpAcrossDistance: 0 - minRegionArea: 2 - manualCellSize: 0 - cellSize: 0.16666667 - manualTileSize: 0 - tileSize: 256 - accuratePlacement: 0 - debug: - m_Flags: 0 - m_NavMeshData: {fileID: 0} ---- !u!1 &1244135264 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1244135267} - - component: {fileID: 1244135266} - - component: {fileID: 1244135265} - m_Layer: 0 - m_Name: Main Camera - m_TagString: MainCamera - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!81 &1244135265 -AudioListener: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1244135264} - m_Enabled: 1 ---- !u!20 &1244135266 -Camera: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1244135264} - m_Enabled: 1 - serializedVersion: 2 - m_ClearFlags: 1 - m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} - m_projectionMatrixMode: 1 - m_SensorSize: {x: 36, y: 24} - m_LensShift: {x: 0, y: 0} - m_GateFitMode: 2 - m_FocalLength: 50 - m_NormalizedViewPortRect: - serializedVersion: 2 - x: 0 - y: 0 - width: 1 - height: 1 - near clip plane: 0.3 - far clip plane: 1000 - field of view: 60 - orthographic: 0 - orthographic size: 5 - m_Depth: -1 - m_CullingMask: - serializedVersion: 2 - m_Bits: 4294967295 - m_RenderingPath: -1 - m_TargetTexture: {fileID: 0} - m_TargetDisplay: 0 - m_TargetEye: 3 - m_HDR: 1 - m_AllowMSAA: 1 - m_AllowDynamicResolution: 0 - m_ForceIntoRT: 0 - m_OcclusionCulling: 1 - m_StereoConvergence: 10 - m_StereoSeparation: 0.022 ---- !u!4 &1244135267 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1244135264} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 1, z: -10} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &1695130163 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1695130166} - - component: {fileID: 1695130165} - - component: {fileID: 1695130164} - m_Layer: 0 - m_Name: TestSetVariableFromUnityScriptInEditMode - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &1695130164 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1695130163} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 1e0c616f4e5d4d2780ffa49f2c92b335, type: 3} - m_Name: - m_EditorClassIdentifier: - editorTestingBehaviour: {fileID: 1695130165} ---- !u!114 &1695130165 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1695130163} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 45115577ef41a5b4ca741ed302693907, type: 3} - m_Name: - m_EditorClassIdentifier: - interactTextPlacement: {fileID: 0} - interactText: Use - interactTextGO: {fileID: 0} - proximity: 2 - SynchronizePosition: 0 - AllowCollisionOwnershipTransfer: 0 - Reliable: 0 - serializedProgramAsset: {fileID: 11400000, guid: 12b3ab89a2110a54b8004b7c1e2587f7, - type: 2} - programSource: {fileID: 11400000, guid: c29d80bdbf2e26c4d8e2ba2e675781ed, type: 2} - serializedPublicVariablesBytesString: Ai8AAAAAATIAAABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlAFQAYQBiAGwAZQAsACAAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4AAAAAAAYBAAAAAAAAACcBBAAAAHQAeQBwAGUAAWgAAABTAHkAcwB0AGUAbQAuAEMAbwBsAGwAZQBjAHQAaQBvAG4AcwAuAEcAZQBuAGUAcgBpAGMALgBMAGkAcwB0AGAAMQBbAFsAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4ALgBJAG4AdABlAHIAZgBhAGMAZQBzAC4ASQBVAGQAbwBuAFYAYQByAGkAYQBiAGwAZQAsACAAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4AXQBdACwAIABtAHMAYwBvAHIAbABpAGIAAQEJAAAAVgBhAHIAaQBhAGIAbABlAHMALwEAAAABaAAAAFMAeQBzAHQAZQBtAC4AQwBvAGwAbABlAGMAdABpAG8AbgBzAC4ARwBlAG4AZQByAGkAYwAuAEwAaQBzAHQAYAAxAFsAWwBWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAEkAbgB0AGUAcgBmAGEAYwBlAHMALgBJAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlACwAIABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgBdAF0ALAAgAG0AcwBjAG8AcgBsAGkAYgABAAAABgIAAAAAAAAAAi8CAAAAAUkAAABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlAGAAMQBbAFsAUwB5AHMAdABlAG0ALgBJAG4AdAAzADIALAAgAG0AcwBjAG8AcgBsAGkAYgBdAF0ALAAgAFYAUgBDAC4AVQBkAG8AbgAuAEMAbwBtAG0AbwBuAAIAAAAGAgAAAAAAAAAnAQQAAAB0AHkAcABlAAEXAAAAUwB5AHMAdABlAG0ALgBTAHQAcgBpAG4AZwAsACAAbQBzAGMAbwByAGwAaQBiACcBCgAAAFMAeQBtAGIAbwBsAE4AYQBtAGUAAQcAAAB0AGUAcwB0AEkAbgB0ACcBBAAAAHQAeQBwAGUAARYAAABTAHkAcwB0AGUAbQAuAEkAbgB0ADMAMgAsACAAbQBzAGMAbwByAGwAaQBiABcBBQAAAFYAYQBsAHUAZQAAAAAABwUCLwMAAAABSgAAAFYAUgBDAC4AVQBkAG8AbgAuAEMAbwBtAG0AbwBuAC4AVQBkAG8AbgBWAGEAcgBpAGEAYgBsAGUAYAAxAFsAWwBTAHkAcwB0AGUAbQAuAFMAdAByAGkAbgBnACwAIABtAHMAYwBvAHIAbABpAGIAXQBdACwAIABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgADAAAABgIAAAAAAAAAJwEEAAAAdAB5AHAAZQABFwAAAFMAeQBzAHQAZQBtAC4AUwB0AHIAaQBuAGcALAAgAG0AcwBjAG8AcgBsAGkAYgAnAQoAAABTAHkAbQBiAG8AbABOAGEAbQBlAAEKAAAAdABlAHMAdABTAHQAcgBpAG4AZwAnAQQAAAB0AHkAcABlAAEXAAAAUwB5AHMAdABlAG0ALgBTAHQAcgBpAG4AZwAsACAAbQBzAGMAbwByAGwAaQBiACcBBQAAAFYAYQBsAHUAZQABAAAAAAcFBwUHBQ== - publicVariablesUnityEngineObjects: [] - publicVariablesSerializationDataFormat: 0 ---- !u!4 &1695130166 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1695130163} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 2 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &1710814302 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1710814304} - - component: {fileID: 1710814303} - m_Layer: 0 - m_Name: Directional Light - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!108 &1710814303 -Light: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1710814302} - m_Enabled: 1 - serializedVersion: 8 - m_Type: 1 - m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} - m_Intensity: 1 - m_Range: 10 - m_SpotAngle: 30 - m_CookieSize: 10 - m_Shadows: - m_Type: 2 - m_Resolution: -1 - m_CustomResolution: -1 - m_Strength: 1 - m_Bias: 0.05 - m_NormalBias: 0.4 - m_NearPlane: 0.2 - m_Cookie: {fileID: 0} - m_DrawHalo: 0 - m_Flare: {fileID: 0} - m_RenderMode: 0 - m_CullingMask: - serializedVersion: 2 - m_Bits: 4294967295 - m_Lightmapping: 4 - m_LightShadowCasterMode: 0 - m_AreaSize: {x: 1, y: 1} - m_BounceIntensity: 1 - m_ColorTemperature: 6570 - m_UseColorTemperature: 0 - m_ShadowRadius: 0 - m_ShadowAngle: 0 ---- !u!4 &1710814304 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1710814302} - m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} - m_LocalPosition: {x: 0, y: 3, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} diff --git a/Scenes/Examples/EditorTesting.unity.meta b/Scenes/Examples/EditorTesting.unity.meta deleted file mode 100644 index d59062c..0000000 --- a/Scenes/Examples/EditorTesting.unity.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 65e0e9d8ca8a6404d9e4c420d28ff660 -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Scripts/Common/Editor.meta b/Scripts/Common/Editor.meta deleted file mode 100644 index 8cd0f1f..0000000 --- a/Scripts/Common/Editor.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 5aceb78759142c849ad8ab57befcb983 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Scripts/Common/Editor/Networking.meta b/Scripts/Common/Editor/Networking.meta deleted file mode 100644 index 6e3c403..0000000 --- a/Scripts/Common/Editor/Networking.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: ae3fe1f167fbefc4da235a8a105654a8 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Scripts/Common/Editor/Networking/OwnershipTransferEditor.cs b/Scripts/Common/Editor/Networking/OwnershipTransferEditor.cs deleted file mode 100644 index 73af328..0000000 --- a/Scripts/Common/Editor/Networking/OwnershipTransferEditor.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#if !COMPILER_UDONSHARP && UNITY_EDITOR -using Guribo.UdonUtils.Scripts.Common.Networking; -using UnityEditor; - -namespace Guribo.UdonUtils.Scripts.Common.Editor.Networking -{ - [CustomEditor(typeof(OwnershipTransfer))] - public class OwnershipTransferEditor : UdonLibraryEditor - { - protected override string GetSymbolName() - { - return "ownershipTransfer"; - } - } -} -#endif - diff --git a/Scripts/Common/Editor/UdonCommonEditor.cs b/Scripts/Common/Editor/UdonCommonEditor.cs deleted file mode 100644 index 0387ad6..0000000 --- a/Scripts/Common/Editor/UdonCommonEditor.cs +++ /dev/null @@ -1,21 +0,0 @@ - -#if !COMPILER_UDONSHARP && UNITY_EDITOR -using System; -using UdonSharp; -using UdonSharpEditor; -using UnityEditor; -using UnityEngine; -using VRC.Udon; - -namespace Guribo.UdonUtils.Scripts.Common.Editor -{ - [CustomEditor(typeof(UdonCommon))] - public class UdonCommonEditor : UdonLibraryEditor - { - protected override string GetSymbolName() - { - return "udonCommon"; - } - } -} -#endif diff --git a/Scripts/Common/Editor/UdonDebugEditor.cs b/Scripts/Common/Editor/UdonDebugEditor.cs deleted file mode 100644 index 8b182cb..0000000 --- a/Scripts/Common/Editor/UdonDebugEditor.cs +++ /dev/null @@ -1,20 +0,0 @@ -#if !COMPILER_UDONSHARP && UNITY_EDITOR -using System; -using UdonSharp; -using UdonSharpEditor; -using UnityEditor; -using UnityEngine; -using VRC.Udon; - -namespace Guribo.UdonUtils.Scripts.Common.Editor -{ - [CustomEditor(typeof(UdonDebug))] - public class UdonDebugEditor : UdonLibraryEditor - { - protected override string GetSymbolName() - { - return "udonDebug"; - } - } -} -#endif \ No newline at end of file diff --git a/Scripts/Common/Editor/UdonDebugEditor.cs.meta b/Scripts/Common/Editor/UdonDebugEditor.cs.meta deleted file mode 100644 index b153c70..0000000 --- a/Scripts/Common/Editor/UdonDebugEditor.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: a0f4d34446d345b9b7ff8bcbfc2dcc0f -timeCreated: 1621152285 \ No newline at end of file diff --git a/Scripts/Common/Editor/UdonLibraryEditor.cs b/Scripts/Common/Editor/UdonLibraryEditor.cs deleted file mode 100644 index 8769d39..0000000 --- a/Scripts/Common/Editor/UdonLibraryEditor.cs +++ /dev/null @@ -1,49 +0,0 @@ -#if !COMPILER_UDONSHARP && UNITY_EDITOR -using System; -using UdonSharp; -using UdonSharpEditor; -using UnityEditor; -using UnityEngine; -using VRC.Udon; - -namespace Guribo.UdonUtils.Scripts.Common.Editor -{ - public abstract class UdonLibraryEditor : UnityEditor.Editor - { - protected abstract string GetSymbolName(); - - public override void OnInspectorGUI() - { - var symbolName = GetSymbolName(); - Debug.Assert(!string.IsNullOrEmpty(symbolName), "GetSymbolName provided valid string"); - - if (UdonSharpGUI.DrawDefaultUdonSharpBehaviourHeader(target)) return; - EditorGUILayout.Space(); - if (GUILayout.Button(new GUIContent($"Set {symbolName} references in scene", - $"Links all UdonBehaviours with '{symbolName}' parameter to this object"))) - { - var udonBehaviours = FindObjectsOfType(); - var value = UdonSharpEditorUtility.GetBackingUdonBehaviour((UdonSharpBehaviour) target); - - foreach (var udonBehaviour in udonBehaviours) - { - try - { - udonBehaviour.SetInspectorVariable(symbolName, value); - var udonBehaviourGameObject = udonBehaviour.gameObject; - Debug.Log($"Set {symbolName} reference on {udonBehaviourGameObject}.{udonBehaviour.name}", - udonBehaviourGameObject); - } - catch (Exception) - { - // ignored, fails for behaviours that don't have a symbol with that name - } - } - } - - EditorGUILayout.Space(); - base.OnInspectorGUI(); - } - } -} -#endif \ No newline at end of file diff --git a/Scripts/Common/Editor/UdonLibraryEditor.cs.meta b/Scripts/Common/Editor/UdonLibraryEditor.cs.meta deleted file mode 100644 index 8f1918c..0000000 --- a/Scripts/Common/Editor/UdonLibraryEditor.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: f8549596815a40b2b94d1ac975d217b1 -timeCreated: 1621151760 \ No newline at end of file diff --git a/Scripts/Common/Editor/UdonMathEditor.cs b/Scripts/Common/Editor/UdonMathEditor.cs deleted file mode 100644 index ec9a229..0000000 --- a/Scripts/Common/Editor/UdonMathEditor.cs +++ /dev/null @@ -1,21 +0,0 @@ - -#if !COMPILER_UDONSHARP && UNITY_EDITOR -using System; -using UdonSharp; -using UdonSharpEditor; -using UnityEditor; -using UnityEngine; -using VRC.Udon; - -namespace Guribo.UdonUtils.Scripts.Common.Editor -{ - [CustomEditor(typeof(UdonMath))] - public class UdonMathEditor : UdonLibraryEditor - { - protected override string GetSymbolName() - { - return "udonMath"; - } - } -} -#endif diff --git a/Scripts/Common/HorizontalLookAt.asset b/Scripts/Common/HorizontalLookAt.asset deleted file mode 100644 index 589595b..0000000 --- a/Scripts/Common/HorizontalLookAt.asset +++ /dev/null @@ -1,200 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!114 &11400000 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3} - m_Name: HorizontalLookAt - m_EditorClassIdentifier: - serializedUdonProgramAsset: {fileID: 11400000, guid: b126f87a17287974a8e0af0ada790138, - type: 2} - udonAssembly: - assemblyError: - sourceCsScript: {fileID: 11500000, guid: 9e7f888abcc6fe842a80cb1fa38f96a3, type: 3} - behaviourSyncMode: 0 - behaviourIDHeapVarName: __refl_const_intnl_udonTypeID - compileErrors: [] - hasInteractEvent: 0 - serializationData: - SerializedFormat: 2 - SerializedBytes: - ReferencedUnityObjects: [] - SerializedBytesString: - Prefab: {fileID: 0} - PrefabModificationsReferencedUnityObjects: [] - PrefabModifications: [] - SerializationNodes: - - Name: fieldDefinitions - Entry: 7 - Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition, - UdonSharp.Editor]], mscorlib - - Name: comparer - Entry: 7 - Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String, - mscorlib]], mscorlib - - Name: - Entry: 8 - Data: - - Name: - Entry: 12 - Data: 2 - - Name: - Entry: 7 - Data: - - Name: $k - Entry: 1 - Data: weight - - Name: $v - Entry: 7 - Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: fieldSymbol - Entry: 7 - Data: 3|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - - Name: internalType - Entry: 7 - Data: 4|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: System.Single, mscorlib - - Name: - Entry: 8 - Data: - - Name: declarationType - Entry: 3 - Data: 1 - - Name: syncMode - Entry: 3 - Data: 0 - - Name: symbolResolvedTypeName - Entry: 1 - Data: SystemSingle - - Name: symbolOriginalName - Entry: 1 - Data: weight - - Name: symbolUniqueName - Entry: 1 - Data: weight - - Name: symbolDefaultValue - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: fieldAttributes - Entry: 7 - Data: 5|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - - Name: - Entry: 12 - Data: 2 - - Name: - Entry: 7 - Data: 6|UnityEngine.TooltipAttribute, UnityEngine.CoreModule - - Name: tooltip - Entry: 1 - Data: e.g. 0.5 makes it blend 50% between initial rotation and target rotation, - 1.0 makes it look directly at the player - - Name: - Entry: 8 - Data: - - Name: - Entry: 7 - Data: 7|UnityEngine.RangeAttribute, UnityEngine.CoreModule - - Name: min - Entry: 4 - Data: 0 - - Name: max - Entry: 4 - Data: 1 - - Name: - Entry: 8 - Data: - - Name: - Entry: 13 - Data: - - Name: - Entry: 8 - Data: - - Name: userBehaviourSource - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 7 - Data: - - Name: $k - Entry: 1 - Data: _initialRotation - - Name: $v - Entry: 7 - Data: 8|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: fieldSymbol - Entry: 7 - Data: 9|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - - Name: internalType - Entry: 7 - Data: 10|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: UnityEngine.Quaternion, UnityEngine.CoreModule - - Name: - Entry: 8 - Data: - - Name: declarationType - Entry: 3 - Data: 2 - - Name: syncMode - Entry: 3 - Data: 0 - - Name: symbolResolvedTypeName - Entry: 1 - Data: UnityEngineQuaternion - - Name: symbolOriginalName - Entry: 1 - Data: _initialRotation - - Name: symbolUniqueName - Entry: 1 - Data: _initialRotation - - Name: symbolDefaultValue - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: fieldAttributes - Entry: 7 - Data: 11|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - - Name: - Entry: 12 - Data: 0 - - Name: - Entry: 13 - Data: - - Name: - Entry: 8 - Data: - - Name: userBehaviourSource - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 13 - Data: - - Name: - Entry: 8 - Data: diff --git a/Scripts/Common/HorizontalLookAt.cs b/Scripts/Common/HorizontalLookAt.cs deleted file mode 100644 index 9ee8266..0000000 --- a/Scripts/Common/HorizontalLookAt.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System; -using UdonSharp; -using UnityEngine; -using VRC.SDKBase; - -namespace Guribo.UdonUtils.Scripts.Common -{ - /// - /// turns this gameobject around to always look at the local player, only rotates vertical rotation - /// (pitch/roll are forced to 0) - /// - public class HorizontalLookAt : UdonSharpBehaviour - { - [Tooltip("e.g. 0.5 makes it blend 50% between initial rotation and target rotation, 1.0 makes it look directly at the player")] - [Range(0,1)] - public float weight = 1f; - - private Quaternion _initialRotation; - public void Start() - { - _initialRotation = transform.rotation; - } - - public void Update() - { - var localPlayer = VRC.SDKBase.Networking.LocalPlayer; - if (!Utilities.IsValid(localPlayer)) - { - return; - } - - var vectorToTarget = localPlayer.GetPosition() - transform.position; - var targetRotation = Quaternion.LookRotation(vectorToTarget, Vector3.up); - - // blend from initial rotation to target rotation based on strength - var yaw = Quaternion.Slerp(_initialRotation, targetRotation, weight).eulerAngles.y; - - // only apply yaw rotation part to this transform - transform.rotation = Quaternion.Euler(0, yaw, 0); - } - } -} \ No newline at end of file diff --git a/Scripts/Common/Networking.meta b/Scripts/Common/Networking.meta deleted file mode 100644 index 7cf78c7..0000000 --- a/Scripts/Common/Networking.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: f69151a63af18784d943683def0344fb -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Scripts/Common/Networking/OwnerOnly.asset b/Scripts/Common/Networking/OwnerOnly.asset deleted file mode 100644 index 49e0898..0000000 --- a/Scripts/Common/Networking/OwnerOnly.asset +++ /dev/null @@ -1,115 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!114 &11400000 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3} - m_Name: OwnerOnly - m_EditorClassIdentifier: - serializedUdonProgramAsset: {fileID: 11400000, guid: 66417529d6d959743be0869576a9d7c7, - type: 2} - udonAssembly: - assemblyError: - sourceCsScript: {fileID: 11500000, guid: 3524d2a2a27bdf34f905a280042c0a21, type: 3} - behaviourSyncMode: 1 - behaviourIDHeapVarName: __refl_const_intnl_udonTypeID - compileErrors: [] - hasInteractEvent: 0 - serializationData: - SerializedFormat: 2 - SerializedBytes: - ReferencedUnityObjects: [] - SerializedBytesString: - Prefab: {fileID: 0} - PrefabModificationsReferencedUnityObjects: [] - PrefabModifications: [] - SerializationNodes: - - Name: fieldDefinitions - Entry: 7 - Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition, - UdonSharp.Editor]], mscorlib - - Name: comparer - Entry: 7 - Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String, - mscorlib]], mscorlib - - Name: - Entry: 8 - Data: - - Name: - Entry: 12 - Data: 1 - - Name: - Entry: 7 - Data: - - Name: $k - Entry: 1 - Data: gameObjects - - Name: $v - Entry: 7 - Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: fieldSymbol - Entry: 7 - Data: 3|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - - Name: internalType - Entry: 7 - Data: 4|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: UnityEngine.GameObject[], UnityEngine.CoreModule - - Name: - Entry: 8 - Data: - - Name: declarationType - Entry: 3 - Data: 1 - - Name: syncMode - Entry: 3 - Data: 0 - - Name: symbolResolvedTypeName - Entry: 1 - Data: UnityEngineGameObjectArray - - Name: symbolOriginalName - Entry: 1 - Data: gameObjects - - Name: symbolUniqueName - Entry: 1 - Data: gameObjects - - Name: symbolDefaultValue - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: fieldAttributes - Entry: 7 - Data: 5|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - - Name: - Entry: 12 - Data: 0 - - Name: - Entry: 13 - Data: - - Name: - Entry: 8 - Data: - - Name: userBehaviourSource - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 13 - Data: - - Name: - Entry: 8 - Data: diff --git a/Scripts/Common/Networking/OwnerOnly.cs b/Scripts/Common/Networking/OwnerOnly.cs deleted file mode 100644 index 3706499..0000000 --- a/Scripts/Common/Networking/OwnerOnly.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System; -using UdonSharp; -using UnityEngine; -using VRC.SDKBase; - -namespace Guribo.UdonUtils.Scripts.Common.Networking -{ - [UdonBehaviourSyncMode(BehaviourSyncMode.NoVariableSync)] - public class OwnerOnly : UdonSharpBehaviour - { - public GameObject[] gameObjects; - - public void OnEnable() - { - ToggleEnabled(VRC.SDKBase.Networking.IsOwner(gameObject)); - } - - public override void OnOwnershipTransferred(VRCPlayerApi player) - { - ToggleEnabled(VRC.SDKBase.Networking.IsOwner(gameObject)); - } - - private void ToggleEnabled(bool enable) - { - if (gameObjects == null) - { - return; - } - - foreach (var go in gameObjects) - { - if (!Utilities.IsValid(go)) - { - continue; - } - - if (go.activeSelf == enable) - { - continue; - } - - go.SetActive(enable); - } - } - } -} \ No newline at end of file diff --git a/Scripts/Common/Networking/OwnerOnly.cs.meta b/Scripts/Common/Networking/OwnerOnly.cs.meta deleted file mode 100644 index 56cdbc2..0000000 --- a/Scripts/Common/Networking/OwnerOnly.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 3524d2a2a27bdf34f905a280042c0a21 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Scripts/Common/Networking/OwnershipTransfer.asset b/Scripts/Common/Networking/OwnershipTransfer.asset deleted file mode 100644 index 673d163..0000000 --- a/Scripts/Common/Networking/OwnershipTransfer.asset +++ /dev/null @@ -1,189 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!114 &11400000 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3} - m_Name: OwnershipTransfer - m_EditorClassIdentifier: - serializedUdonProgramAsset: {fileID: 11400000, guid: c965fd3bcc7dce44eaf328e87588983f, - type: 2} - udonAssembly: - assemblyError: - sourceCsScript: {fileID: 11500000, guid: fd5fbfc5cfc648088b9f4d0a579f38e9, type: 3} - behaviourSyncMode: 1 - behaviourIDHeapVarName: __refl_const_intnl_udonTypeID - compileErrors: [] - hasInteractEvent: 0 - serializationData: - SerializedFormat: 2 - SerializedBytes: - ReferencedUnityObjects: - - {fileID: 11500000, guid: 7577a31295cedd245927a61243113f27, type: 3} - - {fileID: 11500000, guid: 7fa968b472ba21e43aa479f0eb416d85, type: 3} - SerializedBytesString: - Prefab: {fileID: 0} - PrefabModificationsReferencedUnityObjects: [] - PrefabModifications: [] - SerializationNodes: - - Name: fieldDefinitions - Entry: 7 - Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition, - UdonSharp.Editor]], mscorlib - - Name: comparer - Entry: 7 - Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String, - mscorlib]], mscorlib - - Name: - Entry: 8 - Data: - - Name: - Entry: 12 - Data: 2 - - Name: - Entry: 7 - Data: - - Name: $k - Entry: 1 - Data: udonCommon - - Name: $v - Entry: 7 - Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: fieldSymbol - Entry: 7 - Data: 3|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - - Name: internalType - Entry: 7 - Data: 4|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: Guribo.UdonUtils.Scripts.Common.UdonCommon, Assembly-CSharp - - Name: - Entry: 8 - Data: - - Name: declarationType - Entry: 3 - Data: 1 - - Name: syncMode - Entry: 3 - Data: 0 - - Name: symbolResolvedTypeName - Entry: 1 - Data: VRCUdonUdonBehaviour - - Name: symbolOriginalName - Entry: 1 - Data: udonCommon - - Name: symbolUniqueName - Entry: 1 - Data: udonCommon - - Name: symbolDefaultValue - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: fieldAttributes - Entry: 7 - Data: 5|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - - Name: - Entry: 12 - Data: 1 - - Name: - Entry: 7 - Data: 6|UnityEngine.HeaderAttribute, UnityEngine.CoreModule - - Name: header - Entry: 1 - Data: Libraries - - Name: - Entry: 8 - Data: - - Name: - Entry: 13 - Data: - - Name: - Entry: 8 - Data: - - Name: userBehaviourSource - Entry: 10 - Data: 0 - - Name: - Entry: 8 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 7 - Data: - - Name: $k - Entry: 1 - Data: udonDebug - - Name: $v - Entry: 7 - Data: 7|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: fieldSymbol - Entry: 7 - Data: 8|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - - Name: internalType - Entry: 7 - Data: 9|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: Guribo.UdonUtils.Scripts.Common.UdonDebug, Assembly-CSharp - - Name: - Entry: 8 - Data: - - Name: declarationType - Entry: 3 - Data: 1 - - Name: syncMode - Entry: 3 - Data: 0 - - Name: symbolResolvedTypeName - Entry: 1 - Data: VRCUdonUdonBehaviour - - Name: symbolOriginalName - Entry: 1 - Data: udonDebug - - Name: symbolUniqueName - Entry: 1 - Data: udonDebug - - Name: symbolDefaultValue - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: fieldAttributes - Entry: 7 - Data: 10|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - - Name: - Entry: 12 - Data: 0 - - Name: - Entry: 13 - Data: - - Name: - Entry: 8 - Data: - - Name: userBehaviourSource - Entry: 10 - Data: 1 - - Name: - Entry: 8 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 13 - Data: - - Name: - Entry: 8 - Data: diff --git a/Scripts/Common/Networking/OwnershipTransfer.cs b/Scripts/Common/Networking/OwnershipTransfer.cs deleted file mode 100644 index 4cc883c..0000000 --- a/Scripts/Common/Networking/OwnershipTransfer.cs +++ /dev/null @@ -1,104 +0,0 @@ -using System; -using UdonSharp; -using UnityEngine; -using VRC.SDK3.Components; -using VRC.SDKBase; -using VRC.Udon; - - -namespace Guribo.UdonUtils.Scripts.Common.Networking -{ - [UdonBehaviourSyncMode(BehaviourSyncMode.NoVariableSync)] - public class OwnershipTransfer : UdonSharpBehaviour - { - #region Libraries - - [Header("Libraries")] - public UdonCommon udonCommon; - public UdonDebug udonDebug; - - #endregion - - - /// - /// Changes the ownership of the entire hierarchy of the gameobject provided, including all relevant parents - /// and their children - /// - /// - /// - /// If set to true it is checked that we are the owner after ownership transfer, - /// if transfer was denied then false is returned. - /// If set to false the result of the ownership transfer is ignored and true is returned - /// True on success or false of transfer failed or is incomplete - public bool TransferOwnership(GameObject go, VRCPlayerApi newOwner, bool requireTransferSuccess) - { - if(!(udonDebug.Assert(Utilities.IsValid(go),"OwnershipTransfer.SetOwner: GameObject invalid", this) - && udonDebug.Assert(Utilities.IsValid(newOwner),"OwnershipTransfer.SetOwner: new owner invalid", this))) - { - return false; - } - - // find the top most udon behaviour - var topBehaviour = udonCommon.FindTopComponent(typeof(UdonBehaviour), go.transform); - if (!Utilities.IsValid(topBehaviour)) - { - Debug.LogError($"OwnershipTransfer.SetOwner: GameObject {go.name} " + - $"has no parent udon behaviour which could change ownership"); - return false; - } - - var allTransforms = topBehaviour.transform.GetComponentsInChildren(true); - - if (allTransforms == null || allTransforms.Length == 0) - { - Debug.LogError($"OwnershipTransfer.SetOwner: GameObject {go.name} " + - $"has no udon behaviours it its hierarchy"); - return false; - } - - var anyFailures = false; - var newOwnerPlayerId = newOwner.playerId; - - foreach (var childTransform in allTransforms) - { - if (!Utilities.IsValid(childTransform)) - { - Debug.LogWarning("OwnershipTransfer.SetOwner: invalid transform found. Skipping."); - continue; - } - - var childGo = childTransform.gameObject; - // make sure to not overload the network by only taking ownership of objects that have synced components - if (Utilities.IsValid(childGo.GetComponent(typeof(UdonBehaviour))) - || Utilities.IsValid(childGo.GetComponent(typeof(VRC.SDKBase.VRCStation))) - || Utilities.IsValid(childGo.GetComponent(typeof(VRC_Pickup))) - || Utilities.IsValid(childGo.GetComponent(typeof(VRCObjectSync)))) - { - var oldOwnerId = -1; - var oldOwner = VRC.SDKBase.Networking.GetOwner(childTransform.gameObject); - if (Utilities.IsValid(oldOwner)) - { - oldOwnerId = oldOwner.playerId; - } - - Debug.Log($"OwnershipTransfer.SetOwner: setting owner of " + - $"'{childTransform.gameObject.name}' " + - $"from player {oldOwnerId} to player {newOwnerPlayerId}"); - - if (!VRC.SDKBase.Networking.IsOwner(childTransform.gameObject)) - { - VRC.SDKBase.Networking.SetOwner(newOwner, childTransform.gameObject); - - // check, if required whether we are the owner now - if (requireTransferSuccess && !VRC.SDKBase.Networking.IsOwner(childTransform.gameObject)) - { - anyFailures = true; - } - } - } - } - - return !requireTransferSuccess || !anyFailures; - } - } -} \ No newline at end of file diff --git a/Scripts/Common/Networking/OwnershipTransfer.cs.meta b/Scripts/Common/Networking/OwnershipTransfer.cs.meta deleted file mode 100644 index c530c4f..0000000 --- a/Scripts/Common/Networking/OwnershipTransfer.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: fd5fbfc5cfc648088b9f4d0a579f38e9 -timeCreated: 1618065054 \ No newline at end of file diff --git a/Scripts/Common/Networking/SyncedInteger.asset b/Scripts/Common/Networking/SyncedInteger.asset deleted file mode 100644 index 4b75ab3..0000000 --- a/Scripts/Common/Networking/SyncedInteger.asset +++ /dev/null @@ -1,606 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!114 &11400000 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3} - m_Name: SyncedInteger - m_EditorClassIdentifier: - serializedUdonProgramAsset: {fileID: 11400000, guid: b3c363390b2ca37449a8d67e56bce2fe, - type: 2} - udonAssembly: - assemblyError: - sourceCsScript: {fileID: 11500000, guid: 64b2c7b826b74c6ead3a2d763843fa6a, type: 3} - behaviourSyncMode: 3 - behaviourIDHeapVarName: __refl_const_intnl_udonTypeID - compileErrors: [] - hasInteractEvent: 0 - serializationData: - SerializedFormat: 2 - SerializedBytes: - ReferencedUnityObjects: [] - SerializedBytesString: - Prefab: {fileID: 0} - PrefabModificationsReferencedUnityObjects: [] - PrefabModifications: [] - SerializationNodes: - - Name: fieldDefinitions - Entry: 7 - Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition, - UdonSharp.Editor]], mscorlib - - Name: comparer - Entry: 7 - Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String, - mscorlib]], mscorlib - - Name: - Entry: 8 - Data: - - Name: - Entry: 12 - Data: 8 - - Name: - Entry: 7 - Data: - - Name: $k - Entry: 1 - Data: syncedValue - - Name: $v - Entry: 7 - Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: fieldSymbol - Entry: 7 - Data: 3|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - - Name: internalType - Entry: 7 - Data: 4|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: System.Int32, mscorlib - - Name: - Entry: 8 - Data: - - Name: declarationType - Entry: 3 - Data: 1 - - Name: syncMode - Entry: 3 - Data: 1 - - Name: symbolResolvedTypeName - Entry: 1 - Data: SystemInt32 - - Name: symbolOriginalName - Entry: 1 - Data: syncedValue - - Name: symbolUniqueName - Entry: 1 - Data: syncedValue - - Name: symbolDefaultValue - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: fieldAttributes - Entry: 7 - Data: 5|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - - Name: - Entry: 12 - Data: 1 - - Name: - Entry: 7 - Data: 6|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime - - Name: - Entry: 8 - Data: - - Name: - Entry: 13 - Data: - - Name: - Entry: 8 - Data: - - Name: userBehaviourSource - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 7 - Data: - - Name: $k - Entry: 1 - Data: _oldValue - - Name: $v - Entry: 7 - Data: 7|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: fieldSymbol - Entry: 7 - Data: 8|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - - Name: internalType - Entry: 9 - Data: 4 - - Name: declarationType - Entry: 3 - Data: 2 - - Name: syncMode - Entry: 3 - Data: 0 - - Name: symbolResolvedTypeName - Entry: 1 - Data: SystemInt32 - - Name: symbolOriginalName - Entry: 1 - Data: _oldValue - - Name: symbolUniqueName - Entry: 1 - Data: _oldValue - - Name: symbolDefaultValue - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: fieldAttributes - Entry: 7 - Data: 9|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - - Name: - Entry: 12 - Data: 0 - - Name: - Entry: 13 - Data: - - Name: - Entry: 8 - Data: - - Name: userBehaviourSource - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 7 - Data: - - Name: $k - Entry: 1 - Data: targetBehaviour - - Name: $v - Entry: 7 - Data: 10|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: fieldSymbol - Entry: 7 - Data: 11|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - - Name: internalType - Entry: 7 - Data: 12|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: VRC.Udon.UdonBehaviour, VRC.Udon - - Name: - Entry: 8 - Data: - - Name: declarationType - Entry: 3 - Data: 1 - - Name: syncMode - Entry: 3 - Data: 0 - - Name: symbolResolvedTypeName - Entry: 1 - Data: VRCUdonUdonBehaviour - - Name: symbolOriginalName - Entry: 1 - Data: targetBehaviour - - Name: symbolUniqueName - Entry: 1 - Data: targetBehaviour - - Name: symbolDefaultValue - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: fieldAttributes - Entry: 7 - Data: 13|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - - Name: - Entry: 12 - Data: 1 - - Name: - Entry: 7 - Data: 14|UnityEngine.SerializeField, UnityEngine.CoreModule - - Name: - Entry: 8 - Data: - - Name: - Entry: 13 - Data: - - Name: - Entry: 8 - Data: - - Name: userBehaviourSource - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 7 - Data: - - Name: $k - Entry: 1 - Data: targetVariable - - Name: $v - Entry: 7 - Data: 15|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: fieldSymbol - Entry: 7 - Data: 16|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - - Name: internalType - Entry: 7 - Data: 17|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: System.String, mscorlib - - Name: - Entry: 8 - Data: - - Name: declarationType - Entry: 3 - Data: 1 - - Name: syncMode - Entry: 3 - Data: 0 - - Name: symbolResolvedTypeName - Entry: 1 - Data: SystemString - - Name: symbolOriginalName - Entry: 1 - Data: targetVariable - - Name: symbolUniqueName - Entry: 1 - Data: targetVariable - - Name: symbolDefaultValue - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: fieldAttributes - Entry: 7 - Data: 18|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - - Name: - Entry: 12 - Data: 1 - - Name: - Entry: 7 - Data: 19|UnityEngine.SerializeField, UnityEngine.CoreModule - - Name: - Entry: 8 - Data: - - Name: - Entry: 13 - Data: - - Name: - Entry: 8 - Data: - - Name: userBehaviourSource - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 7 - Data: - - Name: $k - Entry: 1 - Data: targetChangeEvent - - Name: $v - Entry: 7 - Data: 20|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: fieldSymbol - Entry: 7 - Data: 21|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - - Name: internalType - Entry: 9 - Data: 17 - - Name: declarationType - Entry: 3 - Data: 1 - - Name: syncMode - Entry: 3 - Data: 0 - - Name: symbolResolvedTypeName - Entry: 1 - Data: SystemString - - Name: symbolOriginalName - Entry: 1 - Data: targetChangeEvent - - Name: symbolUniqueName - Entry: 1 - Data: targetChangeEvent - - Name: symbolDefaultValue - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: fieldAttributes - Entry: 7 - Data: 22|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - - Name: - Entry: 12 - Data: 2 - - Name: - Entry: 7 - Data: 23|UnityEngine.TooltipAttribute, UnityEngine.CoreModule - - Name: tooltip - Entry: 1 - Data: Event to fire on all players when the value changes (instantly called - on the owner) - - Name: - Entry: 8 - Data: - - Name: - Entry: 7 - Data: 24|UnityEngine.SerializeField, UnityEngine.CoreModule - - Name: - Entry: 8 - Data: - - Name: - Entry: 13 - Data: - - Name: - Entry: 8 - Data: - - Name: userBehaviourSource - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 7 - Data: - - Name: $k - Entry: 1 - Data: targetPreSerialization - - Name: $v - Entry: 7 - Data: 25|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: fieldSymbol - Entry: 7 - Data: 26|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - - Name: internalType - Entry: 9 - Data: 17 - - Name: declarationType - Entry: 3 - Data: 1 - - Name: syncMode - Entry: 3 - Data: 0 - - Name: symbolResolvedTypeName - Entry: 1 - Data: SystemString - - Name: symbolOriginalName - Entry: 1 - Data: targetPreSerialization - - Name: symbolUniqueName - Entry: 1 - Data: targetPreSerialization - - Name: symbolDefaultValue - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: fieldAttributes - Entry: 7 - Data: 27|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - - Name: - Entry: 12 - Data: 2 - - Name: - Entry: 7 - Data: 28|UnityEngine.TooltipAttribute, UnityEngine.CoreModule - - Name: tooltip - Entry: 1 - Data: Event to fire on the owner when the value is about to be sent - - Name: - Entry: 8 - Data: - - Name: - Entry: 7 - Data: 29|UnityEngine.SerializeField, UnityEngine.CoreModule - - Name: - Entry: 8 - Data: - - Name: - Entry: 13 - Data: - - Name: - Entry: 8 - Data: - - Name: userBehaviourSource - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 7 - Data: - - Name: $k - Entry: 1 - Data: targetDeserializeEvent - - Name: $v - Entry: 7 - Data: 30|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: fieldSymbol - Entry: 7 - Data: 31|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - - Name: internalType - Entry: 9 - Data: 17 - - Name: declarationType - Entry: 3 - Data: 1 - - Name: syncMode - Entry: 3 - Data: 0 - - Name: symbolResolvedTypeName - Entry: 1 - Data: SystemString - - Name: symbolOriginalName - Entry: 1 - Data: targetDeserializeEvent - - Name: symbolUniqueName - Entry: 1 - Data: targetDeserializeEvent - - Name: symbolDefaultValue - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: fieldAttributes - Entry: 7 - Data: 32|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - - Name: - Entry: 12 - Data: 2 - - Name: - Entry: 7 - Data: 33|UnityEngine.TooltipAttribute, UnityEngine.CoreModule - - Name: tooltip - Entry: 1 - Data: Event to fire on non-owning players when a value was received (can be - the same value) - - Name: - Entry: 8 - Data: - - Name: - Entry: 7 - Data: 34|UnityEngine.SerializeField, UnityEngine.CoreModule - - Name: - Entry: 8 - Data: - - Name: - Entry: 13 - Data: - - Name: - Entry: 8 - Data: - - Name: userBehaviourSource - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 7 - Data: - - Name: $k - Entry: 1 - Data: targetSerializedEvent - - Name: $v - Entry: 7 - Data: 35|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: fieldSymbol - Entry: 7 - Data: 36|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - - Name: internalType - Entry: 9 - Data: 17 - - Name: declarationType - Entry: 3 - Data: 1 - - Name: syncMode - Entry: 3 - Data: 0 - - Name: symbolResolvedTypeName - Entry: 1 - Data: SystemString - - Name: symbolOriginalName - Entry: 1 - Data: targetSerializedEvent - - Name: symbolUniqueName - Entry: 1 - Data: targetSerializedEvent - - Name: symbolDefaultValue - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: fieldAttributes - Entry: 7 - Data: 37|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - - Name: - Entry: 12 - Data: 2 - - Name: - Entry: 7 - Data: 38|UnityEngine.TooltipAttribute, UnityEngine.CoreModule - - Name: tooltip - Entry: 1 - Data: Event to fire on the owner when the value was successfully sent - - Name: - Entry: 8 - Data: - - Name: - Entry: 7 - Data: 39|UnityEngine.SerializeField, UnityEngine.CoreModule - - Name: - Entry: 8 - Data: - - Name: - Entry: 13 - Data: - - Name: - Entry: 8 - Data: - - Name: userBehaviourSource - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 13 - Data: - - Name: - Entry: 8 - Data: diff --git a/Scripts/Common/Networking/SyncedInteger.asset.meta b/Scripts/Common/Networking/SyncedInteger.asset.meta deleted file mode 100644 index 34f6aa8..0000000 --- a/Scripts/Common/Networking/SyncedInteger.asset.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: c323dfc89548c2e4cb25c6369b832dff -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 11400000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Scripts/Common/Networking/SyncedInteger.cs b/Scripts/Common/Networking/SyncedInteger.cs deleted file mode 100644 index d5dcd6b..0000000 --- a/Scripts/Common/Networking/SyncedInteger.cs +++ /dev/null @@ -1,140 +0,0 @@ -using System; -using UdonSharp; -using UnityEngine; -using VRC.SDKBase; -using VRC.Udon; -using VRC.Udon.Common; - -namespace Guribo.UdonUtils.Scripts.Common.Networking -{ - /// - /// Component which is used to synchronize a value on demand independently from high continuous synced udon - /// behaviours to reduce bandwidth. - /// - [UdonBehaviourSyncMode(BehaviourSyncMode.Manual)] - public class SyncedInteger : UdonSharpBehaviour - { - [UdonSynced] - public int syncedValue = -1; - - private int _oldValue = -1; - - /// - /// Udon behaviour that wants to have one of its variables synced to all players - /// - [SerializeField] protected UdonBehaviour targetBehaviour; - /// - /// Variable which will get synchronized with all players - /// - [SerializeField] protected string targetVariable = "mySyncedInteger"; - [Tooltip("Event to fire on all players when the value changes (instantly called on the owner)")] - [SerializeField] protected string targetChangeEvent; - [Tooltip("Event to fire on the owner when the value is about to be sent")] - [SerializeField] protected string targetPreSerialization; - [Tooltip("Event to fire on non-owning players when a value was received (can be the same value)")] - [SerializeField] protected string targetDeserializeEvent; - [Tooltip("Event to fire on the owner when the value was successfully sent")] - [SerializeField] protected string targetSerializedEvent; - - /// - /// Triggers Serialization of the manually synced player id. - /// Does nothing if the caller does not own this behaviour/gameobject. - /// - /// false if the local player is not the owner or anything goes wrong - public bool UpdateForAll() - { - var localPlayer = VRC.SDKBase.Networking.LocalPlayer; - if (!Utilities.IsValid(targetBehaviour) - || !Utilities.IsValid(localPlayer) - || !localPlayer.IsOwner(gameObject)) - { - return false; - } - - if (!string.IsNullOrEmpty(targetPreSerialization)) - { - targetBehaviour.SendCustomEvent(targetPreSerialization); - } - - var value = targetBehaviour.GetProgramVariable(targetVariable); - if (value == null) - { - Debug.LogError( - $"SyncedInteger.UpdateForAll: '{targetVariable}' does not exist in '{targetBehaviour.name}'", this); - return false; - } - - // ReSharper disable once OperatorIsCanBeUsed - if (value.GetType() == typeof(int)) - { - syncedValue = (int) value; - UpdateOldValueAndTriggerChangeEvent(); - RequestSerialization(); - - return true; - } - - Debug.LogError( - $"SyncedInteger.UpdateForAll: '{targetVariable}' in '{targetBehaviour.name}' is not an integer", this); - return false; - } - - private void UpdateOldValueAndTriggerChangeEvent() - { - if (_oldValue != syncedValue) - { - _oldValue = syncedValue; - if (!string.IsNullOrEmpty(targetChangeEvent)) - { - targetBehaviour.SendCustomEvent(targetChangeEvent); - } - } - } - - public override void OnDeserialization() - { - var localPlayer = VRC.SDKBase.Networking.LocalPlayer; - if (localPlayer.IsOwner(gameObject) - || !Utilities.IsValid(targetBehaviour) - || !Utilities.IsValid(localPlayer)) - { - return; - } - - // refresh the variable in the target udon behaviour - targetBehaviour.SetProgramVariable(targetVariable, syncedValue); - if (!string.IsNullOrEmpty(targetDeserializeEvent)) - { - targetBehaviour.SendCustomEvent(targetDeserializeEvent); - } - - UpdateOldValueAndTriggerChangeEvent(); - } - - public override void OnPostSerialization(SerializationResult result) - { - var localPlayer = VRC.SDKBase.Networking.LocalPlayer; - if (!(localPlayer.IsOwner(gameObject) - && Utilities.IsValid(targetBehaviour) - && Utilities.IsValid(localPlayer))) - { - Debug.LogWarning($"SyncedInteger.OnPostSerialization: aborting", this); - return; - } - - if (!result.success) - { - Debug.LogWarning($"SyncedInteger.OnPostSerialization: Serialization failed, trying again", this); - RequestSerialization(); - return; - } - - Debug.Log($"SyncedInteger.OnPostSerialization: Serialized {result.byteCount} bytes"); - - if (!string.IsNullOrEmpty(targetSerializedEvent)) - { - targetBehaviour.SendCustomEvent(targetSerializedEvent); - } - } - } -} \ No newline at end of file diff --git a/Scripts/Common/Networking/SyncedInteger.cs.meta b/Scripts/Common/Networking/SyncedInteger.cs.meta deleted file mode 100644 index a048846..0000000 --- a/Scripts/Common/Networking/SyncedInteger.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 64b2c7b826b74c6ead3a2d763843fa6a -timeCreated: 1617726399 \ No newline at end of file diff --git a/Scripts/Common/ReflectionProbeController.asset b/Scripts/Common/ReflectionProbeController.asset deleted file mode 100644 index 97fa96b..0000000 --- a/Scripts/Common/ReflectionProbeController.asset +++ /dev/null @@ -1,263 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!114 &11400000 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3} - m_Name: ReflectionProbeController - m_EditorClassIdentifier: - serializedUdonProgramAsset: {fileID: 11400000, guid: e2a1b920e1010b74f9a197681ec87985, - type: 2} - udonAssembly: - assemblyError: - sourceCsScript: {fileID: 11500000, guid: fe152f1571633cd499a864b691a7c791, type: 3} - behaviourSyncMode: 1 - behaviourIDHeapVarName: __refl_const_intnl_udonTypeID - compileErrors: [] - hasInteractEvent: 0 - serializationData: - SerializedFormat: 2 - SerializedBytes: - ReferencedUnityObjects: - - {fileID: 11500000, guid: 7fa968b472ba21e43aa479f0eb416d85, type: 3} - SerializedBytesString: - Prefab: {fileID: 0} - PrefabModificationsReferencedUnityObjects: [] - PrefabModifications: [] - SerializationNodes: - - Name: fieldDefinitions - Entry: 7 - Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition, - UdonSharp.Editor]], mscorlib - - Name: comparer - Entry: 7 - Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String, - mscorlib]], mscorlib - - Name: - Entry: 8 - Data: - - Name: - Entry: 12 - Data: 3 - - Name: - Entry: 7 - Data: - - Name: $k - Entry: 1 - Data: udonDebug - - Name: $v - Entry: 7 - Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: fieldSymbol - Entry: 7 - Data: 3|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - - Name: internalType - Entry: 7 - Data: 4|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: Guribo.UdonUtils.Scripts.Common.UdonDebug, Assembly-CSharp - - Name: - Entry: 8 - Data: - - Name: declarationType - Entry: 3 - Data: 1 - - Name: syncMode - Entry: 3 - Data: 0 - - Name: symbolResolvedTypeName - Entry: 1 - Data: VRCUdonUdonBehaviour - - Name: symbolOriginalName - Entry: 1 - Data: udonDebug - - Name: symbolUniqueName - Entry: 1 - Data: udonDebug - - Name: symbolDefaultValue - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: fieldAttributes - Entry: 7 - Data: 5|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - - Name: - Entry: 12 - Data: 1 - - Name: - Entry: 7 - Data: 6|UnityEngine.HeaderAttribute, UnityEngine.CoreModule - - Name: header - Entry: 1 - Data: Libraries - - Name: - Entry: 8 - Data: - - Name: - Entry: 13 - Data: - - Name: - Entry: 8 - Data: - - Name: userBehaviourSource - Entry: 10 - Data: 0 - - Name: - Entry: 8 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 7 - Data: - - Name: $k - Entry: 1 - Data: reflectionProbe - - Name: $v - Entry: 7 - Data: 7|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: fieldSymbol - Entry: 7 - Data: 8|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - - Name: internalType - Entry: 7 - Data: 9|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: UnityEngine.ReflectionProbe, UnityEngine.CoreModule - - Name: - Entry: 8 - Data: - - Name: declarationType - Entry: 3 - Data: 1 - - Name: syncMode - Entry: 3 - Data: 0 - - Name: symbolResolvedTypeName - Entry: 1 - Data: UnityEngineReflectionProbe - - Name: symbolOriginalName - Entry: 1 - Data: reflectionProbe - - Name: symbolUniqueName - Entry: 1 - Data: reflectionProbe - - Name: symbolDefaultValue - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: fieldAttributes - Entry: 7 - Data: 10|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - - Name: - Entry: 12 - Data: 0 - - Name: - Entry: 13 - Data: - - Name: - Entry: 8 - Data: - - Name: userBehaviourSource - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 7 - Data: - - Name: $k - Entry: 1 - Data: updateInterval - - Name: $v - Entry: 7 - Data: 11|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: fieldSymbol - Entry: 7 - Data: 12|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - - Name: internalType - Entry: 7 - Data: 13|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: System.Single, mscorlib - - Name: - Entry: 8 - Data: - - Name: declarationType - Entry: 3 - Data: 1 - - Name: syncMode - Entry: 3 - Data: 0 - - Name: symbolResolvedTypeName - Entry: 1 - Data: SystemSingle - - Name: symbolOriginalName - Entry: 1 - Data: updateInterval - - Name: symbolUniqueName - Entry: 1 - Data: updateInterval - - Name: symbolDefaultValue - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: fieldAttributes - Entry: 7 - Data: 14|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - - Name: - Entry: 12 - Data: 1 - - Name: - Entry: 7 - Data: 15|UnityEngine.RangeAttribute, UnityEngine.CoreModule - - Name: min - Entry: 4 - Data: 0 - - Name: max - Entry: 4 - Data: 60 - - Name: - Entry: 8 - Data: - - Name: - Entry: 13 - Data: - - Name: - Entry: 8 - Data: - - Name: userBehaviourSource - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 13 - Data: - - Name: - Entry: 8 - Data: diff --git a/Scripts/Common/ReflectionProbeController.asset.meta b/Scripts/Common/ReflectionProbeController.asset.meta deleted file mode 100644 index 9bf6e0c..0000000 --- a/Scripts/Common/ReflectionProbeController.asset.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 8055898f61972ba49aaef80c72d2fba3 -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 11400000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Scripts/Common/ReflectionProbeController.cs b/Scripts/Common/ReflectionProbeController.cs deleted file mode 100644 index 749c3eb..0000000 --- a/Scripts/Common/ReflectionProbeController.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System; -using Guribo.UdonUtils.Scripts.Common; -using UdonSharp; -using UnityEngine; -using VRC.SDKBase; -using VRC.Udon.Common.Enums; - -namespace Guribo.UdonUtils.Scripts.Common -{ - [UdonBehaviourSyncMode(BehaviourSyncMode.NoVariableSync)] - public class ReflectionProbeController : UdonSharpBehaviour - { - #region Libraries - - [Header("Libraries")] - public UdonDebug udonDebug; - - #endregion - - public ReflectionProbe reflectionProbe; - - [Range(0, 60)] - public float updateInterval = 10f; - - public void OnEnable() - { - if (!udonDebug.Assert(Utilities.IsValid(reflectionProbe), "reflectionProbe invalid", this)) - { - return; - } - - UpdateReflections(); - } - - public void UpdateReflections() - { - if (!(gameObject.activeInHierarchy - && enabled - && udonDebug.Assert(Utilities.IsValid(reflectionProbe), "reflectionProbe invalid", this))) - { - return; - } - - reflectionProbe.RenderProbe(); - - SendCustomEventDelayedSeconds(nameof(UpdateReflections), updateInterval); - } - } -} \ No newline at end of file diff --git a/Scripts/Common/ReflectionProbeController.cs.meta b/Scripts/Common/ReflectionProbeController.cs.meta deleted file mode 100644 index 0a54839..0000000 --- a/Scripts/Common/ReflectionProbeController.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: fe152f1571633cd499a864b691a7c791 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Scripts/Common/UdonCommon.asset b/Scripts/Common/UdonCommon.asset deleted file mode 100644 index 186a71e..0000000 --- a/Scripts/Common/UdonCommon.asset +++ /dev/null @@ -1,52 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!114 &11400000 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3} - m_Name: UdonCommon - m_EditorClassIdentifier: - serializedUdonProgramAsset: {fileID: 11400000, guid: 376aa8c882e940b498a22f9c3dc109e3, - type: 2} - udonAssembly: - assemblyError: - sourceCsScript: {fileID: 11500000, guid: 7577a31295cedd245927a61243113f27, type: 3} - behaviourSyncMode: 1 - behaviourIDHeapVarName: __refl_const_intnl_udonTypeID - compileErrors: [] - hasInteractEvent: 0 - serializationData: - SerializedFormat: 2 - SerializedBytes: - ReferencedUnityObjects: [] - SerializedBytesString: - Prefab: {fileID: 0} - PrefabModificationsReferencedUnityObjects: [] - PrefabModifications: [] - SerializationNodes: - - Name: fieldDefinitions - Entry: 7 - Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition, - UdonSharp.Editor]], mscorlib - - Name: comparer - Entry: 7 - Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String, - mscorlib]], mscorlib - - Name: - Entry: 8 - Data: - - Name: - Entry: 12 - Data: 0 - - Name: - Entry: 13 - Data: - - Name: - Entry: 8 - Data: diff --git a/Scripts/Common/UdonCommon.asset.meta b/Scripts/Common/UdonCommon.asset.meta deleted file mode 100644 index 9f1f173..0000000 --- a/Scripts/Common/UdonCommon.asset.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: f1a80167fd5f061499c834bb971daf3b -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 0 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Scripts/Common/UdonCommon.cs b/Scripts/Common/UdonCommon.cs deleted file mode 100644 index d496a1d..0000000 --- a/Scripts/Common/UdonCommon.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System; -using UdonSharp; -using UnityEngine; -using VRC.SDKBase; -using VRC.Udon; - -namespace Guribo.UdonUtils.Scripts.Common -{ - [UdonBehaviourSyncMode(BehaviourSyncMode.NoVariableSync)] - public class UdonCommon : UdonSharpBehaviour - { - /// - /// Finds the component of a given type in the current gameobject hierarchy which is closest to the scene root - /// - /// - /// - /// the found component or null if none was found - public Component FindTopComponent(Type type, Transform start) - { - if (!Utilities.IsValid(start)) - { - return null; - } - - Component topComponent = null; - var topTransform = start; - - do - { - var behaviour = topTransform.GetComponent(type); - if (Utilities.IsValid(behaviour)) - { - topComponent = behaviour; - } - - topTransform = topTransform.parent; - } while (Utilities.IsValid(topTransform)); - - return topComponent; - } - } -} diff --git a/Scripts/Common/UdonDebug.asset b/Scripts/Common/UdonDebug.asset deleted file mode 100644 index 5d2fd7f..0000000 --- a/Scripts/Common/UdonDebug.asset +++ /dev/null @@ -1,52 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!114 &11400000 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3} - m_Name: UdonDebug - m_EditorClassIdentifier: - serializedUdonProgramAsset: {fileID: 11400000, guid: 38b8d3d02ad23bd468e0c49452e108cb, - type: 2} - udonAssembly: - assemblyError: - sourceCsScript: {fileID: 11500000, guid: 7fa968b472ba21e43aa479f0eb416d85, type: 3} - behaviourSyncMode: 1 - behaviourIDHeapVarName: __refl_const_intnl_udonTypeID - compileErrors: [] - hasInteractEvent: 0 - serializationData: - SerializedFormat: 2 - SerializedBytes: - ReferencedUnityObjects: [] - SerializedBytesString: - Prefab: {fileID: 0} - PrefabModificationsReferencedUnityObjects: [] - PrefabModifications: [] - SerializationNodes: - - Name: fieldDefinitions - Entry: 7 - Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition, - UdonSharp.Editor]], mscorlib - - Name: comparer - Entry: 7 - Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String, - mscorlib]], mscorlib - - Name: - Entry: 8 - Data: - - Name: - Entry: 12 - Data: 0 - - Name: - Entry: 13 - Data: - - Name: - Entry: 8 - Data: diff --git a/Scripts/Common/UdonDebug.asset.meta b/Scripts/Common/UdonDebug.asset.meta deleted file mode 100644 index c135d42..0000000 --- a/Scripts/Common/UdonDebug.asset.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: ccfba9ab8ff45f64c9539764aa13ec95 -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 11400000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Scripts/Common/UdonDebug.cs b/Scripts/Common/UdonDebug.cs deleted file mode 100644 index 13ca428..0000000 --- a/Scripts/Common/UdonDebug.cs +++ /dev/null @@ -1,32 +0,0 @@ -using UdonSharp; -using UnityEngine; -using VRC.SDKBase; -using VRC.Udon; - - -namespace Guribo.UdonUtils.Scripts.Common -{ - [UdonBehaviourSyncMode(BehaviourSyncMode.NoVariableSync)] - public class UdonDebug : UdonSharpBehaviour - { - public bool Assert(bool condition, string message, Object context) - { - if (!condition) - { - if (Utilities.IsValid(context)) - { - Debug.LogError("Assertion failed : '" + context.GetType() + " : " + message + "'", context); - } - else - { - Debug.LogError("Assertion failed : 'UNKNOWN TYPE: " + message + "'"); - } - - return false; - } - - Debug.Assert(condition, message); - return true; - } - } -} diff --git a/Scripts/Common/UdonDebug.cs.meta b/Scripts/Common/UdonDebug.cs.meta deleted file mode 100644 index df2806b..0000000 --- a/Scripts/Common/UdonDebug.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 7fa968b472ba21e43aa479f0eb416d85 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Scripts/Common/UdonMath.asset b/Scripts/Common/UdonMath.asset deleted file mode 100644 index 9893248..0000000 --- a/Scripts/Common/UdonMath.asset +++ /dev/null @@ -1,52 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!114 &11400000 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3} - m_Name: UdonMath - m_EditorClassIdentifier: - serializedUdonProgramAsset: {fileID: 11400000, guid: 5b10d8de98911b343bc4026f9301f605, - type: 2} - udonAssembly: - assemblyError: - sourceCsScript: {fileID: 11500000, guid: 55f0076821f05564b9a18510eaafb502, type: 3} - behaviourSyncMode: 1 - behaviourIDHeapVarName: __refl_const_intnl_udonTypeID - compileErrors: [] - hasInteractEvent: 0 - serializationData: - SerializedFormat: 2 - SerializedBytes: - ReferencedUnityObjects: [] - SerializedBytesString: - Prefab: {fileID: 0} - PrefabModificationsReferencedUnityObjects: [] - PrefabModifications: [] - SerializationNodes: - - Name: fieldDefinitions - Entry: 7 - Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition, - UdonSharp.Editor]], mscorlib - - Name: comparer - Entry: 7 - Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String, - mscorlib]], mscorlib - - Name: - Entry: 8 - Data: - - Name: - Entry: 12 - Data: 0 - - Name: - Entry: 13 - Data: - - Name: - Entry: 8 - Data: diff --git a/Scripts/Common/UdonMath.asset.meta b/Scripts/Common/UdonMath.asset.meta deleted file mode 100644 index f66bf3e..0000000 --- a/Scripts/Common/UdonMath.asset.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: e7ee04f28c429a6408a600a72eeede95 -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 11400000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Scripts/Common/UdonMath.cs b/Scripts/Common/UdonMath.cs deleted file mode 100644 index aeacef6..0000000 --- a/Scripts/Common/UdonMath.cs +++ /dev/null @@ -1,99 +0,0 @@ -using System; -using UdonSharp; -using UnityEngine; -using VRC.SDKBase; -using VRC.Udon; - - -namespace Guribo.UdonUtils.Scripts.Common -{ - [UdonBehaviourSyncMode(BehaviourSyncMode.NoVariableSync)] - public class UdonMath : UdonSharpBehaviour - { - public float Remap(float inMin, float inMax, float outMin, float outMax, float value) - { - var t = InverseLerp(inMin, inMax, value); - return Lerp(outMin, outMax, t); - } - - /// - /// unclamped - /// - /// - /// - /// - /// - public float InverseLerp(float a, float b, float value) - { - var divisor = b - a; - if (divisor == 0f) - { - return a; - } - - return (value - a) / divisor; - } - - /// - /// unclamped - /// - /// - /// - /// - /// - public float Lerp(float a, float b, float t) - { - return (1f - t) * a + t * b; - } - - /// - /// input should be between -1 to 1 - /// - /// - /// - /// - public float ApplyExpo(float input, float factor) - { - return (1f - factor) * (input * input * input) + (factor * input); - } - - /// - /// - /// - /// x=p, y=i, z=d - /// - /// - /// - /// - /// - /// result, integral, currentError - public Vector3 PidUpdate(Vector3 pid, - float previousIntegral, - float previousError, - float currentValue, - float targetValue, - float deltaTime) - { - var currentError = targetValue - currentValue; - - var proportional = pid.x * currentError; - var integral = previousIntegral + deltaTime * pid.y * currentError; - var derivative = pid.z * (currentError - previousError) / deltaTime; - - var result = proportional + integral + derivative; - - return new Vector3(result, integral, currentError); - } - - /// - /// given two (e.g. world) rotations a and b it will return the rotation c which can transform a into b (e.g. b = a * c) - /// - /// - /// - /// delta rotation which can turn a into b - public Quaternion GetDeltaAToB(Quaternion a, Quaternion b) - { - return Quaternion.Inverse(a) * b; - } - } -} \ No newline at end of file diff --git a/Scripts/Examples/Editor.meta b/Scripts/Examples/Editor.meta deleted file mode 100644 index bcd7f5b..0000000 --- a/Scripts/Examples/Editor.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: baa9b3b7e069441d9795fdae5ddee720 -timeCreated: 1610045037 \ No newline at end of file diff --git a/Scripts/Examples/Editor/InspectorValueChangerEditor.cs b/Scripts/Examples/Editor/InspectorValueChangerEditor.cs deleted file mode 100644 index 529c949..0000000 --- a/Scripts/Examples/Editor/InspectorValueChangerEditor.cs +++ /dev/null @@ -1,37 +0,0 @@ -using UnityEditor; -using UnityEngine; - -namespace Guribo.UdonUtils.Scripts.Examples.Editor -{ - [CustomEditor(typeof(InspectorValueChangerExample))] - public class InspectorValueChangerEditor : UnityEditor.Editor - { - public override void OnInspectorGUI() - { - DrawDefaultInspector(); - var inspectorValueChanger = (InspectorValueChangerExample) target; - try - { - GUILayout.BeginHorizontal(); - if (GUILayout.Button("Set Values")) - { - inspectorValueChanger.TrySetVariables(); - } - - if (GUILayout.Button("Set Null")) - { - inspectorValueChanger.TrySetNull(); - } - - if (GUILayout.Button("Default")) - { - inspectorValueChanger.TrySetDefaultValues(); - } - } - finally - { - GUILayout.EndHorizontal(); - } - } - } -} \ No newline at end of file diff --git a/Scripts/Examples/Editor/InspectorValueChangerEditor.cs.meta b/Scripts/Examples/Editor/InspectorValueChangerEditor.cs.meta deleted file mode 100644 index 36a23b2..0000000 --- a/Scripts/Examples/Editor/InspectorValueChangerEditor.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 8c1791ba73f94550b7458f8bb1fb0553 -timeCreated: 1610044773 \ No newline at end of file diff --git a/Scripts/Examples/EditorTesting.asset b/Scripts/Examples/EditorTesting.asset deleted file mode 100644 index 56d2e95..0000000 --- a/Scripts/Examples/EditorTesting.asset +++ /dev/null @@ -1,368 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!114 &11400000 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3} - m_Name: EditorTesting - m_EditorClassIdentifier: - serializedUdonProgramAsset: {fileID: 11400000, guid: 12b3ab89a2110a54b8004b7c1e2587f7, - type: 2} - udonAssembly: - assemblyError: - sourceCsScript: {fileID: 11500000, guid: e87d0ed9bfd89644ea800390e7337b74, type: 3} - behaviourSyncMode: 0 - behaviourIDHeapVarName: __refl_const_intnl_udonTypeID - compileErrors: [] - hasInteractEvent: 0 - serializationData: - SerializedFormat: 2 - SerializedBytes: - ReferencedUnityObjects: - - {fileID: 11500000, guid: e87d0ed9bfd89644ea800390e7337b74, type: 3} - SerializedBytesString: - Prefab: {fileID: 0} - PrefabModificationsReferencedUnityObjects: [] - PrefabModifications: [] - SerializationNodes: - - Name: fieldDefinitions - Entry: 7 - Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition, - UdonSharp.Editor]], mscorlib - - Name: comparer - Entry: 7 - Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String, - mscorlib]], mscorlib - - Name: - Entry: 8 - Data: - - Name: - Entry: 12 - Data: 5 - - Name: - Entry: 7 - Data: - - Name: $k - Entry: 1 - Data: testInt - - Name: $v - Entry: 7 - Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: fieldSymbol - Entry: 7 - Data: 3|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - - Name: internalType - Entry: 7 - Data: 4|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: System.Int32, mscorlib - - Name: - Entry: 8 - Data: - - Name: declarationType - Entry: 3 - Data: 1 - - Name: syncMode - Entry: 3 - Data: 0 - - Name: symbolResolvedTypeName - Entry: 1 - Data: SystemInt32 - - Name: symbolOriginalName - Entry: 1 - Data: testInt - - Name: symbolUniqueName - Entry: 1 - Data: testInt - - Name: symbolDefaultValue - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: fieldAttributes - Entry: 7 - Data: 5|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - - Name: - Entry: 12 - Data: 0 - - Name: - Entry: 13 - Data: - - Name: - Entry: 8 - Data: - - Name: userBehaviourSource - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 7 - Data: - - Name: $k - Entry: 1 - Data: testString - - Name: $v - Entry: 7 - Data: 6|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: fieldSymbol - Entry: 7 - Data: 7|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - - Name: internalType - Entry: 7 - Data: 8|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: System.String, mscorlib - - Name: - Entry: 8 - Data: - - Name: declarationType - Entry: 3 - Data: 1 - - Name: syncMode - Entry: 3 - Data: 0 - - Name: symbolResolvedTypeName - Entry: 1 - Data: SystemString - - Name: symbolOriginalName - Entry: 1 - Data: testString - - Name: symbolUniqueName - Entry: 1 - Data: testString - - Name: symbolDefaultValue - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: fieldAttributes - Entry: 7 - Data: 9|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - - Name: - Entry: 12 - Data: 0 - - Name: - Entry: 13 - Data: - - Name: - Entry: 8 - Data: - - Name: userBehaviourSource - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 7 - Data: - - Name: $k - Entry: 1 - Data: testTransform - - Name: $v - Entry: 7 - Data: 10|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: fieldSymbol - Entry: 7 - Data: 11|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - - Name: internalType - Entry: 7 - Data: 12|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: UnityEngine.Transform, UnityEngine.CoreModule - - Name: - Entry: 8 - Data: - - Name: declarationType - Entry: 3 - Data: 1 - - Name: syncMode - Entry: 3 - Data: 0 - - Name: symbolResolvedTypeName - Entry: 1 - Data: UnityEngineTransform - - Name: symbolOriginalName - Entry: 1 - Data: testTransform - - Name: symbolUniqueName - Entry: 1 - Data: testTransform - - Name: symbolDefaultValue - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: fieldAttributes - Entry: 7 - Data: 13|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - - Name: - Entry: 12 - Data: 0 - - Name: - Entry: 13 - Data: - - Name: - Entry: 8 - Data: - - Name: userBehaviourSource - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 7 - Data: - - Name: $k - Entry: 1 - Data: testGameObject - - Name: $v - Entry: 7 - Data: 14|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: fieldSymbol - Entry: 7 - Data: 15|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - - Name: internalType - Entry: 7 - Data: 16|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: UnityEngine.GameObject, UnityEngine.CoreModule - - Name: - Entry: 8 - Data: - - Name: declarationType - Entry: 3 - Data: 1 - - Name: syncMode - Entry: 3 - Data: 0 - - Name: symbolResolvedTypeName - Entry: 1 - Data: UnityEngineGameObject - - Name: symbolOriginalName - Entry: 1 - Data: testGameObject - - Name: symbolUniqueName - Entry: 1 - Data: testGameObject - - Name: symbolDefaultValue - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: fieldAttributes - Entry: 7 - Data: 17|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - - Name: - Entry: 12 - Data: 0 - - Name: - Entry: 13 - Data: - - Name: - Entry: 8 - Data: - - Name: userBehaviourSource - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 7 - Data: - - Name: $k - Entry: 1 - Data: testScriptReference - - Name: $v - Entry: 7 - Data: 18|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: fieldSymbol - Entry: 7 - Data: 19|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - - Name: internalType - Entry: 7 - Data: 20|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: Guribo.UdonUtils.Scripts.Examples.EditorTesting, Assembly-CSharp - - Name: - Entry: 8 - Data: - - Name: declarationType - Entry: 3 - Data: 1 - - Name: syncMode - Entry: 3 - Data: 0 - - Name: symbolResolvedTypeName - Entry: 1 - Data: VRCUdonUdonBehaviour - - Name: symbolOriginalName - Entry: 1 - Data: testScriptReference - - Name: symbolUniqueName - Entry: 1 - Data: testScriptReference - - Name: symbolDefaultValue - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: fieldAttributes - Entry: 7 - Data: 21|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - - Name: - Entry: 12 - Data: 0 - - Name: - Entry: 13 - Data: - - Name: - Entry: 8 - Data: - - Name: userBehaviourSource - Entry: 10 - Data: 0 - - Name: - Entry: 8 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 13 - Data: - - Name: - Entry: 8 - Data: diff --git a/Scripts/Examples/EditorTesting.asset.meta b/Scripts/Examples/EditorTesting.asset.meta deleted file mode 100644 index 2b8cce1..0000000 --- a/Scripts/Examples/EditorTesting.asset.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: c29d80bdbf2e26c4d8e2ba2e675781ed -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 11400000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Scripts/Examples/EditorTesting.cs b/Scripts/Examples/EditorTesting.cs deleted file mode 100644 index 955f554..0000000 --- a/Scripts/Examples/EditorTesting.cs +++ /dev/null @@ -1,14 +0,0 @@ -using UdonSharp; -using UnityEngine; - -namespace Guribo.UdonUtils.Scripts.Examples -{ - public class EditorTesting : UdonSharpBehaviour - { - public int testInt; - public string testString; - public Transform testTransform; - public GameObject testGameObject; - public EditorTesting testScriptReference; - } -} diff --git a/Scripts/Examples/EditorTesting.cs.meta b/Scripts/Examples/EditorTesting.cs.meta deleted file mode 100644 index 15ca4a3..0000000 --- a/Scripts/Examples/EditorTesting.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: e87d0ed9bfd89644ea800390e7337b74 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Scripts/Examples/InspectorValueChangerExample.cs b/Scripts/Examples/InspectorValueChangerExample.cs deleted file mode 100644 index 057b2ec..0000000 --- a/Scripts/Examples/InspectorValueChangerExample.cs +++ /dev/null @@ -1,42 +0,0 @@ -#if UNITY_EDITOR -using UnityEngine; -using VRC.Udon; - -namespace Guribo.UdonUtils.Scripts.Examples -{ - public class InspectorValueChangerExample : MonoBehaviour - { - public UdonBehaviour editorTestingBehaviour; - - [ContextMenu("TrySetVariables")] - public void TrySetVariables() - { - editorTestingBehaviour.SetInspectorVariable("testInt", 100); - editorTestingBehaviour.SetInspectorVariable("testString", "Hello World"); - editorTestingBehaviour.SetInspectorVariable("testTransform", gameObject.transform); - editorTestingBehaviour.SetInspectorVariable("testGameObject", gameObject); - editorTestingBehaviour.SetInspectorVariable("testScriptReference", editorTestingBehaviour); - } - - [ContextMenu("TrySetNull")] - public void TrySetNull() - { - editorTestingBehaviour.SetInspectorVariable("testInt", 0); - editorTestingBehaviour.SetInspectorVariable("testString", null); - editorTestingBehaviour.SetInspectorVariable("testTransform", null); - editorTestingBehaviour.SetInspectorVariable("testGameObject", null); - editorTestingBehaviour.SetInspectorVariable("testScriptReference", null); - } - - [ContextMenu("TrySetDefaultVariables")] - public void TrySetDefaultValues() - { - editorTestingBehaviour.ResetInspectorVariable("testInt"); - editorTestingBehaviour.ResetInspectorVariable("testString"); - editorTestingBehaviour.ResetInspectorVariable("testTransform"); - editorTestingBehaviour.ResetInspectorVariable("testGameObject"); - editorTestingBehaviour.ResetInspectorVariable("testScriptReference"); - } - } -} -#endif \ No newline at end of file diff --git a/Scripts/Examples/InspectorValueChangerExample.cs.meta b/Scripts/Examples/InspectorValueChangerExample.cs.meta deleted file mode 100644 index 2585a70..0000000 --- a/Scripts/Examples/InspectorValueChangerExample.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 1e0c616f4e5d4d2780ffa49f2c92b335 -timeCreated: 1610043861 \ No newline at end of file diff --git a/Scripts/GizmoUtils.cs b/Scripts/GizmoUtils.cs deleted file mode 100644 index 2a587db..0000000 --- a/Scripts/GizmoUtils.cs +++ /dev/null @@ -1,49 +0,0 @@ -#if UNITY_EDITOR - -using UnityEngine; - -namespace Guribo.UdonUtils.Scripts -{ - public class GizmoUtils : MonoBehaviour - { - public static void DrawArrow(Vector3 position, Vector3 direction, float length) - { - if (Mathf.Approximately(length, 0f)) - { - return; - } - - var normalizedDirection = direction.normalized; - - var rotation = Quaternion.LookRotation(normalizedDirection); - DrawArrow(position, rotation, length); - } - - public static void DrawArrow(Vector3 position, Quaternion rotation, float length) - { - if (Mathf.Approximately(length, 0f)) - { - return; - } - - var arrowHead = position + (rotation * Vector3.forward) * length; - - // arrow root line - Gizmos.DrawLine(position, arrowHead); - - // arrow head with 4 lines - var back = rotation * Vector3.back; - var up = rotation * Vector3.up; - var right = rotation * Vector3.right; - - var halfLength = length * 0.25f; - - Gizmos.DrawLine(arrowHead, arrowHead + (back + up) * halfLength); - Gizmos.DrawLine(arrowHead, arrowHead + (back - up) * halfLength); - Gizmos.DrawLine(arrowHead, arrowHead + (back + right) * halfLength); - Gizmos.DrawLine(arrowHead, arrowHead + (back - right) * halfLength); - } - } -} - -#endif \ No newline at end of file diff --git a/Scripts/GizmoUtils.cs.meta b/Scripts/GizmoUtils.cs.meta deleted file mode 100644 index 25e7d42..0000000 --- a/Scripts/GizmoUtils.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 36cf11e5dca54cfab13df8fb358b0bcb -timeCreated: 1610845209 \ No newline at end of file diff --git a/Scripts/GuriboUdonUtils.cs b/Scripts/GuriboUdonUtils.cs deleted file mode 100644 index 9e86e33..0000000 --- a/Scripts/GuriboUdonUtils.cs +++ /dev/null @@ -1,121 +0,0 @@ -using System; -using UnityEditor; -using UnityEngine; -using VRC.Udon; - -#if UNITY_EDITOR -#endif - -namespace Guribo.UdonUtils.Scripts -{ - public class GuriboUdonUtils : MonoBehaviour - { - private static bool _interactiveMode = true; -#if UNITY_EDITOR - public class AutoValidator : UnityEditor.AssetModificationProcessor - { - private static string[] OnWillSaveAssets(string[] paths) - { - // disable interactive mode - _interactiveMode = false; - try - { - ValidateUdonBehaviours(); - } - catch (Exception e) - { - Debug.LogException(e); - } - finally - { - _interactiveMode = true; - } - - return paths; - } - } - - /// - /// checks all UdonBehaviours in the scene for unset public variables. Displays a dialog to skip or show the error. - /// - [MenuItem("Guribo/UDON/Validate UdonBehaviour References")] - public static void ValidateUdonBehaviours() - { - var errorCount = 0; - var udonBehaviours = FindObjectsOfType(); - if (udonBehaviours.Length == 0) - { - if (_interactiveMode) - { - EditorUtility.DisplayDialog("Conclusion", "No UdonBehaviours in the scene", "Ok"); - } - - return; - } - - foreach (var udonBehaviour in udonBehaviours) - { - var programSource = udonBehaviour.programSource; - if (programSource == null) - { - Debug.LogWarning("UdonBehaviour on " + udonBehaviour.gameObject.name + - " has no Udon program attached", udonBehaviour); - if (_interactiveMode && EditorUtility.DisplayDialog("Empty UdonBehaviour found", - "The UdonBehaviour on the GameObject '" + - udonBehaviour.gameObject.name + "' has no program attached", "Show me", "Skip")) - { - Selection.SetActiveObjectWithContext(udonBehaviour.gameObject, udonBehaviour); - EditorGUIUtility.PingObject(udonBehaviour.gameObject); - return; - } - - errorCount++; - continue; - } - - var symbolNames = udonBehaviour.GetInspectorVariableNames(); - foreach (var symbolName in symbolNames) - { - if (udonBehaviour.IsInspectorVariableNull(symbolName, out var variableType)) - { - Debug.LogWarning($"{udonBehaviour}.{symbolName} is null [{variableType}]", udonBehaviour); - - if (_interactiveMode && EditorUtility.DisplayDialog("Empty public variable found", - "A public variable called '" + symbolName + - "' is not set on the UdonBehaviour with the program '" + - programSource.name + "'. You may want to fix this.", "Show me", "Skip")) - { - Selection.SetActiveObjectWithContext(udonBehaviour.gameObject, udonBehaviour); - EditorGUIUtility.PingObject(udonBehaviour.gameObject); - return; - } - - errorCount++; - } - } - } - - - var conclusion = errorCount + " potential error" + (errorCount > 1 ? "s" : "") + " found in " + - udonBehaviours.Length + - " UdonBehaviours." + - (errorCount > 0 - ? " You may want to fix " + (errorCount > 1 ? "those" : "that") + "." - : ""); - if (errorCount > 0) - { - Debug.LogWarning(conclusion); - } - else - { - Debug.Log(conclusion); - } - - if (_interactiveMode) - { - EditorUtility.DisplayDialog("Conclusion", conclusion, "Ok"); - } - } -#endif - } -} \ No newline at end of file diff --git a/Scripts/GuriboUdonUtils.cs.meta b/Scripts/GuriboUdonUtils.cs.meta deleted file mode 100644 index 2b2d292..0000000 --- a/Scripts/GuriboUdonUtils.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: ec184f223ef43f34cb1bf4e2e45b3654 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Scripts/PackageExporter.cs b/Scripts/PackageExporter.cs deleted file mode 100644 index 6cd5eab..0000000 --- a/Scripts/PackageExporter.cs +++ /dev/null @@ -1,191 +0,0 @@ -#if UNITY_EDITOR -using System; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Threading; -using UnityEditor; -using UnityEngine; -using UnityEngine.SceneManagement; -using Debug = UnityEngine.Debug; - -namespace Guribo.UdonUtils.Scripts.Editor -{ - public abstract class PackageExporter : MonoBehaviour - { - protected readonly string UnityPackageExtension = "unitypackage"; - - // /// TODO not used (remove?) - // /// exports the unity package after successfully building - // /// - // /// - // /// - // /// - // [PostProcessBuild] - // public static void OnPostprocessBuild(BuildTarget target, string pathToBuiltProject) - // { - // ExportBetterAudioPackage(pathToBuiltProject); - // } - - // TODO override and add e.g. [MenuItem("Menu/Item/Path/Export My Package")] - // TODO call Export() in the override - public static void ExportPackage() - { - Export(); - } - - protected static void Export() where T : PackageExporter - { - var go = new GameObject {hideFlags = HideFlags.DontSave}; - try - { - var packageExporter = (T) go.AddComponent(typeof(T)); - Debug.Assert(packageExporter); - packageExporter.ExportPackage(packageExporter.GetExportPath()); - } - catch (Exception e) - { - Debug.LogException(e); - } - finally - { - DestroyImmediate(go); - } - } - - protected abstract string GetRepositoryPath(); - protected abstract string GetExportPath(); - protected abstract string GetReleaseVersion(); - protected abstract string GetUnityPackage(); - protected abstract string[] GetExportAssets(); - - public string GetCommitHash() - { - var cmd = new Process(); - var processStartInfo = cmd.StartInfo; - processStartInfo.FileName = "cmd.exe"; - processStartInfo.RedirectStandardInput = true; - processStartInfo.RedirectStandardOutput = true; - processStartInfo.CreateNoWindow = true; - processStartInfo.UseShellExecute = false; - cmd.Start(); - var cmdStandardInput = cmd.StandardInput; - cmdStandardInput.Flush(); - var repositoryPath = GetRepositoryPath(); - cmdStandardInput.WriteLine($"cd {repositoryPath} && git rev-parse --short HEAD"); - cmdStandardInput.Flush(); - cmdStandardInput.Close(); - cmd.WaitForExit(); - var cmdStandardOutput = cmd.StandardOutput; - - // ignore the first 4 lines - for (var i = 0; i < 4; ++i) - { - cmdStandardOutput.ReadLine(); - } - - // get the commit hash - var commitHash = cmdStandardOutput.ReadLine(); - - // ignore the rest - cmdStandardOutput.ReadToEnd(); - - // verify we actually succeeded - if (cmd.ExitCode != 0 - || commitHash == null - || string.IsNullOrWhiteSpace(commitHash)) - { - throw new Exception($"Failed to get git hash for repository '{repositoryPath}'"); - } - - var trimmedHash = commitHash.Trim(); - Debug.Log($"Found git hash '{trimmedHash}'"); - - return trimmedHash; - } - - - /// - /// - /// - /// - /// - /// - private void ExportPackage(string pathToBuiltProject) - { - if (pathToBuiltProject == null - || string.IsNullOrEmpty(pathToBuiltProject) - || string.IsNullOrWhiteSpace(pathToBuiltProject)) - { - throw new ArgumentException($"Invalid path {pathToBuiltProject}"); - } - - // absolute path of built project - var directoryInfo = Directory.GetParent(@pathToBuiltProject); - if (directoryInfo == null) - { - throw new ArgumentException($"Invalid directory {pathToBuiltProject}"); - } - - var buildDirectory = directoryInfo.FullName; - - // absolute path of unity project - var workingDirectory = Path.GetFullPath(@Environment.CurrentDirectory); - - Debug.Log($"Exporting BetterPlayerAudio Unity Package to '{buildDirectory}' from '{workingDirectory}'"); - - var repositoryPath = GetRepositoryPath(); - var releaseVersion = GetReleaseVersion(); - var versionFilePath = $"{repositoryPath}/{releaseVersion}"; - var version = File.ReadLines(versionFilePath).First(); - if (string.IsNullOrWhiteSpace(version)) - { - throw new Exception($"Failed to get version from '{versionFilePath}'"); - } - - var packageTargetPath = Path.Combine(buildDirectory, - $"{GetUnityPackage()}_{version.Trim()}_{GetCommitHash()}.{UnityPackageExtension}"); - - Debug.Log($"Exporting to '{packageTargetPath}'"); - - var exportAssets = GetExportAssets(); - foreach (var exportAsset in exportAssets) - { - if (!IsValidFileName(exportAsset)) - { - throw new ArgumentException($"Invalid file path: '{exportAsset}'"); - } - } - - // AssetDatabase.ExportPackage(ExportAssets, packageTargetPath,ExportPackageOptions.Recurse | ExportPackageOptions.Interactive | ExportPackageOptions.IncludeDependencies); - AssetDatabase.ExportPackage(exportAssets, packageTargetPath, - ExportPackageOptions.Recurse | ExportPackageOptions.Interactive); - } - - /// - /// Source: https://stackoverflow.com/questions/422090/in-c-sharp-check-that-filename-is-possibly-valid-not-that-it-exists - /// - /// - /// - public static bool IsValidFileName(string fileName) - { - if (string.IsNullOrEmpty(fileName)) - { - return false; - } - - FileInfo fileInfo = null; - try - { - fileInfo = new FileInfo(fileName); - } - catch (Exception) - { - // ignored - } - - return !ReferenceEquals(fileInfo, null); - } - } -} -#endif \ No newline at end of file diff --git a/Scripts/PackageExporter.cs.meta b/Scripts/PackageExporter.cs.meta deleted file mode 100644 index dac25e1..0000000 --- a/Scripts/PackageExporter.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 7e9d4d1734bc9434d937e56744476596 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Scripts/Testing.meta b/Scripts/Testing.meta deleted file mode 100644 index 30e4e09..0000000 --- a/Scripts/Testing.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: ffedafa20523453f95885c5b88184edb -timeCreated: 1611170049 \ No newline at end of file diff --git a/Scripts/Testing/TestController.asset b/Scripts/Testing/TestController.asset deleted file mode 100644 index f865694..0000000 --- a/Scripts/Testing/TestController.asset +++ /dev/null @@ -1,907 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!114 &11400000 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3} - m_Name: TestController - m_EditorClassIdentifier: - serializedUdonProgramAsset: {fileID: 11400000, guid: dec84794463083b49aefc01b2f624ddd, - type: 2} - udonAssembly: - assemblyError: - sourceCsScript: {fileID: 11500000, guid: 633845384acec5440afe0af63e8253f2, type: 3} - behaviourSyncMode: 1 - behaviourIDHeapVarName: __refl_const_intnl_udonTypeID - compileErrors: [] - hasInteractEvent: 0 - serializationData: - SerializedFormat: 2 - SerializedBytes: - ReferencedUnityObjects: [] - SerializedBytesString: - Prefab: {fileID: 0} - PrefabModificationsReferencedUnityObjects: [] - PrefabModifications: [] - SerializationNodes: - - Name: fieldDefinitions - Entry: 7 - Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition, - UdonSharp.Editor]], mscorlib - - Name: comparer - Entry: 7 - Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String, - mscorlib]], mscorlib - - Name: - Entry: 8 - Data: - - Name: - Entry: 12 - Data: 14 - - Name: - Entry: 7 - Data: - - Name: $k - Entry: 1 - Data: LogPrefix - - Name: $v - Entry: 7 - Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: fieldSymbol - Entry: 7 - Data: 3|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - - Name: internalType - Entry: 7 - Data: 4|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: System.String, mscorlib - - Name: - Entry: 8 - Data: - - Name: declarationType - Entry: 3 - Data: 258 - - Name: syncMode - Entry: 3 - Data: 0 - - Name: symbolResolvedTypeName - Entry: 1 - Data: SystemString - - Name: symbolOriginalName - Entry: 1 - Data: LogPrefix - - Name: symbolUniqueName - Entry: 1 - Data: LogPrefix - - Name: symbolDefaultValue - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: fieldAttributes - Entry: 7 - Data: 5|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - - Name: - Entry: 12 - Data: 0 - - Name: - Entry: 13 - Data: - - Name: - Entry: 8 - Data: - - Name: userBehaviourSource - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 7 - Data: - - Name: $k - Entry: 1 - Data: startKey0 - - Name: $v - Entry: 7 - Data: 6|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: fieldSymbol - Entry: 7 - Data: 7|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - - Name: internalType - Entry: 7 - Data: 8|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: UnityEngine.KeyCode, UnityEngine.CoreModule - - Name: - Entry: 8 - Data: - - Name: declarationType - Entry: 3 - Data: 1 - - Name: syncMode - Entry: 3 - Data: 0 - - Name: symbolResolvedTypeName - Entry: 1 - Data: UnityEngineKeyCode - - Name: symbolOriginalName - Entry: 1 - Data: startKey0 - - Name: symbolUniqueName - Entry: 1 - Data: startKey0 - - Name: symbolDefaultValue - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: fieldAttributes - Entry: 7 - Data: 9|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - - Name: - Entry: 12 - Data: 1 - - Name: - Entry: 7 - Data: 10|UnityEngine.HeaderAttribute, UnityEngine.CoreModule - - Name: header - Entry: 1 - Data: Start Input - - Name: - Entry: 8 - Data: - - Name: - Entry: 13 - Data: - - Name: - Entry: 8 - Data: - - Name: userBehaviourSource - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 7 - Data: - - Name: $k - Entry: 1 - Data: startKey1 - - Name: $v - Entry: 7 - Data: 11|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: fieldSymbol - Entry: 7 - Data: 12|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - - Name: internalType - Entry: 9 - Data: 8 - - Name: declarationType - Entry: 3 - Data: 1 - - Name: syncMode - Entry: 3 - Data: 0 - - Name: symbolResolvedTypeName - Entry: 1 - Data: UnityEngineKeyCode - - Name: symbolOriginalName - Entry: 1 - Data: startKey1 - - Name: symbolUniqueName - Entry: 1 - Data: startKey1 - - Name: symbolDefaultValue - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: fieldAttributes - Entry: 7 - Data: 13|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - - Name: - Entry: 12 - Data: 0 - - Name: - Entry: 13 - Data: - - Name: - Entry: 8 - Data: - - Name: userBehaviourSource - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 7 - Data: - - Name: $k - Entry: 1 - Data: startKey2 - - Name: $v - Entry: 7 - Data: 14|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: fieldSymbol - Entry: 7 - Data: 15|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - - Name: internalType - Entry: 9 - Data: 8 - - Name: declarationType - Entry: 3 - Data: 1 - - Name: syncMode - Entry: 3 - Data: 0 - - Name: symbolResolvedTypeName - Entry: 1 - Data: UnityEngineKeyCode - - Name: symbolOriginalName - Entry: 1 - Data: startKey2 - - Name: symbolUniqueName - Entry: 1 - Data: startKey2 - - Name: symbolDefaultValue - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: fieldAttributes - Entry: 7 - Data: 16|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - - Name: - Entry: 12 - Data: 0 - - Name: - Entry: 13 - Data: - - Name: - Entry: 8 - Data: - - Name: userBehaviourSource - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 7 - Data: - - Name: $k - Entry: 1 - Data: abortKey0 - - Name: $v - Entry: 7 - Data: 17|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: fieldSymbol - Entry: 7 - Data: 18|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - - Name: internalType - Entry: 9 - Data: 8 - - Name: declarationType - Entry: 3 - Data: 1 - - Name: syncMode - Entry: 3 - Data: 0 - - Name: symbolResolvedTypeName - Entry: 1 - Data: UnityEngineKeyCode - - Name: symbolOriginalName - Entry: 1 - Data: abortKey0 - - Name: symbolUniqueName - Entry: 1 - Data: abortKey0 - - Name: symbolDefaultValue - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: fieldAttributes - Entry: 7 - Data: 19|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - - Name: - Entry: 12 - Data: 1 - - Name: - Entry: 7 - Data: 20|UnityEngine.HeaderAttribute, UnityEngine.CoreModule - - Name: header - Entry: 1 - Data: Abort Input - - Name: - Entry: 8 - Data: - - Name: - Entry: 13 - Data: - - Name: - Entry: 8 - Data: - - Name: userBehaviourSource - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 7 - Data: - - Name: $k - Entry: 1 - Data: abortKey1 - - Name: $v - Entry: 7 - Data: 21|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: fieldSymbol - Entry: 7 - Data: 22|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - - Name: internalType - Entry: 9 - Data: 8 - - Name: declarationType - Entry: 3 - Data: 1 - - Name: syncMode - Entry: 3 - Data: 0 - - Name: symbolResolvedTypeName - Entry: 1 - Data: UnityEngineKeyCode - - Name: symbolOriginalName - Entry: 1 - Data: abortKey1 - - Name: symbolUniqueName - Entry: 1 - Data: abortKey1 - - Name: symbolDefaultValue - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: fieldAttributes - Entry: 7 - Data: 23|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - - Name: - Entry: 12 - Data: 0 - - Name: - Entry: 13 - Data: - - Name: - Entry: 8 - Data: - - Name: userBehaviourSource - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 7 - Data: - - Name: $k - Entry: 1 - Data: startOnPlayerJoin - - Name: $v - Entry: 7 - Data: 24|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: fieldSymbol - Entry: 7 - Data: 25|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - - Name: internalType - Entry: 7 - Data: 26|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: System.Boolean, mscorlib - - Name: - Entry: 8 - Data: - - Name: declarationType - Entry: 3 - Data: 1 - - Name: syncMode - Entry: 3 - Data: 0 - - Name: symbolResolvedTypeName - Entry: 1 - Data: SystemBoolean - - Name: symbolOriginalName - Entry: 1 - Data: startOnPlayerJoin - - Name: symbolUniqueName - Entry: 1 - Data: startOnPlayerJoin - - Name: symbolDefaultValue - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: fieldAttributes - Entry: 7 - Data: 27|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - - Name: - Entry: 12 - Data: 1 - - Name: - Entry: 7 - Data: 28|UnityEngine.HeaderAttribute, UnityEngine.CoreModule - - Name: header - Entry: 1 - Data: Tests - - Name: - Entry: 8 - Data: - - Name: - Entry: 13 - Data: - - Name: - Entry: 8 - Data: - - Name: userBehaviourSource - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 7 - Data: - - Name: $k - Entry: 1 - Data: tests - - Name: $v - Entry: 7 - Data: 29|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: fieldSymbol - Entry: 7 - Data: 30|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - - Name: internalType - Entry: 7 - Data: 31|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: UdonSharp.UdonSharpBehaviour[], UdonSharp.Runtime - - Name: - Entry: 8 - Data: - - Name: declarationType - Entry: 3 - Data: 1 - - Name: syncMode - Entry: 3 - Data: 0 - - Name: symbolResolvedTypeName - Entry: 1 - Data: UnityEngineComponentArray - - Name: symbolOriginalName - Entry: 1 - Data: tests - - Name: symbolUniqueName - Entry: 1 - Data: tests - - Name: symbolDefaultValue - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: fieldAttributes - Entry: 7 - Data: 32|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - - Name: - Entry: 12 - Data: 0 - - Name: - Entry: 13 - Data: - - Name: - Entry: 8 - Data: - - Name: userBehaviourSource - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 7 - Data: - - Name: $k - Entry: 1 - Data: _isTesting - - Name: $v - Entry: 7 - Data: 33|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: fieldSymbol - Entry: 7 - Data: 34|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - - Name: internalType - Entry: 9 - Data: 26 - - Name: declarationType - Entry: 3 - Data: 2 - - Name: syncMode - Entry: 3 - Data: 0 - - Name: symbolResolvedTypeName - Entry: 1 - Data: SystemBoolean - - Name: symbolOriginalName - Entry: 1 - Data: _isTesting - - Name: symbolUniqueName - Entry: 1 - Data: _isTesting - - Name: symbolDefaultValue - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: fieldAttributes - Entry: 7 - Data: 35|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - - Name: - Entry: 12 - Data: 0 - - Name: - Entry: 13 - Data: - - Name: - Entry: 8 - Data: - - Name: userBehaviourSource - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 7 - Data: - - Name: $k - Entry: 1 - Data: _testInitialized - - Name: $v - Entry: 7 - Data: 36|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: fieldSymbol - Entry: 7 - Data: 37|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - - Name: internalType - Entry: 9 - Data: 26 - - Name: declarationType - Entry: 3 - Data: 2 - - Name: syncMode - Entry: 3 - Data: 0 - - Name: symbolResolvedTypeName - Entry: 1 - Data: SystemBoolean - - Name: symbolOriginalName - Entry: 1 - Data: _testInitialized - - Name: symbolUniqueName - Entry: 1 - Data: _testInitialized - - Name: symbolDefaultValue - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: fieldAttributes - Entry: 7 - Data: 38|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - - Name: - Entry: 12 - Data: 0 - - Name: - Entry: 13 - Data: - - Name: - Entry: 8 - Data: - - Name: userBehaviourSource - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 7 - Data: - - Name: $k - Entry: 1 - Data: _testCompleted - - Name: $v - Entry: 7 - Data: 39|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: fieldSymbol - Entry: 7 - Data: 40|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - - Name: internalType - Entry: 9 - Data: 26 - - Name: declarationType - Entry: 3 - Data: 2 - - Name: syncMode - Entry: 3 - Data: 0 - - Name: symbolResolvedTypeName - Entry: 1 - Data: SystemBoolean - - Name: symbolOriginalName - Entry: 1 - Data: _testCompleted - - Name: symbolUniqueName - Entry: 1 - Data: _testCompleted - - Name: symbolDefaultValue - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: fieldAttributes - Entry: 7 - Data: 41|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - - Name: - Entry: 12 - Data: 0 - - Name: - Entry: 13 - Data: - - Name: - Entry: 8 - Data: - - Name: userBehaviourSource - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 7 - Data: - - Name: $k - Entry: 1 - Data: _testCleanedUp - - Name: $v - Entry: 7 - Data: 42|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: fieldSymbol - Entry: 7 - Data: 43|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - - Name: internalType - Entry: 9 - Data: 26 - - Name: declarationType - Entry: 3 - Data: 2 - - Name: syncMode - Entry: 3 - Data: 0 - - Name: symbolResolvedTypeName - Entry: 1 - Data: SystemBoolean - - Name: symbolOriginalName - Entry: 1 - Data: _testCleanedUp - - Name: symbolUniqueName - Entry: 1 - Data: _testCleanedUp - - Name: symbolDefaultValue - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: fieldAttributes - Entry: 7 - Data: 44|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - - Name: - Entry: 12 - Data: 0 - - Name: - Entry: 13 - Data: - - Name: - Entry: 8 - Data: - - Name: userBehaviourSource - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 7 - Data: - - Name: $k - Entry: 1 - Data: _testIndex - - Name: $v - Entry: 7 - Data: 45|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: fieldSymbol - Entry: 7 - Data: 46|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - - Name: internalType - Entry: 7 - Data: 47|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: System.Int32, mscorlib - - Name: - Entry: 8 - Data: - - Name: declarationType - Entry: 3 - Data: 2 - - Name: syncMode - Entry: 3 - Data: 0 - - Name: symbolResolvedTypeName - Entry: 1 - Data: SystemInt32 - - Name: symbolOriginalName - Entry: 1 - Data: _testIndex - - Name: symbolUniqueName - Entry: 1 - Data: _testIndex - - Name: symbolDefaultValue - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: fieldAttributes - Entry: 7 - Data: 48|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - - Name: - Entry: 12 - Data: 0 - - Name: - Entry: 13 - Data: - - Name: - Entry: 8 - Data: - - Name: userBehaviourSource - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 7 - Data: - - Name: $k - Entry: 1 - Data: _pendingNextStep - - Name: $v - Entry: 7 - Data: 49|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: fieldSymbol - Entry: 7 - Data: 50|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - - Name: internalType - Entry: 9 - Data: 26 - - Name: declarationType - Entry: 3 - Data: 2 - - Name: syncMode - Entry: 3 - Data: 0 - - Name: symbolResolvedTypeName - Entry: 1 - Data: SystemBoolean - - Name: symbolOriginalName - Entry: 1 - Data: _pendingNextStep - - Name: symbolUniqueName - Entry: 1 - Data: _pendingNextStep - - Name: symbolDefaultValue - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: fieldAttributes - Entry: 7 - Data: 51|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - - Name: - Entry: 12 - Data: 0 - - Name: - Entry: 13 - Data: - - Name: - Entry: 8 - Data: - - Name: userBehaviourSource - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 13 - Data: - - Name: - Entry: 8 - Data: diff --git a/Scripts/Testing/TestController.cs b/Scripts/Testing/TestController.cs deleted file mode 100644 index a25ead3..0000000 --- a/Scripts/Testing/TestController.cs +++ /dev/null @@ -1,188 +0,0 @@ -using UdonSharp; -using UnityEngine; -using VRC.SDKBase; - -namespace Guribo.UdonUtils.Scripts.Testing -{ - [UdonBehaviourSyncMode(BehaviourSyncMode.NoVariableSync)] - public class TestController : UdonSharpBehaviour - { - private const string LogPrefix = "[UdonUtils] [Testing]"; - - [Header("Start Input")] - public KeyCode startKey0 = KeyCode.T; - public KeyCode startKey1 = KeyCode.E; - public KeyCode startKey2 = KeyCode.S; - - [Header("Abort Input")] - public KeyCode abortKey0 = KeyCode.LeftControl; - public KeyCode abortKey1 = KeyCode.C; - - [Header("Tests")] - public bool startOnPlayerJoin; - - public UdonSharpBehaviour[] tests; - - private bool _isTesting; - private bool _testInitialized; - private bool _testCompleted; - private bool _testCleanedUp; - - private int _testIndex; - private bool _pendingNextStep; - - public override void OnPlayerJoined(VRCPlayerApi player) - { - if (!startOnPlayerJoin) - { - return; - } - - if (Networking.LocalPlayer == player) - { - // start the tests - _isTesting = true; - ContinueTesting(); - } - } - - public void Update() - { - if (_pendingNextStep) - { - _pendingNextStep = false; - ContinueTesting(); - } - - if (_isTesting) - { - if (Input.GetKey(abortKey0) - && Input.GetKey(abortKey1)) - { - AbortTestRun(); - } - } - else - { - if (Input.GetKey(startKey0) - && Input.GetKey(startKey1) - && Input.GetKey(startKey2)) - { - StartTestRun(); - } - } - } - - private void AbortTestRun() - { - Debug.Log($"{LogPrefix} {name}.AbortTestRun: aborting after current test", - this); - - // set the index to the lenght of the list of tests to prevent continuation - _testIndex = tests.Length; - } - - public void StartTestRun() - { - if (_isTesting) - { - Debug.LogWarning($"{LogPrefix} {name}.StartTestRun: can not start a new test while another " + - $"one is still running", - this); - return; - } - - Debug.Log($"{LogPrefix} {name}.StartTestRun", this); - - _isTesting = true; - _testIndex = 0; - _pendingNextStep = true; - } - - private void ContinueTesting() - { - if (tests != null && tests.Length > 0 && _testIndex > -1 && _testIndex < tests.Length) - { - var udonSharpBehaviour = tests[_testIndex]; - if (!udonSharpBehaviour) - { - Debug.LogError($"{LogPrefix} {name}.ContinueTesting: tests contains invalid behaviour", this); - return; - } - - var context = udonSharpBehaviour.gameObject; - if (!_testInitialized) - { - Debug.Log($"{LogPrefix} {name}.ContinueTesting: Initializing test {context}", context); - udonSharpBehaviour.SetProgramVariable("testController", this); - udonSharpBehaviour.SendCustomEvent("Initialize"); - return; - } - - if (!_testCompleted) - { - Debug.Log($"{LogPrefix} {name}.ContinueTesting: Running test {context}", context); - udonSharpBehaviour.SendCustomEvent("Run"); - return; - } - - if (!_testCleanedUp) - { - Debug.Log($"{LogPrefix} {name}.ContinueTesting: Cleaning up test {context}", context); - udonSharpBehaviour.SendCustomEvent("CleanUp"); - return; - } - - ++_testIndex; - _isTesting = _testIndex < tests.Length; - - _testInitialized = false; - _testCompleted = false; - _testCleanedUp = false; - - _pendingNextStep = _isTesting; - - if (!_isTesting) - { - Debug.Log($"{LogPrefix} {name}.ContinueTesting: All test completed"); - } - } - else - { - Debug.LogError($"{LogPrefix} {name}.ContinueTesting: test run aborted"); - _testIndex = 0; - _isTesting = false; - _testInitialized = false; - _testCompleted = false; - _testCleanedUp = false; - _pendingNextStep = false; - } - } - - public void TestInitialized(bool success) - { - Debug.Log($"{LogPrefix} {name}.TestInitialized: Initialized test successfully: {success}", this); - _testInitialized = true; - if (!success) - { - _testCompleted = true; - } - - _pendingNextStep = true; - } - - public void TestCompleted(bool success) - { - Debug.Log($"{LogPrefix} {name}.TestCompleted: Test ran successfully {success}", this); - _testCompleted = true; - _pendingNextStep = true; - } - - public void TestCleanedUp(bool success) - { - Debug.Log($"{LogPrefix} {name}.TestCleanedUp: Cleaned up test successfully: {success}", this); - _testCleanedUp = true; - _pendingNextStep = true; - } - } -} \ No newline at end of file diff --git a/Scripts/Testing/TestTemplate.asset b/Scripts/Testing/TestTemplate.asset deleted file mode 100644 index 70d8a08..0000000 --- a/Scripts/Testing/TestTemplate.asset +++ /dev/null @@ -1,122 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!114 &11400000 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3} - m_Name: TestTemplate - m_EditorClassIdentifier: - serializedUdonProgramAsset: {fileID: 11400000, guid: 317736f34c8993f418944e49f2c5fae6, - type: 2} - udonAssembly: - assemblyError: - sourceCsScript: {fileID: 11500000, guid: 2c925d04d50dc5a4b9379738539a1ac8, type: 3} - behaviourSyncMode: 1 - behaviourIDHeapVarName: __refl_const_intnl_udonTypeID - compileErrors: [] - hasInteractEvent: 0 - serializationData: - SerializedFormat: 2 - SerializedBytes: - ReferencedUnityObjects: - - {fileID: 11500000, guid: 633845384acec5440afe0af63e8253f2, type: 3} - SerializedBytesString: - Prefab: {fileID: 0} - PrefabModificationsReferencedUnityObjects: [] - PrefabModifications: [] - SerializationNodes: - - Name: fieldDefinitions - Entry: 7 - Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition, - UdonSharp.Editor]], mscorlib - - Name: comparer - Entry: 7 - Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String, - mscorlib]], mscorlib - - Name: - Entry: 8 - Data: - - Name: - Entry: 12 - Data: 1 - - Name: - Entry: 7 - Data: - - Name: $k - Entry: 1 - Data: testController - - Name: $v - Entry: 7 - Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: fieldSymbol - Entry: 7 - Data: 3|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - - Name: internalType - Entry: 7 - Data: 4|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: Guribo.UdonUtils.Scripts.Testing.TestController, Assembly-CSharp - - Name: - Entry: 8 - Data: - - Name: declarationType - Entry: 3 - Data: 2 - - Name: syncMode - Entry: 3 - Data: 0 - - Name: symbolResolvedTypeName - Entry: 1 - Data: VRCUdonUdonBehaviour - - Name: symbolOriginalName - Entry: 1 - Data: testController - - Name: symbolUniqueName - Entry: 1 - Data: testController - - Name: symbolDefaultValue - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: fieldAttributes - Entry: 7 - Data: 5|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - - Name: - Entry: 12 - Data: 1 - - Name: - Entry: 7 - Data: 6|System.NonSerializedAttribute, mscorlib - - Name: - Entry: 8 - Data: - - Name: - Entry: 13 - Data: - - Name: - Entry: 8 - Data: - - Name: userBehaviourSource - Entry: 10 - Data: 0 - - Name: - Entry: 8 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 13 - Data: - - Name: - Entry: 8 - Data: diff --git a/Scripts/Testing/TestTemplate.asset.meta b/Scripts/Testing/TestTemplate.asset.meta deleted file mode 100644 index 64d6f93..0000000 --- a/Scripts/Testing/TestTemplate.asset.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 1f1cddce4d9842e9a54f0adbc4379f09 -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 0 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Scripts/Testing/TestTemplate.cs b/Scripts/Testing/TestTemplate.cs deleted file mode 100644 index 689c0e4..0000000 --- a/Scripts/Testing/TestTemplate.cs +++ /dev/null @@ -1,111 +0,0 @@ -using System; -using UdonSharp; -using UnityEngine; -using VRC.SDKBase; - -namespace Guribo.UdonUtils.Scripts.Testing -{ - /// - /// Component which implements the base of a test case, includes preparation, execution and cleanup methods - /// to be copied to new test scripts and filled for each individual test case. - /// - /// Behaviour sync mode can be changed depending on the test performed, default is no variable sync - /// - [UdonBehaviourSyncMode(BehaviourSyncMode.NoVariableSync)] - public class TestTemplate : UdonSharpBehaviour - { - #region DO NOT EDIT - - [NonSerialized] public TestController testController; - - public void Initialize() - { - if (!testController) - { - Debug.LogError("[UdonUtils] [Testing] Test.Initialize: invalid test controller", this); - return; - } - Debug.Log("[UdonUtils] [Testing] Test.Initialize", this); - InitializeTest(); - } - - public void Run() - { - if (!testController) - { - Debug.LogError("[UdonUtils] [Testing] Test.Run: invalid test controller", this); - return; - } - - Debug.Log("[UdonUtils] [Testing] Test.Run", this); - RunTest(); - } - - public void CleanUp() - { - if (!testController) - { - Debug.LogError("[UdonUtils] [Testing] Test.CleanUp: invalid test controller", this); - return; - } - Debug.Log("[UdonUtils] [Testing] Test.CleanUp", this); - CleanUpTest(); - } - - #endregion - - #region EDIT HERE - - private void InitializeTest() - { - // TODO your init behaviour here - // ... - - // whenever the test is ready to be started call TestController.TestInitialized, - // can be later in update or whenever but MUST be called at some point - testController.TestInitialized(true); - } - - private void RunTest() - { - // TODO your test behaviour here - // ... - - // whenever the test is completed call TestController.TestCompleted, - // can be later in update or whenever but MUST be called at some point - testController.TestCompleted(true); - } - - private void CleanUpTest() - { - // TODO your clean up behaviour here - // ... - - // whenever the test is cleaned up call TestController.TestCleanedUp, - // can be later in update or whenever but MUST be called at some point - testController.TestCleanedUp(true); - } - - private bool Assert(bool condition, string message) - { - if (!condition) - { - if (Utilities.IsValid(this)) - { - Debug.LogError("[UdonUtils] [Testing] Assertion failed : '" + GetType() + " : " + message + "'", this); - } - else - { - Debug.LogError("[UdonUtils] [Testing] Assertion failed : 'UNKNOWN TYPE: " + message + "'"); - } - - return false; - } - - Debug.Assert(condition, message); - return true; - } - - #endregion - } -} diff --git a/Scripts/UdonBehaviourExtensions.cs b/Scripts/UdonBehaviourExtensions.cs deleted file mode 100644 index 55b0d83..0000000 --- a/Scripts/UdonBehaviourExtensions.cs +++ /dev/null @@ -1,345 +0,0 @@ -#if UNITY_EDITOR -using System; -using System.Collections.Generic; -using UdonSharp; -using UnityEditor; -using UnityEngine; -using VRC.Udon; -using VRC.Udon.Common; -using VRC.Udon.Common.Interfaces; -using VRC.Udon.Serialization.OdinSerializer.Utilities; -using Object = UnityEngine.Object; - -namespace Guribo.UdonUtils.Scripts -{ - /// - /// contains functions to access and modify UdonBehaviour variables in Edit mode - /// - public static class UdonBehaviourExtensions - { - #region public - - #region GetVariable - - /// - /// read the default value of a variable that is visible in the UdonBehaviour inspector - /// - /// - /// name of the variable visible in the inspector on the UdonBehaviour - /// type of the value, can potentially be null! - /// the default value - /// if udonBehaviour is invalid - /// e.g. if the symbolName doesn't exist - public static object GetInspectorVariableDefaultValue(this UdonBehaviour udonBehaviour, - string symbolName, - out Type variableType) - { - if (!udonBehaviour) - { - throw new ArgumentException("Invalid UdonBehaviour"); - } - - // if (Application.IsPlaying(udonBehaviour)) - // { - // throw new Exception("Only edit mode is supported"); - // } - - var programAsset = (UdonSharpProgramAsset) udonBehaviour.programSource; - if (!programAsset) - { - throw new Exception("UdonBehaviour has no UdonSharpProgramAsset"); - } - - programAsset.UpdateProgram(); - - var publicVariables = udonBehaviour.publicVariables; - if (publicVariables == null) - { - throw new Exception("UdonBehaviour has no public Variables"); - } - - GetVariableType(udonBehaviour, symbolName, out variableType, publicVariables, programAsset); - - var defaultValue = programAsset.GetPublicVariableDefaultValue(symbolName); - if (variableType == null) - { - variableType = defaultValue?.GetType(); - } - - return defaultValue; - } - - /// - /// read the value of a variable that is visible in the UdonBehaviour inspector - /// - /// - /// name of the variable visible in the inspector on the UdonBehaviour - /// the current value or the default value if it has not been changed - /// type of the value, can potentially be null! - /// True if the value was read and it is not the default value, false if it is the default value - /// if udonBehaviour is invalid - /// e.g. if the symbolName doesn't exist - public static bool GetInspectorVariable(this UdonBehaviour udonBehaviour, string symbolName, - out object variableValue, out Type variableType) - { - if (!udonBehaviour) - { - throw new ArgumentException("Invalid UdonBehaviour"); - } - - // if (Application.IsPlaying(udonBehaviour)) - // { - // throw new Exception("Only edit mode is supported"); - // } - - var programAsset = (UdonSharpProgramAsset) udonBehaviour.programSource; - if (!programAsset) - { - throw new Exception("UdonBehaviour has no UdonSharpProgramAsset"); - } - - programAsset.UpdateProgram(); - - var publicVariables = udonBehaviour.publicVariables; - if (publicVariables == null) - { - throw new Exception("UdonBehaviour has no public Variables"); - } - - variableValue = null; - var defaultValue = programAsset.GetPublicVariableDefaultValue(symbolName); - - GetVariableType(udonBehaviour, symbolName, out variableType, publicVariables, programAsset); - - try - { - if (publicVariables.TryGetVariableValue(symbolName, out variableValue)) - { - return defaultValue != variableValue; - } - - variableValue = defaultValue; - return false; - } - finally - { - if (variableType == null) - { - variableType = variableValue?.GetType(); - } - } - } - - #endregion - - #region SetVariable - - /// - /// modified version of Merlin's code for drawing UdonBehaviour inspectors used to set variables from any other - /// C# script while in Edit mode - /// - /// - /// name of the variable visible in the inspector on the UdonBehaviour - /// - /// if udonBehaviour is invalid - /// e.g. if the symbolName doesn't exist - public static void SetInspectorVariable(this UdonBehaviour udonBehaviour, string symbolName, object newValue) - { - if (!udonBehaviour) - { - throw new ArgumentException("Invalid UdonBehaviour"); - } - - // if (Application.IsPlaying(udonBehaviour)) - // { - // throw new Exception("Only edit mode is supported"); - // } - - var publicVariables = udonBehaviour.publicVariables; - if (publicVariables == null) - { - throw new Exception("UdonBehaviour has no public Variables"); - } - - Undo.RecordObject(udonBehaviour, "Modify variable"); - if (!publicVariables.TrySetVariableValue(symbolName, newValue)) - { - var symbolTable = GetSymbolTable(udonBehaviour); - var symbolType = symbolTable.GetSymbolType(symbolName); - if (!publicVariables.TryAddVariable(CreateUdonVariable(symbolName, newValue, - symbolType))) - { - throw new Exception($"Failed to set public variable '{symbolName}' value"); - } - } - - var foundValue = publicVariables.TryGetVariableValue(symbolName, out var variableValue); - var foundType = publicVariables.TryGetVariableType(symbolName, out var variableType); - - // copied from Merlin's code, see UdonSharpProgramAsset.cs for reference - if (foundValue - && foundType - && variableValue.IsUnityObjectNull() - && (variableType == typeof(GameObject) - || variableType == typeof(UdonBehaviour) - || variableType == typeof(Transform))) - { - udonBehaviour.publicVariables.RemoveVariable(symbolName); - } - - GUI.changed = true; - - if (PrefabUtility.IsPartOfPrefabInstance(udonBehaviour)) - { - PrefabUtility.RecordPrefabInstancePropertyModifications(udonBehaviour); - } - } - - /// - /// resets a value to the prefab or original script value - /// - /// - /// name of the variable visible in the inspector on the UdonBehaviour - /// if udonBehaviour is invalid - /// e.g. if the symbolName doesn't exist - public static void ResetInspectorVariable(this UdonBehaviour udonBehaviour, string symbolName) - { - if (!udonBehaviour) - { - throw new ArgumentException("Invalid UdonBehaviour"); - } - - // if (Application.IsPlaying(udonBehaviour)) - // { - // throw new Exception("Only edit mode is supported"); - // } - - var programAsset = (UdonSharpProgramAsset) udonBehaviour.programSource; - if (!programAsset) - { - throw new Exception("UdonBehaviour has no UdonSharpProgramAsset"); - } - - programAsset.UpdateProgram(); - - udonBehaviour.SetInspectorVariable(symbolName, programAsset.GetPublicVariableDefaultValue(symbolName)); - } - - #endregion - - - /// - /// returns a List if names of the variables visible in the inspector on the UdonBehaviour - /// - /// - /// - /// if udonBehaviour is invalid - public static List GetInspectorVariableNames(this UdonBehaviour udonBehaviour) - { - if (!udonBehaviour) - { - throw new ArgumentException("Invalid UdonBehaviour"); - } - - try - { - return new List(udonBehaviour.GetSymbolTable().GetExportedSymbols()); - } - catch (Exception e) - { - Debug.Log(e.Message + " (skipping)", udonBehaviour); - return new List(); - } - } - - /// - /// checks whether the current value of a variable is null (not nullable types return false) - /// - /// - /// - /// - /// - /// if udonBehaviour is invalid - public static bool IsInspectorVariableNull(this UdonBehaviour udonBehaviour, - string symbolName, - out Type variableType) - { - udonBehaviour.GetInspectorVariable(symbolName, out var variableValue, out variableType); - return variableType.IsNullable() && variableValue.IsUnityObjectNull(); - } - - #endregion - - #region private - - private static void GetVariableType(UdonBehaviour udonBehaviour, string symbolName, out Type variableType, - IUdonVariableTable publicVariables, UdonSharpProgramAsset programAsset) - { - if (!publicVariables.TryGetVariableType(symbolName, out variableType)) - { - var symbolTable = udonBehaviour.GetSymbolTable(); - if (symbolTable.HasAddressForSymbol(symbolName)) - { - var symbolAddress = symbolTable.GetAddressFromSymbol(symbolName); - var program = programAsset.GetRealProgram(); - variableType = program.Heap.GetHeapVariableType(symbolAddress); - } - else - { - variableType = null; - } - } - } - - - /// - /// - /// - /// - /// if the UdonBehaviour has no public variables - private static IUdonSymbolTable GetSymbolTable(this UdonBehaviour udonBehaviour) - { - if (!udonBehaviour || !(udonBehaviour.programSource is UdonSharpProgramAsset)) - { - throw new Exception("ProgramSource is not an UdonSharpProgramAsset"); - } - - var programAsset = (UdonSharpProgramAsset) udonBehaviour.programSource; - if (!programAsset) - { - throw new Exception("UdonBehaviour has no UdonSharpProgramAsset"); - } - - programAsset.UpdateProgram(); - - var program = programAsset.GetRealProgram(); - if (program?.SymbolTable == null) - { - throw new Exception("UdonBehaviour has no public variables"); - } - - return program.SymbolTable; - } - - - private static IUdonVariable CreateUdonVariable(string symbolName, object value, Type type) - { - var udonVariableType = typeof(UdonVariable<>).MakeGenericType(type); - return (IUdonVariable) Activator.CreateInstance(udonVariableType, symbolName, value); - } - - private static bool IsUnityObjectNull(this object value) - { - return value == null || value is Object unityEngineObject && unityEngineObject == null; - } - - private static bool IsNullable(this Type type) - { - return type.IsNullableType(); - } - - #endregion - } -} - -#endif \ No newline at end of file diff --git a/Scripts/UdonBehaviourExtensions.cs.meta b/Scripts/UdonBehaviourExtensions.cs.meta deleted file mode 100644 index 6941b1c..0000000 --- a/Scripts/UdonBehaviourExtensions.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 9bea236e68214624982e06115a179a2b -timeCreated: 1610041694 \ No newline at end of file diff --git a/Scripts/UdonUtilsPackageExporter.cs b/Scripts/UdonUtilsPackageExporter.cs deleted file mode 100644 index 4f23af8..0000000 --- a/Scripts/UdonUtilsPackageExporter.cs +++ /dev/null @@ -1,51 +0,0 @@ -#if UNITY_EDITOR -using Guribo.UdonUtils.Scripts.Editor; -using UnityEditor; - -namespace Guribo.UdonUtils.Scripts -{ - public class UdonUtilsPackageExporter : PackageExporter - { - [MenuItem("Guribo/UDON/UdonUtils/Export Unity Package")] - public new static void ExportPackage() - { - Export(); - } - - protected override string GetRepositoryPath() - { - return "./Assets/Guribo/UdonUtils"; - } - - protected override string GetExportPath() - { - return "./Assets/Guribo/UdonUtils/Releases/"; - } - - protected override string GetReleaseVersion() - { - return "Version.txt"; - } - - protected override string GetUnityPackage() - { - return "GuriboUdonUtils"; - } - - protected override string[] GetExportAssets() - { - return new[] - { - "Assets/Guribo/UdonUtils/Graphs", - "Assets/Guribo/UdonUtils/Prefabs", - "Assets/Guribo/UdonUtils/README", - "Assets/Guribo/UdonUtils/Scenes", - "Assets/Guribo/UdonUtils/Scripts", - "Assets/Guribo/UdonUtils/LICENSE", - "Assets/Guribo/UdonUtils/README.md", - "Assets/Guribo/UdonUtils/Version.txt" - }; - } - } -} -#endif diff --git a/Scripts/UdonUtilsPackageExporter.cs.meta b/Scripts/UdonUtilsPackageExporter.cs.meta deleted file mode 100644 index 2dcbd94..0000000 --- a/Scripts/UdonUtilsPackageExporter.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 91ce5fc9c08c2a744aeb2c5063f165f5 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Version.txt b/Version.txt deleted file mode 100644 index a92e827..0000000 --- a/Version.txt +++ /dev/null @@ -1 +0,0 @@ -v0.0.4 \ No newline at end of file diff --git a/Version.txt.meta b/Version.txt.meta deleted file mode 100644 index 76bc64a..0000000 --- a/Version.txt.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: f46aec24918d57e49a13fd458d6a03a4 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/package.json b/package.json deleted file mode 100644 index 382adc5..0000000 --- a/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "tlp.udonutils", - "displayName": "Udon Utils", - "version": "0.4.0", - "unity": "2019.4", - "description": "Prefabs and potentially helpful examples for working with Udon/UdonSharp for VRChat Worlds.", - "dependencies": {}, - "gitDependencies": { - "com.vrchat.base": "https://github.com/vrchat/packages.git?path=/packages/com.vrchat.base#3.0.1", - "com.vrchat.worlds": "https://github.com/vrchat/packages.git?path=/packages/com.vrchat.worlds#3.0.1" - }, - "url": "https://github.com/Guribo/UdonUtils.git#0.4.0" -}