mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-06-26 19:34:47 +00:00
42 lines
1.2 KiB
C#
42 lines
1.2 KiB
C#
using JNGame.Math;
|
|
using JNGame.Sync.Frame.Service;
|
|
using JNGame.Sync.State.Tile;
|
|
using JNGame.Sync.State.Tile.Entity;
|
|
using JNGame.Sync.System.Data;
|
|
using NotImplementedException = System.NotImplementedException;
|
|
|
|
namespace Game.Logic.Entity
|
|
{
|
|
public abstract class EDEntityBasis : JNTileEntity
|
|
{
|
|
|
|
public JNRandomSystem Random => Context.GetSync().GetSystem<JNRandomSystem>();
|
|
|
|
//获取当前权限瓦块随机点
|
|
public LVector3 GetTileRandom()
|
|
{
|
|
|
|
if (Context.GetSync() is JNSSTileServerService tileServer)
|
|
{
|
|
return new LVector3(
|
|
Random.Float(tileServer.MinContains.x,tileServer.MaxContains.x),
|
|
LFloat.Zero,
|
|
Random.Float(tileServer.MinContains.y,tileServer.MaxContains.y)
|
|
);
|
|
}
|
|
return LVector3.Down;
|
|
}
|
|
|
|
public override void TileSyncData(ISTileData data)
|
|
{
|
|
Transform.Position = data.GetDataPosition();
|
|
}
|
|
|
|
public override void OnTileSlaveExit()
|
|
{
|
|
base.OnTileSlaveExit();
|
|
//从服务器 - 实体移出后立即删除
|
|
Destroy();
|
|
}
|
|
}
|
|
} |