Initial Commit
This commit is contained in:
commit
ee5c2f922d
2255 changed files with 547750 additions and 0 deletions
33
Assets/Scripts/Data/AssetReferenceData.cs
Normal file
33
Assets/Scripts/Data/AssetReferenceData.cs
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
using DefaultNamespace;
|
||||
using System;
|
||||
using Unity.Entities;
|
||||
using UnityEngine.ResourceManagement.AsyncOperations;
|
||||
[assembly: RegisterGenericComponentType(typeof(AssetReferenceData<ItemPrefab>))]
|
||||
|
||||
namespace DefaultNamespace
|
||||
{
|
||||
public struct AssetReferenceData<T> : ISharedComponentData, IEquatable<AssetReferenceData<T>> where T : class
|
||||
{
|
||||
public AsyncOperationWrapper<T> Operation;
|
||||
|
||||
public AssetReferenceData(AsyncOperationHandle<T> operation)
|
||||
{
|
||||
Operation = new AsyncOperationWrapper<T>(operation);
|
||||
}
|
||||
|
||||
public bool Equals(AssetReferenceData<T> other)
|
||||
{
|
||||
return Operation.Equals(other.Operation);
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
return obj is AssetReferenceData<T> other && Equals(other);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Operation.GetHashCode();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue