mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
[+] 接入ET8服务端
[+] 接入ET8服务端
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using ET.Client;
|
||||
using TrueSync;
|
||||
|
||||
namespace ET
|
||||
{
|
||||
[EntitySystemOf(typeof(LSInputComponent))]
|
||||
[LSEntitySystemOf(typeof(LSInputComponent))]
|
||||
public static partial class LSInputComponentSystem
|
||||
{
|
||||
[EntitySystem]
|
||||
private static void Awake(this LSInputComponent self)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
[LSEntitySystem]
|
||||
private static void LSUpdate(this LSInputComponent self)
|
||||
{
|
||||
LSUnit unit = self.GetParent<LSUnit>();
|
||||
|
||||
TSVector2 v2 = self.LSInput.V * 6 * 50 / 1000;
|
||||
if (v2.LengthSquared() < 0.0001f)
|
||||
{
|
||||
return;
|
||||
}
|
||||
TSVector oldPos = unit.Position;
|
||||
unit.Position += new TSVector(v2.x, 0, v2.y);
|
||||
unit.Forward = unit.Position - oldPos;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user