This commit is contained in:
CortexCore
2024-06-27 18:53:49 +08:00
parent 4a8c97d1fd
commit 21bbfe0617
5 changed files with 22 additions and 11 deletions

View File

@@ -9,6 +9,8 @@ using BITKit.Entities;
using Cysharp.Threading.Tasks;
using UnityEngine.Profiling;
using UnityEngine.UIElements;
using Random = UnityEngine.Random;
// ReSharper disable RedundantTypeArgumentsOfMethod
namespace BITKit.Entities
@@ -147,9 +149,9 @@ namespace BITKit.Entities
}
private void Awake()
{
if (Id.IsDefault())
Id = GetInstanceID();
CancellationToken = gameObject.GetCancellationTokenOnDestroy();
if (Id is 0)
Id = Guid.NewGuid().GetHashCode();
CancellationToken = destroyCancellationToken;
Set(CancellationToken);
if (useAwake)