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

@@ -11,7 +11,8 @@
"GUID:d525ad6bd40672747bde77962f1c401e",
"GUID:49b49c76ee64f6b41bf28ef951cb0e50",
"GUID:517785bb4600a5140b47eac5fa49b8fc",
"GUID:be17a8778dbfe454890ed8279279e153"
"GUID:be17a8778dbfe454890ed8279279e153",
"GUID:d8b63aba1907145bea998dd612889d6b"
],
"includePlatforms": [],
"excludePlatforms": [],

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)