浏览代码

Count is now lowercase on AssetSources

/generic-asset-sources
sleal-unity 4 年前
当前提交
b61e315b
共有 3 个文件被更改,包括 8 次插入8 次删除
  1. 12
      com.unity.perception/Runtime/Randomization/Randomizers/AssetSources/AssetSource.cs
  2. 2
      com.unity.perception/Runtime/Randomization/Randomizers/AssetSources/AssetSourceLocation.cs
  3. 2
      com.unity.perception/Runtime/Randomization/Randomizers/AssetSources/LocalAssetSourceLocation.cs

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


/// <summary>
/// The number of assets available within this asset source
/// </summary>
public int Count => assetSourceLocation.Count;
public int count => assetSourceLocation.count;
/// <summary>
/// Execute setup steps for this AssetSource. It is often unnecessary to call this API directly since all other

public T LoadRawAsset(int index)
{
CheckIfInitialized();
if (Count == 0)
if (count == 0)
return null;
return assetSourceLocation.LoadAsset<T>(index);
}

public T[] LoadAllRawAssets()
{
CheckIfInitialized();
var array = new T[Count];
for (var i = 0; i < Count; i++)
var array = new T[count];
for (var i = 0; i < count; i++)
array[i] = LoadRawAsset(i);
return array;
}

public T[] CreateProcessedInstances()
{
CheckIfInitialized();
var array = new T[Count];
for (var i = 0; i < Count; i++)
var array = new T[count];
for (var i = 0; i < count; i++)
array[i] = CreateProcessedInstance(i);
return array;
}

2
com.unity.perception/Runtime/Randomization/Randomizers/AssetSources/AssetSourceLocation.cs


/// <summary>
/// The number of assets available at this location
/// </summary>
public abstract int Count { get; }
public abstract int count { get; }
/// <summary>
/// Execute setup steps before accessing assets at this location

2
com.unity.perception/Runtime/Randomization/Randomizers/AssetSources/LocalAssetSourceLocation.cs


[SerializeField] public List<Object> assets;
/// <inheritdoc/>
public override int Count => assets.Count;
public override int count => assets.Count;
/// <inheritdoc/>
public override void Initialize<T>(Archetype<T> archetype) { }

正在加载...
取消
保存