sleal-unity
4 年前
当前提交
afb1a5f9
共有 20 个文件被更改,包括 186 次插入 和 120 次删除
-
4com.unity.perception/Editor/Randomization/Utilities/StaticData.cs
-
6com.unity.perception/Editor/Randomization/Uxml/AssetSource/AssetSourceElement.uxml
-
50com.unity.perception/Editor/Randomization/VisualElements/AssetSource/AssetSourceElement.cs
-
41com.unity.perception/Runtime/Randomization/Randomizers/AssetSources/AssetSource.cs
-
4com.unity.perception/Runtime/Randomization/Randomizers/AssetSources/AssetSourceLocation.cs
-
2com.unity.perception/Runtime/Randomization/Randomizers/AssetSources/LocalAssetSourceLocation.cs
-
38com.unity.perception/Runtime/Randomization/Scenarios/Serialization/ScenarioSerializer.cs
-
1com.unity.perception/Tests/Runtime/Randomization/ScenarioTests/Resources/SampleScenarioConfiguration.json
-
16com.unity.perception/Runtime/Randomization/Randomizers/AssetSources/AssetRole.cs
-
11com.unity.perception/Runtime/Randomization/Randomizers/AssetSources/AssetRole.cs.meta
-
15com.unity.perception/Runtime/Randomization/Randomizers/AssetSources/AssetRoleBase.cs
-
11com.unity.perception/Runtime/Randomization/Randomizers/AssetSources/AssetRoleBase.cs.meta
-
8com.unity.perception/Tests/Runtime/Randomization/AssetSourceTests.meta
-
51com.unity.perception/Tests/Runtime/Randomization/AssetSourceTests/LocalAssetSourceTests.cs
-
11com.unity.perception/Tests/Runtime/Randomization/AssetSourceTests/LocalAssetSourceTests.cs.meta
-
16com.unity.perception/Runtime/Randomization/Randomizers/AssetSources/Archetype.cs
-
3com.unity.perception/Runtime/Randomization/Randomizers/AssetSources/Archetype.cs.meta
-
15com.unity.perception/Runtime/Randomization/Randomizers/AssetSources/ArchetypeBase.cs
-
3com.unity.perception/Runtime/Randomization/Randomizers/AssetSources/ArchetypeBase.cs.meta
|
|||
namespace UnityEngine.Perception.Randomization |
|||
{ |
|||
/// <summary>
|
|||
/// Derive this class to create a typed asset role.
|
|||
/// Typed asset roles are used to apply preprocessing steps to assets loaded from an <see cref="AssetSource{T}"/>.
|
|||
/// </summary>
|
|||
/// <typeparam name="T">The type of asset to preprocess</typeparam>
|
|||
public abstract class AssetRole<T> : AssetRoleBase where T : Object |
|||
{ |
|||
/// <summary>
|
|||
/// Perform preprocessing operations on an asset loaded from an <see cref="AssetSource{T}"/>.
|
|||
/// </summary>
|
|||
/// <param name="asset">The asset to preprocess</param>
|
|||
public abstract void Preprocess(T asset); |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 3fce529b432e45f45bee917a2c4205b6 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using UnityEngine; |
|||
|
|||
namespace UnityEngine.Perception.Randomization |
|||
{ |
|||
/// <summary>
|
|||
/// The base asset role class. Derive from <see cref="AssetRole{T}"/> instead to create a new asset role.
|
|||
/// </summary>
|
|||
public abstract class AssetRoleBase |
|||
{ |
|||
/// <summary>
|
|||
/// The string label uniquely associated with this asset role
|
|||
/// </summary>
|
|||
public abstract string label { get; } |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 1af66eeef6ffa514a8307a228b8e85f9 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: ea8713402c0e1a946ac6af555b908641 |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using NUnit.Framework; |
|||
using UnityEngine; |
|||
using UnityEngine.Perception.Randomization; |
|||
|
|||
namespace RandomizationTests.AssetSourceTests |
|||
{ |
|||
[TestFixture] |
|||
public class LocalAssetSourceTests |
|||
{ |
|||
GameObject m_TestObject; |
|||
TestBehaviour m_Behaviour; |
|||
|
|||
class TestAssetRole : AssetRole<GameObject> |
|||
{ |
|||
public override string label => "test"; |
|||
|
|||
public override void Preprocess(GameObject asset) |
|||
{ |
|||
throw new System.NotImplementedException(); |
|||
} |
|||
} |
|||
|
|||
class TestBehaviour : MonoBehaviour |
|||
{ |
|||
public AssetSource<GameObject> gameObjectSource = new AssetSource<GameObject> |
|||
{ |
|||
assetRole = null, |
|||
assetSourceLocation = new LocalAssetSourceLocation() |
|||
}; |
|||
|
|||
public AssetSource<Material> materialSource = new AssetSource<Material> |
|||
{ |
|||
assetRole = null, |
|||
assetSourceLocation = new LocalAssetSourceLocation() |
|||
}; |
|||
} |
|||
|
|||
[SetUp] |
|||
public void Setup() |
|||
{ |
|||
m_TestObject = new GameObject(); |
|||
m_Behaviour = m_TestObject.AddComponent<TestBehaviour>(); |
|||
} |
|||
|
|||
[TearDown] |
|||
public void TearDown() |
|||
{ |
|||
Object.DestroyImmediate(m_TestObject); |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: c7b5bdabb856bb5469fd4033fb6bda01 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
namespace UnityEngine.Perception.Randomization |
|||
{ |
|||
/// <summary>
|
|||
/// Derive this class to create a typed Archetype.
|
|||
/// Typed Archetypes are used to apply preprocessing steps to assets loaded from an <see cref="AssetSource{T}"/>.
|
|||
/// </summary>
|
|||
/// <typeparam name="T">The type of asset to preprocess</typeparam>
|
|||
public abstract class Archetype<T> : ArchetypeBase where T : Object |
|||
{ |
|||
/// <summary>
|
|||
/// Perform preprocessing operations on an asset loaded from an <see cref="AssetSource{T}"/>.
|
|||
/// </summary>
|
|||
/// <param name="asset">The asset to preprocess</param>
|
|||
public abstract void Preprocess(T asset); |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: ffdc828eccff45728455a572d1f2b0e3 |
|||
timeCreated: 1618978426 |
|
|||
using UnityEngine; |
|||
|
|||
namespace UnityEngine.Perception.Randomization |
|||
{ |
|||
/// <summary>
|
|||
/// The base Archetype class. Derive from <see cref="AssetSource{T}"/> instead to create a new archetype.
|
|||
/// </summary>
|
|||
public abstract class ArchetypeBase |
|||
{ |
|||
/// <summary>
|
|||
/// The string label uniquely associated with this archetype
|
|||
/// </summary>
|
|||
public abstract string label { get; } |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 88c34672b8a649439c1fd55bc201acde |
|||
timeCreated: 1619731337 |
撰写
预览
正在加载...
取消
保存
Reference in new issue