Skip to content

Instantly share code, notes, and snippets.

View thefuntastic's full-sized avatar

Peter Cardwell-Gardner thefuntastic

View GitHub Profile
@thefuntastic
thefuntastic / gist:5b57c0ab540d6738f3ee2e518dd46652
Last active January 19, 2020 21:56
LibPDIntergration iOS static library build instructions
# LibPd Binaries
LibPDIntegration relies on 64bit multi-user Libpd (https://github.com/libpd/libpd), which we now have to build ourselves. For an inexperienced user this can be black magic! It is also confusing because the libpd notes on iOS (https://github.com/libpd/pd-for-ios) tend to point towards using a wrapper for a native AU (Audio Unit) plugin. However as we're using Unity's native sound layer we don't need to worry about this.
It is also possible to embed a xcode project as a subproject of parent xcode Project. Eg the libpd xcode project would live under the Unity xcode project. The advantage of this scheme is that you will always build a valid libpd version for your Unity Project. However this is less portable as the Unity xcode project gets regenerated and one would have to set it up again each time.
Instead we choose to build a static library `*.a` file which is a native iOS plugin (aka a `*.dll`) and can be embedded inside Unity. (As `libpd/libpd.xcodeproj` already exists the following is onl
@thefuntastic
thefuntastic / StateEngine.cs
Created February 9, 2016 10:10
Modifications to State Engine in order to enable OnCollisionEnter State calls
//Line ~138
//Bind the State Methods
case "OnCollisionEnter":
targetState.OnCollisionEnter = CreateDelegate<Action<Collision>>(methods[i], entity);
break;
//Line ~308
//Make sure state engine recieves collision events.
void OnCollisionEnter(Collision collision)
{