//changed these so they are static fuctions and have MonoPInvokeCallback decorator so they work from iOS (uses AOT) private static void DebugDrawUnmanaged(IntPtr iaPtrThis, IntPtr debugDrawer) { //UnityEngine.Debug.Log("callback dd yes!"); ActionInterfaceWrapper ai = GCHandle.FromIntPtr(iaPtrThis).Target as ActionInterfaceWrapper; ai._actionInterface.DebugDraw(DebugDraw.GetManaged(debugDrawer)); }
//changed these so they are static fuctions and have MonoPInvokeCallback decorator so they work from iOS (uses AOT) private static void UpdateActionUnmanaged(IntPtr iaPtrThis, IntPtr collisionWorld, float deltaTimeStep) { //UnityEngine.Debug.Log("Callback yes!! " + iaPtrThis.ToInt64()); ActionInterfaceWrapper ai = GCHandle.FromIntPtr(iaPtrThis).Target as ActionInterfaceWrapper; ai._actionInterface.UpdateAction(ai._world, deltaTimeStep); }
public void AddAction(IAction action) { if (_actions == null) { _actions = new Dictionary<IAction, ActionInterfaceWrapper>(); } else if (_actions.ContainsKey(action)) { return; } ActionInterfaceWrapper wrapper = new ActionInterfaceWrapper(action, this); _actions.Add(action, wrapper); btDynamicsWorld_addAction(_native, wrapper._native); }
public void AddAction(IAction action) { if (_actions == null) { _actions = new Dictionary <IAction, ActionInterfaceWrapper>(); } else if (!_actions.ContainsKey(action)) { return; } ActionInterfaceWrapper wrapper = new ActionInterfaceWrapper(action, this); _actions.Add(action, wrapper); btDynamicsWorld_addAction(_native, wrapper._native); }
public void RemoveAction(IAction action) { if (_actions == null) { // No actions have been added return; } if (!_actions.ContainsKey(action)) { return; } ActionInterfaceWrapper wrapper = _actions[action]; btDynamicsWorld_removeAction(_native, wrapper._native); _actions.Remove(action); wrapper.Dispose(); }