Files
2026-07-09 21:33:33 +02:00

48 lines
1.3 KiB
C#

using System.Collections.Generic;
using System.Linq;
using NUnit.Framework;
using Sirenix.Utilities;
using UnityEditor;
using UnityEngine;
using VOID.Generic.Dict;
using VOID.Generic.Objects.Armor;
namespace Test.EditMode.Prefabs.Generic
{
public class BeltObjectTest
{
private List<GameObject> _gameObjects = new();
[OneTimeSetUp]
public void Setup()
{
AssetDatabase.FindAssets($"t:{nameof(GameObject)}").ForEach(gameObjectGuid =>
{
var gameObjectPath = AssetDatabase.GUIDToAssetPath(gameObjectGuid);
var gameObject = AssetDatabase.LoadAssetAtPath<GameObject>(gameObjectPath);
var beltObjects = gameObject.GetComponentsInChildren<ArmorObject>();
// Only belt for current testing
if (beltObjects.All(belt => belt.armorData.armorType != ArmorType.Belt)) return;
// If prefab have any ArmorObject - take it, we will test it
if (beltObjects.Length > 0) _gameObjects.Add(gameObject);
});
}
[OneTimeTearDown]
public void Cleanup()
{
_gameObjects?.Clear();
_gameObjects = null;
}
[Test]
public void NothingToTest()
{
}
}
}