platformer
Setup

Project/Scene setup

Project can be setup using Configuration It's a Singleton MonoBehaviour that you must attach to every scene. Also attach UpdateManager and your scene is ready.

We really recommend to create a prefab with UpdateManager & Configuration.

Configuration

Each scene can have different configuration, be vary careful when loading a scene into because cannot use Additive.

Configure:

UpdateManager

unity-platformer has it's own update loop. UpdateManager it the loop owner, use FixedUpdate but none other class will.

If you want something to be updated by UpdateManager implement: IUpdateEntity Basically has two methods: PlatformerUpdate(float delta) and LatePlatformerUpdate(float delta) Also implements OnEnable to attach the class to the UpdateManager And implements OnDisable to detach

Why?

Real Physics vs Fake Manual/Physics

We develop our custom manual collision, but it's proven to not be 100% reliable.

Problems raise when something is moving in your world and it's not a MovingPlatform, or it's rotating. This kind of collision can penetrate into Characters colliders and destroy the simulation.

To solve this there is two aproachs:

So in the end we will have a mixed physics.

No graphics

There is no graphic here, just game-logic.

unity-platformer prioritize Configuration & UpdateManager to be executed first, as they are Singletons, many classes rely on them being initialized before.

unity-platformer require UnityTestTools or remove the Assets/Test folder.

The rest of libraries are optional. And handled with a macros

Tagging

Tags are configured at Configuration component.

Tags can be mixed to create hybrid behaviours: like moving platforms that are one way platforms.

This is achieved having a tag that contains both names. ex: MovingPlatform&OneWayPlatforms, & is not mandatory I use it for readability purposes.

prefabs

To include prefabs in the scene use InstancePrefab. It's not mandatory, but it will save space in your .scene and you will be sure that there is no change in the prefab.

InstancePrefab can be extended like what we do with PlayerStart to setup the camera.

Also useful for testing like: TestInputPatrolJumping, TestInputPatrolLadder etc.