Added Unity project files

This commit is contained in:
2026-06-07 16:58:24 +01:00
parent 3cc05d260b
commit 23bbcab156
3942 changed files with 453676 additions and 0 deletions

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 5d08af4662fbe5b49b6fcca98c323377
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,149 @@
using UdonSharp;
using UnityEngine;
using VRC.SDKBase;
using VRC.Udon;
namespace UdonSharp.Tests
{
[AddComponentMenu("Udon Sharp/Tests/DefaultHeapValueTest")]
public class DefaultHeapValueTest : UdonSharpBehaviour
{
[System.NonSerialized]
public IntegrationTestSuite tester;
public void ExecuteTests()
{
TestPublicArray();
TestPublicString();
TestSyncedString();
TestPrivateArr();
TestPrivateStr();
TestDefaultByte();
TestJaggedArrays();
TestObjectInt();
TestDefaultReferences();
}
[HideInInspector]
public string[] defaultPublicArr;
[HideInInspector]
public UdonSharpBehaviour[] emptyUdonBehaviourArray;
[SerializeField]
public readonly string readonlyStr = "aaa";
[SerializeField]
public const string constStr = "bbb";
void TestPublicArray()
{
tester.TestAssertion("Default Public Array Initialized", defaultPublicArr != null && defaultPublicArr.Length == 0);
tester.TestAssertion("Default UdonSharpBehaviour Public Array Initialized", emptyUdonBehaviourArray != null && emptyUdonBehaviourArray.Length == 0);
}
[HideInInspector]
public string defaultString;
void TestPublicString()
{
tester.TestAssertion("Default String Value", defaultString == "");
}
#pragma warning disable 0649
[UdonSynced]
string networkSyncedString;
#pragma warning restore 0649
[UdonSynced]
string networkSyncedStringDefaultEmpty = "";
[UdonSynced]
string networkSyncedStringDefaultValue = "hello";
[UdonSynced, HideInInspector]
public string publicNetworkSyncedString;
[UdonSynced, HideInInspector]
public string publicNetworkSyncedStringDefaultEmpty = "";
[UdonSynced, HideInInspector]
public string publicNetworkSyncedStringDefaultValue = "hello";
void TestSyncedString()
{
tester.TestAssertion("Uninitialized Synced String", networkSyncedString == "");
tester.TestAssertion("Empty Synced String Value", networkSyncedStringDefaultEmpty == "");
tester.TestAssertion("Default Synced String Value", networkSyncedStringDefaultValue == "hello");
tester.TestAssertion("Uninitialized Public Synced String", publicNetworkSyncedString == "");
tester.TestAssertion("Empty Public Synced String Value", publicNetworkSyncedStringDefaultEmpty == "");
tester.TestAssertion("Default Public Synced String Value", publicNetworkSyncedStringDefaultValue == "hello");
}
#pragma warning disable 0649
string[] privateStrArr;
string privateStr;
#pragma warning restore 0649
string privateNullInitializedString = null;
string privateInitializedString = "Test";
void TestPrivateArr()
{
tester.TestAssertion("Private Array Default Null", privateStrArr == null);
}
void TestPrivateStr()
{
tester.TestAssertion("Private String Default Null", privateStr == null);
tester.TestAssertion("Private null initialized String", privateNullInitializedString == null);
tester.TestAssertion("Private initialized String", privateInitializedString == "Test");
}
byte byteVal = 0b1000_0000;
void TestDefaultByte()
{
tester.TestAssertion("Byte type match", byteVal.GetType() == typeof(byte));
}
int[][] jaggedArrayInitialVal = new[] { new[] { 1, 2 }, new[] { 3, 4 }, null };
void TestJaggedArrays()
{
tester.TestAssertion("Jagged array initialized", jaggedArrayInitialVal != null);
tester.TestAssertion("Jagged array type", jaggedArrayInitialVal.GetType() == typeof(object[]));
tester.TestAssertion("Jagged array element type", jaggedArrayInitialVal[0].GetType() == typeof(int[]));
tester.TestAssertion("Jagged array values", jaggedArrayInitialVal[0][0] == 1 &&
jaggedArrayInitialVal[0][1] == 2 &&
jaggedArrayInitialVal[1][0] == 3 &&
jaggedArrayInitialVal[1][1] == 4 &&
jaggedArrayInitialVal[2] == null);
}
public object objectIntVal = 5;
// Should by synced by the custom inspector to the same value as objectIntVal
[HideInInspector]
public object syncedObjectIntVal = 5;
void TestObjectInt()
{
tester.TestAssertion("Object int is valid", (int)objectIntVal == (int)syncedObjectIntVal);
}
//[HideInInspector]
public Transform nullTransform;
//[HideInInspector]
public GameObject nullGameObject;
//[HideInInspector]
public UdonBehaviour nullUdonBehaviour;
void TestDefaultReferences()
{
tester.TestAssertion("Default Transform null", nullTransform == null);
tester.TestAssertion("Default GameObject null", nullGameObject == null);
tester.TestAssertion("Default UdonBehaviour null", nullUdonBehaviour == null);
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 7c9c6858cb4c7f54c95614138d4525f1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,227 @@
%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: DisabledObjectHeapTest
m_EditorClassIdentifier:
serializedUdonProgramAsset: {fileID: 11400000, guid: e5ddf7c83615eda419fe981f57d360e8,
type: 2}
udonAssembly:
assemblyError:
sourceCsScript: {fileID: 11500000, guid: 40a839160c04d13408572ceb8a076858, type: 3}
scriptVersion: 2
compiledVersion: 2
behaviourSyncMode: 0
hasInteractEvent: 0
scriptID: 3514381551992571887
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: 3
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: tester
- Name: $v
Entry: 7
Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: tester
- Name: <UserType>k__BackingField
Entry: 7
Data: 3|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UdonSharp.Tests.IntegrationTestSuite, UdonSharp.Tests
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 7
Data: 4|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: VRC.Udon.UdonBehaviour, VRC.Udon
- Name:
Entry: 8
Data:
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- 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:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: referenceScript
- Name: $v
Entry: 7
Data: 7|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: referenceScript
- Name: <UserType>k__BackingField
Entry: 7
Data: 8|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UdonSharp.Tests.InstantiatedObjectTesterScript, UdonSharp.Tests
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 4
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: true
- 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:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: callCounter
- Name: $v
Entry: 7
Data: 10|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: callCounter
- Name: <UserType>k__BackingField
Entry: 7
Data: 11|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Int32, mscorlib
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 11
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>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: 13
Data:
- Name:
Entry: 8
Data:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 213b9ec3701d93841b1e93d201119846
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,59 @@
using UdonSharp;
using UnityEngine;
using VRC.SDKBase;
using VRC.Udon;
namespace UdonSharp.Tests
{
/// <summary>
/// Tests getting and setting variables on disabled UdonBehaviours that have never been enabled
/// https://vrchat.canny.io/vrchat-udon-closed-alpha-bugs/p/heap-values-are-not-initialized-in-some-cases-so-getprogramvariable-returns-null
/// </summary>
[AddComponentMenu("Udon Sharp/Tests/DisabledObjectHeapTest")]
public class DisabledObjectHeapTest : UdonSharpBehaviour
{
[System.NonSerialized]
public IntegrationTestSuite tester;
public InstantiatedObjectTesterScript referenceScript;
public void ExecuteTests()
{
if (referenceScript == null)
Debug.LogError("[DisabledObjectHeapTest] Reference script cannot be null");
TestHeapVariableGet();
TestHeapVariableSet();
TestCustomEvent();
}
void TestHeapVariableGet()
{
tester.TestAssertion("Disabled Object Heap Get Value", referenceScript.testValueStr == "test");
}
void TestHeapVariableSet()
{
referenceScript.testValueStr = "test set value";
tester.TestAssertion("Disabled Object Heap Set Value", referenceScript.testValueStr == "test set value");
}
int callCounter = 0;
public void SpawnEvent()
{
callCounter++;
}
void TestCustomEvent()
{
callCounter = 0;
referenceScript.spawnerBehaviour = this;
referenceScript.CallEvent();
tester.TestAssertion("Disabled Object Send Custom Event", callCounter == 1);
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 40a839160c04d13408572ceb8a076858
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,173 @@
%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: InstantiateTest
m_EditorClassIdentifier:
serializedUdonProgramAsset: {fileID: 11400000, guid: 51935e79f28f94c4aa046c7bf566f626,
type: 2}
udonAssembly:
assemblyError:
sourceCsScript: {fileID: 11500000, guid: 3de5d0158277a3143971e0c897670d82, type: 3}
scriptVersion: 2
compiledVersion: 2
behaviourSyncMode: 0
hasInteractEvent: 0
scriptID: 1234362162044582622
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: tester
- Name: $v
Entry: 7
Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: tester
- Name: <UserType>k__BackingField
Entry: 7
Data: 3|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UdonSharp.Tests.IntegrationTestSuite, UdonSharp.Tests
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 7
Data: 4|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: VRC.Udon.UdonBehaviour, VRC.Udon
- Name:
Entry: 8
Data:
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- 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:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: objectToSpawn
- Name: $v
Entry: 7
Data: 7|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: objectToSpawn
- Name: <UserType>k__BackingField
Entry: 7
Data: 8|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.GameObject, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 8
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: true
- 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:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 518bc3c50e6d8db4e944181651e673dc
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,24 @@
using UdonSharp;
using UnityEngine;
using VRC.SDKBase;
using VRC.Udon;
namespace UdonSharp.Tests
{
[AddComponentMenu("Udon Sharp/Tests/InstantiateTest")]
public class InstantiateTest : UdonSharpBehaviour
{
[System.NonSerialized]
public IntegrationTestSuite tester;
public GameObject objectToSpawn;
public void ExecuteTests()
{
GameObject newObject = Instantiate(objectToSpawn);
tester.TestAssertion("Instantiation", newObject != null);
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 3de5d0158277a3143971e0c897670d82
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,227 @@
%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: InstantiatedObjectHeapTest
m_EditorClassIdentifier:
serializedUdonProgramAsset: {fileID: 11400000, guid: 79e81323a71c98c4bab0b09663b8363c,
type: 2}
udonAssembly:
assemblyError:
sourceCsScript: {fileID: 11500000, guid: 9eba725dcf6e7754bb6e2a9cde797288, type: 3}
scriptVersion: 2
compiledVersion: 2
behaviourSyncMode: 0
hasInteractEvent: 0
scriptID: 7521262830942848020
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: 3
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: tester
- Name: $v
Entry: 7
Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: tester
- Name: <UserType>k__BackingField
Entry: 7
Data: 3|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UdonSharp.Tests.IntegrationTestSuite, UdonSharp.Tests
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 7
Data: 4|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: VRC.Udon.UdonBehaviour, VRC.Udon
- Name:
Entry: 8
Data:
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- 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:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: referenceSpawnObject
- Name: $v
Entry: 7
Data: 7|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: referenceSpawnObject
- Name: <UserType>k__BackingField
Entry: 7
Data: 8|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.GameObject, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 8
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: true
- 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:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: spawnCounter
- Name: $v
Entry: 7
Data: 10|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: spawnCounter
- Name: <UserType>k__BackingField
Entry: 7
Data: 11|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Int32, mscorlib
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 11
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>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: 13
Data:
- Name:
Entry: 8
Data:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 11da5e3fbabd9684c8357d050833f2d0
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,89 @@
using UdonSharp;
using UnityEngine;
using VRC.SDKBase;
using VRC.Udon;
namespace UdonSharp.Tests
{
/// <summary>
/// Tests the issue where the heap will not be immediately initialized after instantiation
/// https://vrchat.canny.io/vrchat-udon-closed-alpha-bugs/p/heap-values-are-not-initialized-in-some-cases-so-getprogramvariable-returns-null
/// </summary>
[AddComponentMenu("Udon Sharp/Tests/InstantiatedObjectHeapTest")]
public class InstantiatedObjectHeapTest : UdonSharpBehaviour
{
[System.NonSerialized]
public IntegrationTestSuite tester;
public GameObject referenceSpawnObject;
public void ExecuteTests()
{
TestHeapVariableGetComponent();
TestHeapVariableGet();
TestHeapVariableSet();
TestCustomEvent();
}
void TestHeapVariableGetComponent()
{
GameObject newObject = Instantiate(referenceSpawnObject);
InstantiatedObjectTesterScript testScript = newObject.GetComponent<InstantiatedObjectTesterScript>();
// GetComponent<User T>() will fail immediately after instantiation because the script ID heap variable returns null, so U# has no way to determine the script type
tester.TestAssertion("Instantiated Object GetComponent<T>()", testScript != null);
Destroy(newObject);
}
void TestHeapVariableGet()
{
GameObject newObject = Instantiate(referenceSpawnObject);
// Have a separate case that will force find the script because of the above issue. We know in this specific test case that the only UdonBehaviour on the object will be of the type `InstantiatedObjectTesterScript`
InstantiatedObjectTesterScript testScript = (InstantiatedObjectTesterScript)newObject.GetComponent(typeof(UdonBehaviour));
tester.TestAssertion("Instantiated Object Get Field", testScript.testValueStr == "test");
Destroy(newObject);
}
void TestHeapVariableSet()
{
GameObject newObject = Instantiate(referenceSpawnObject);
InstantiatedObjectTesterScript testScript = (InstantiatedObjectTesterScript)newObject.GetComponent(typeof(UdonBehaviour));
testScript.testValueStr = "test set";
tester.TestAssertion("Instantiated Object Set Field", testScript.testValueStr == "test set");
Destroy(newObject);
}
int spawnCounter = 0;
public void SpawnEvent()
{
spawnCounter++;
}
void TestCustomEvent()
{
spawnCounter = 0;
GameObject newObject = Instantiate(referenceSpawnObject);
InstantiatedObjectTesterScript testScript = (InstantiatedObjectTesterScript)newObject.GetComponent(typeof(UdonBehaviour));
testScript.spawnerBehaviour = this;
testScript.CallEvent();
tester.TestAssertion("Instantiated Object Send Event", spawnCounter == 1);
Destroy(newObject);
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 9eba725dcf6e7754bb6e2a9cde797288
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,179 @@
%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: InstantiatedObjectTesterScript
m_EditorClassIdentifier:
serializedUdonProgramAsset: {fileID: 11400000, guid: d6eb6e26d8ad6ea4fb7e1aba766a266d,
type: 2}
udonAssembly:
assemblyError:
sourceCsScript: {fileID: 11500000, guid: f954ee1bc9f7221428b5efac9703574f, type: 3}
scriptVersion: 2
compiledVersion: 2
behaviourSyncMode: 0
hasInteractEvent: 0
scriptID: 3115546563226124005
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: testValueStr
- Name: $v
Entry: 7
Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: testValueStr
- Name: <UserType>k__BackingField
Entry: 7
Data: 3|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.String, mscorlib
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 3
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>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: 1
- Name:
Entry: 7
Data: 5|System.NonSerializedAttribute, mscorlib
- 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: spawnerBehaviour
- Name: $v
Entry: 7
Data: 6|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: spawnerBehaviour
- Name: <UserType>k__BackingField
Entry: 7
Data: 7|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UdonSharp.UdonSharpBehaviour, UdonSharp.Runtime
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 7
Data: 8|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: VRC.Udon.UdonBehaviour, VRC.Udon
- Name:
Entry: 8
Data:
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- 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|System.NonSerializedAttribute, mscorlib
- 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:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: a814dd095e217094783161f851d22677
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,23 @@
using UdonSharp;
using UnityEngine;
using VRC.SDKBase;
using VRC.Udon;
namespace UdonSharp.Tests
{
[AddComponentMenu("Udon Sharp/Tests/InstantiatedObjectTesterScript")]
public class InstantiatedObjectTesterScript : UdonSharpBehaviour
{
[System.NonSerialized]
public string testValueStr = "test";
[System.NonSerialized]
public UdonSharpBehaviour spawnerBehaviour;
public void CallEvent()
{
spawnerBehaviour.SendCustomEvent("SpawnEvent");
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: f954ee1bc9f7221428b5efac9703574f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,119 @@
%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: MultiOutParamsTest
m_EditorClassIdentifier:
serializedUdonProgramAsset: {fileID: 11400000, guid: 2ee6bc48c97500e468bb21206417fab3,
type: 2}
udonAssembly:
assemblyError:
sourceCsScript: {fileID: 11500000, guid: 797e26f98e6de8244a2ec0920b0b7357, type: 3}
scriptVersion: 2
compiledVersion: 2
behaviourSyncMode: 0
hasInteractEvent: 0
scriptID: 2300852345627323833
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: tester
- Name: $v
Entry: 7
Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: tester
- Name: <UserType>k__BackingField
Entry: 7
Data: 3|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UdonSharp.Tests.IntegrationTestSuite, UdonSharp.Tests
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 7
Data: 4|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: VRC.Udon.UdonBehaviour, VRC.Udon
- Name:
Entry: 8
Data:
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- 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:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 0e95b13413eb9444c9d95dea3b5c3a90
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,35 @@
using UdonSharp;
using UnityEngine;
using VRC.SDKBase;
using VRC.Udon;
namespace UdonSharp.Tests
{
/// <summary>
/// Tests for bug in the VM where methods with multiple `out` or `ref` parameters do not update the out parameters correctly
/// </summary>
[AddComponentMenu("Udon Sharp/Tests/MultiOutParamsTest")]
public class MultiOutParamsTest : UdonSharpBehaviour
{
[System.NonSerialized]
public IntegrationTestSuite tester;
public void ExecuteTests()
{
TestAngleAxis();
}
// https://vrchat.canny.io/vrchat-udon-closed-alpha-bugs/p/quaterniontoangleaxis-broken
void TestAngleAxis()
{
Quaternion rotation = Quaternion.AngleAxis(20f, new Vector3(1, 2, 3).normalized);
float angle = 0f;
Vector3 axis = Vector3.zero;
rotation.ToAngleAxis(out angle, out axis);
tester.TestAssertion("Angle Axis double out params", angle != 0f || axis != Vector3.zero);
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 797e26f98e6de8244a2ec0920b0b7357
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,173 @@
%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: ObjectDestroyNullCheck
m_EditorClassIdentifier:
serializedUdonProgramAsset: {fileID: 11400000, guid: 13868f2d3fd66794e9d2c36994256235,
type: 2}
udonAssembly:
assemblyError:
sourceCsScript: {fileID: 11500000, guid: fa32787c3ba678e448af147755123e6b, type: 3}
scriptVersion: 2
compiledVersion: 2
behaviourSyncMode: 0
hasInteractEvent: 0
scriptID: -4001887540346047457
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: tester
- Name: $v
Entry: 7
Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: tester
- Name: <UserType>k__BackingField
Entry: 7
Data: 3|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UdonSharp.Tests.IntegrationTestSuite, UdonSharp.Tests
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 7
Data: 4|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: VRC.Udon.UdonBehaviour, VRC.Udon
- Name:
Entry: 8
Data:
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- 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:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: refObject
- Name: $v
Entry: 7
Data: 7|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: refObject
- Name: <UserType>k__BackingField
Entry: 7
Data: 8|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.GameObject, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 8
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: true
- 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:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 60552f7a4b6f0894c9d76cf403e991a4
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,24 @@
using UdonSharp;
using UnityEngine;
using VRC.SDKBase;
using VRC.Udon;
namespace UdonSharp.Tests
{
[AddComponentMenu("Udon Sharp/Tests/ObjectDestroyNullCheck")]
public class ObjectDestroyNullCheck : UdonSharpBehaviour
{
[System.NonSerialized]
public IntegrationTestSuite tester;
public GameObject refObject;
public void ExecuteTests()
{
DestroyImmediate(refObject);
tester.TestAssertion("Object Destroy Null Check", refObject == null);
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: fa32787c3ba678e448af147755123e6b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,173 @@
%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: SByteSerialization
m_EditorClassIdentifier:
serializedUdonProgramAsset: {fileID: 11400000, guid: 44da3aa0c5926164989e1f839153951c,
type: 2}
udonAssembly:
assemblyError:
sourceCsScript: {fileID: 11500000, guid: 42de95979951f144c9f1eb2a5f83f7d3, type: 3}
scriptVersion: 2
compiledVersion: 2
behaviourSyncMode: 0
hasInteractEvent: 0
scriptID: -3970228497806917261
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: tester
- Name: $v
Entry: 7
Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: tester
- Name: <UserType>k__BackingField
Entry: 7
Data: 3|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UdonSharp.Tests.IntegrationTestSuite, UdonSharp.Tests
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 7
Data: 4|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: VRC.Udon.UdonBehaviour, VRC.Udon
- Name:
Entry: 8
Data:
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- 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:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: negativeSbyte
- Name: $v
Entry: 7
Data: 7|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: negativeSbyte
- Name: <UserType>k__BackingField
Entry: 7
Data: 8|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.SByte, mscorlib
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 8
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- 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:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e326122c61957684dad8dbf21435b06c
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,28 @@
using UdonSharp;
using UnityEngine;
using VRC.SDKBase;
using VRC.Udon;
namespace UdonSharp.Tests
{
/// <summary>
/// Negative SByte values get read as 0 due to a bug in Odin that hasn't been fixed in VRC's branch
///
/// https://github.com/TeamSirenix/odin-serializer/issues/40
/// https://vrchat.canny.io/vrchat-udon-closed-alpha-bugs/p/negative-sbytes-do-not-get-serialized-correctly
/// </summary>
[AddComponentMenu("Udon Sharp/Tests/SByteSerialization")]
public class SByteSerialization : UdonSharpBehaviour
{
[System.NonSerialized]
public IntegrationTestSuite tester;
sbyte negativeSbyte = -1;
public void ExecuteTests()
{
tester.TestAssertion("Negative SByte serialization", negativeSbyte == -1);
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 42de95979951f144c9f1eb2a5f83f7d3
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,119 @@
%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: StructMutatorTest
m_EditorClassIdentifier:
serializedUdonProgramAsset: {fileID: 11400000, guid: 3eaf2743ef78a61499fe8b8126c00693,
type: 2}
udonAssembly:
assemblyError:
sourceCsScript: {fileID: 11500000, guid: 9530d6496ecf78d49a2c3a3de54b8a5e, type: 3}
scriptVersion: 2
compiledVersion: 2
behaviourSyncMode: 0
hasInteractEvent: 0
scriptID: 5364823960802954436
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: tester
- Name: $v
Entry: 7
Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: tester
- Name: <UserType>k__BackingField
Entry: 7
Data: 3|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UdonSharp.Tests.IntegrationTestSuite, UdonSharp.Tests
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 7
Data: 4|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: VRC.Udon.UdonBehaviour, VRC.Udon
- Name:
Entry: 8
Data:
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- 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:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 39642a2265551724384ce81ded1cf524
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,65 @@
using UdonSharp;
using UnityEngine;
using UnityEngine.UI;
using VRC.SDKBase;
using VRC.Udon;
namespace UdonSharp.Tests
{
/// <summary>
/// Tests issues where struct mutators don't apply their changes to the heap variable, these include Fields (fixed), Properties, and Methods
/// </summary>
[AddComponentMenu("Udon Sharp/Tests/StructMutatorTest")]
public class StructMutatorTest : UdonSharpBehaviour
{
[System.NonSerialized]
public IntegrationTestSuite tester;
public void ExecuteTests()
{
TestFieldSet();
TestRayPropertySet();
TestColorBlockSet();
TestMethodSet();
}
// https://vrchat.canny.io/vrchat-udon-closed-alpha-bugs/p/vector3set-xyz-not-functioning
// This has been fixed for a while
void TestFieldSet()
{
Vector3 vector = new Vector3(1, 2, 3);
vector.y = 4f;
tester.TestAssertion("Vector3 Field Set", vector == new Vector3(1, 4, 3));
}
// https://vrchat.canny.io/vrchat-udon-closed-alpha-bugs/p/raysetorigin-and-raysetdirection-not-working
void TestRayPropertySet()
{
Ray ray = new Ray(Vector3.zero, Vector3.up);
ray.direction = Vector3.right;
tester.TestAssertion("Ray Property Set", ray.direction == Vector3.right);
}
// Another instance of property setters not working that was reported by someone.
void TestColorBlockSet()
{
ColorBlock test = new ColorBlock();
test.normalColor = Color.green;
tester.TestAssertion("Color Block Property Set", test.normalColor == Color.green);
}
// Related to https://vrchat.canny.io/vrchat-udon-closed-alpha-bugs/p/raysetorigin-and-raysetdirection-not-working, does not have a dedicated canny. Q ran into the issue so it's hopefully internally tracked.
void TestMethodSet()
{
Vector3 vector = new Vector3(1, 2, 3);
vector.Normalize();
tester.TestAssertion("Vector Method Set", Mathf.Approximately(vector.magnitude, 1f));
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 9530d6496ecf78d49a2c3a3de54b8a5e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: