Add VRChat and GitHub packages to Unity project
This commit is contained in:
1 parent
0334a52b21
commit
85538aaccc
3297 files changed
+847877
No files matched your search
@@ -0,0 +1,48 @@
|
||||
using System.Collections.Generic;
|
||||
using NUnit.Framework;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UINew = VRC.Udon.Editor.ProgramSources.UdonGraphProgram.UI.GraphView;
|
||||
using VRC.Udon.Editor.ProgramSources.UdonGraphProgram;
|
||||
using VRC.Udon.Graph;
|
||||
using VRC.Udon.Editor;
|
||||
|
||||
namespace Tests
|
||||
{
|
||||
public class UICompilerTests
|
||||
{
|
||||
[Test]
|
||||
public void CompareAssemblies()
|
||||
{
|
||||
// Cache Udon Graph View window for reuse
|
||||
var graphViewWindow = EditorWindow.GetWindow<UINew.UdonGraphWindow>();
|
||||
|
||||
// Loop through every asset in project
|
||||
var assets = AssetDatabase.FindAssets("t:UdonGraphProgramAsset");
|
||||
foreach (string guid in assets)
|
||||
{
|
||||
// Compile assembly from copy of existing asset
|
||||
string path = AssetDatabase.GUIDToAssetPath(guid);
|
||||
var legacyData = GetDataFromAssetAtPath(path);
|
||||
var legacyAssembly = UdonEditorManager.Instance.CompileGraph(legacyData, null, out Dictionary<string, (string uid, string fullName, int index)> _, out Dictionary<string, (object value, System.Type type)> heapDefaultValues);
|
||||
|
||||
// Compile assembly from copy of asset loaded into new graph
|
||||
var newAsset = ScriptableObject.CreateInstance<UdonGraphProgramAsset>();
|
||||
newAsset.graphData = new UdonGraphData(legacyData);
|
||||
// This function loads the asset and reserializes it
|
||||
var newData = graphViewWindow.GetGraphDataFromAsset(newAsset);
|
||||
var newAssembly = UdonEditorManager.Instance.CompileGraph(newData, null, out Dictionary<string, (string uid, string fullName, int index)> _, out Dictionary<string, (object value, System.Type type)> heapDefaultValues1);
|
||||
|
||||
Assert.AreEqual(newAssembly, legacyAssembly);
|
||||
}
|
||||
graphViewWindow.Close();
|
||||
}
|
||||
|
||||
public UdonGraphData GetDataFromAssetAtPath(string path)
|
||||
{
|
||||
var targetAsset = AssetDatabase.LoadAssetAtPath<UdonGraphProgramAsset>(path);
|
||||
return new UdonGraphData(targetAsset.graphData);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 02e7e7f5f9fc2c24ab3af0b8780f3623
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "UnityEditorTests",
|
||||
"references": [
|
||||
"VRC.Udon.Editor",
|
||||
"VRC.Udon",
|
||||
"VRC.Udon.Tests"
|
||||
],
|
||||
"optionalUnityReferences": [
|
||||
"TestAssemblies"
|
||||
],
|
||||
"includePlatforms": [
|
||||
"Editor"
|
||||
],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": []
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3c3c5a3876474c648a47177c1875f447
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in new issue
Block a user