浏览代码

Adding null checks to AssetSource.cs

/generic-asset-sources
Jon Hogins 4 年前
当前提交
6213ae21
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6
      com.unity.perception/Runtime/Randomization/Randomizers/AssetSources/AssetSource.cs

6
com.unity.perception/Runtime/Randomization/Randomizers/AssetSources/AssetSource.cs


public T SampleAsset()
{
CheckIfInitialized();
if (Count == 0)
return null;
return assetSourceLocation.LoadAsset<T>((int)(m_Sampler.Sample() * Count));
}

T CreateProcessedInstance(T asset)
{
if (asset == null)
return null;
var instance = Object.Instantiate(asset);
if (archetype != null)
archetype.Preprocess(instance);

正在加载...
取消
保存