This commit is contained in:
CortexCore
2023-11-06 01:17:23 +08:00
parent bd40165ade
commit 5446067f91
114 changed files with 2023 additions and 414 deletions

View File

@@ -14,14 +14,14 @@ namespace BITKit.Entities.Player
public static event Action<Entity> OnPlayerInitialized;
public static event Action<Entity> OnPlayerDisposed;
public static Entity LocalPlayer { get;private set; }
public static void Register(Entity entity)
public static void Register(Entity unityEntity)
{
OnPlayerInitialized?.Invoke(entity);
LocalPlayer = entity;
OnPlayerInitialized?.Invoke(unityEntity);
LocalPlayer = unityEntity;
}
public static void UnRegister(Entity entity)
public static void UnRegister(Entity unityEntity)
{
OnPlayerDisposed?.Invoke(entity);
OnPlayerDisposed?.Invoke(unityEntity);
LocalPlayer = null;
}
Entity IPlayerService.LocalPlayer=>LocalPlayer;
@@ -35,8 +35,8 @@ namespace BITKit.Entities.Player
add => OnPlayerDisposed += value;
remove => OnPlayerDisposed -= value;
}
void IPlayerService.Register(Entity entity)=>Register(entity);
void IPlayerService.UnRegister(Entity entity)=>UnRegister(entity);
void IPlayerService.Register(Entity unityEntity)=>Register(unityEntity);
void IPlayerService.UnRegister(Entity unityEntity)=>UnRegister(unityEntity);
}
}