static void OnEntitySync(uint entityid, byte command, ref VectorArr vec) { NativeEntity entity = NativeEntityMgr.singleton.Get(entityid); switch (command) { case ASCII.p: Vector3 pos = vec.ToVector(); pos.y = NativeScene.singleton.TerrainY(pos); entity.transfrom.position = pos; break; case ASCII.s: entity.transfrom.localScale = vec.ToVector(); break; case ASCII.r: entity.transfrom.rotation = Quaternion.Euler(vec.ToVector()); break; case ASCII.f: entity.transfrom.forward = vec.ToVector(); break; default: XDebug.LogError("not regist command ", command); break; } }
public void MoveForward(Vector3 forward) { VectorArr va = new VectorArr(forward); NativeInterface.iEntityMoveForward(UID, ref va); if (anim != null) { anim.SetTrigger(AnimTriger.ToMove); } }
public static extern void iGoInfo(string name, byte command, ref VectorArr vec);
public static extern void iEntityMoveForward(uint entityid, ref VectorArr vec);