mirror of
https://github.com/antopilo/Nuake.git
synced 2026-01-06 06:09:52 +03:00
Aadded GetLocalPosition and IsMouseButtonDown to .Net API
This commit is contained in:
@@ -52,6 +52,7 @@ namespace Nuake.Net
|
||||
public class TransformComponent : IComponent
|
||||
{
|
||||
internal static unsafe delegate*<int, NativeArray<float>> GetGlobalPositionIcall;
|
||||
internal static unsafe delegate*<int, NativeArray<float>> GetPositionIcall;
|
||||
internal static unsafe delegate*<int, float, float, float, void> SetPositionIcall;
|
||||
internal static unsafe delegate*<int, float, float, float, void> RotateIcall;
|
||||
|
||||
@@ -83,7 +84,14 @@ namespace Nuake.Net
|
||||
|
||||
public Vector3 LocalPosition
|
||||
{
|
||||
get { return new Vector3(); }
|
||||
get
|
||||
{
|
||||
unsafe
|
||||
{
|
||||
NativeArray<float> result = GetPositionIcall(EntityID);
|
||||
return new Vector3(result[0], result[1], result[2]);
|
||||
}
|
||||
}
|
||||
set
|
||||
{
|
||||
unsafe { SetPositionIcall(EntityID, value.X, value.Y, value.Z); }
|
||||
|
||||
@@ -132,13 +132,31 @@ namespace Nuake.Net
|
||||
MENU = 348,
|
||||
}
|
||||
|
||||
public enum MouseButton
|
||||
{
|
||||
BUTTON_LEFT = 0,
|
||||
BUTTON_RIGHT = 1,
|
||||
BUTTON_MIDDLE = 2,
|
||||
BUTTON_4 = 3,
|
||||
BUTTON_5 = 4,
|
||||
BUTTON_6 = 5,
|
||||
BUTTON_7 = 6,
|
||||
BUTTON_8 = 7,
|
||||
}
|
||||
|
||||
public class Input
|
||||
{
|
||||
internal static unsafe delegate*<bool, void> ShowMouseIcall;
|
||||
internal static unsafe delegate*<int, bool> IsKeyDownIcall;
|
||||
internal static unsafe delegate*<int, bool> IsKeyPressedIcall;
|
||||
internal static unsafe delegate*<int, bool> IsMouseButtonDownIcall;
|
||||
internal static unsafe delegate*<NativeArray<float>> GetMousePositionIcall;
|
||||
|
||||
public static bool IsMouseButtonDown(MouseButton button)
|
||||
{
|
||||
unsafe { return IsMouseButtonDownIcall((int)button); }
|
||||
}
|
||||
|
||||
public static void ShowMouse(bool visible)
|
||||
{
|
||||
unsafe { ShowMouseIcall(visible); }
|
||||
|
||||
Reference in New Issue
Block a user