public static void SetContainer(object obj) { if (obj != null) { var handle = GCHandle.Alloc(obj); NativeImported.RegThreadLocalContainer((IntPtr)handle, NativeImported.Func_DisposeObj); } }
private static void Init() { NativeImported.Init_CommonNativeEvents(); using (AndroidJavaClass jc = new AndroidJavaClass("cn.capstones.anative.android.commonnativeevents.CommonNativeEvents")) { jc.CallStatic("Init"); } }
public static Color GetColorAtScreenPos(Vector2 pos) { IntPtr dc = NativeImported.GetWindowDC(IntPtr.Zero); uint colorn = NativeImported.GetPixel(dc, (int)pos.x, (int)pos.y); byte a = 255; //(byte)((colorn & (0xFF << 24)) >> 24); byte b = (byte)((colorn & (0xFF << 16)) >> 16); byte g = (byte)((colorn & (0xFF << 8)) >> 8); byte r = (byte)(colorn & 0xFF); return(new Color32(r, g, b, a)); }
public static T GetContainer <T>() where T : class { var handle = NativeImported.GetThreadLocalContainer(); if (handle != IntPtr.Zero) { object obj = null; try { obj = ((GCHandle)handle).Target; } catch (Exception e) { PlatDependant.LogError(e); } return(obj as T); } return(null); }
public static ulong GetThreadID() { return((ulong)NativeImported.GetThreadID()); }
public static void TrigEventInUnityThread() { NativeImported.TrigDispatcherEvent(); }
private static void Init() { NativeImported.Init_CommonNativeEvents(); }