NLDClient-yudde/ProjectNLD/Assets/Code/Scripts/Gameplay/Debug/SROptions.Test.cs

106 lines
2.8 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using Cysharp.Threading.Tasks;
using Framework;
using Framework.Wrapper;
using Gameplay;
using Gameplay.Area;
using Gameplay.Character;
using Gameplay.Level;
using Gameplay.SubSystems;
using PhxhSDK;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.ResourceManagement;
using CharacterInfo = Gameplay.Net.CharacterInfo;
using Constants = Framework.Constants;
using Object = UnityEngine.Object;
public partial class SROptions
{
private List<Material> _testMatList = new();
[Category("Test")]
public void TestMonoScriptReferenceStart()
{
var path =
"Assets/Art/AutoGen/PostProcessScenes/Assets_Scenes_CampScene/Combined/NLD_URP_NLD_Scene_Lambert/CombieMat.mat";
var mat = Addressables.LoadAssetAsync<Material>(path).WaitForCompletion();
_testMatList.Add(mat);
Debug.LogError($"test reference:{_testMatList[0].name}");
}
[Category("Test")]
public void TestMonoScriptReferenceEnd()
{
var path =
"Assets/Art/AutoGen/PostProcessScenes/Assets_Scenes_CampScene/Combined/NLD_URP_NLD_Scene_Lambert/CombieMat.mat";
Addressables.Release(_testMatList[0]);
Debug.LogError($"test reference:{_testMatList[0].name}");
}
private TestUnityObjectReference TestUnityObjectReference
{
get
{
var result = Object.FindObjectOfType<TestUnityObjectReference>();
if (result == null)
{
var go = new GameObject("test");
result = go.AddComponent<TestUnityObjectReference>();
}
return result;
}
}
[Category("Test")]
public void TestUnityObjectReferenceStart()
{
TestUnityObjectReference.Test();
}
[Category("Test")]
public void TestUnityObjectReferenceEnd()
{
TestUnityObjectReference.TestEnd();
}
[Category("Test")]
public void TestUnityObjectSerializableReferenceStart()
{
TestUnityObjectReference.TestSerializable();
}
[Category("Test")]
public void TestUnityObjectSerializableReferenceEnd()
{
TestUnityObjectReference.TestSerializableEnd();
}
[Category("Test")]
public void TestSingleUnityObjectReferenceStart()
{
TestUnityObjectReference.TestSingleStart();
}
[Category("Test")]
public void TestSingleUnityObjectReferenceEnd()
{
TestUnityObjectReference.TestSingleEnd();
}
[Category("Test")]
public void TestSingleSerializableUnityObjectReferenceStart()
{
TestUnityObjectReference.TestSingleSerializableStart();
}
[Category("Test")]
public void TestSingleSerializableUnityObjectReferenceEnd()
{
TestUnityObjectReference.TestSingleSerializableEnd();
}
}