|
2D Platform Controller
v1.7.0
Autogenerated code documentation for the 2D Platform Controller.
|
| Character controller animation event delegate. | |
| Climb details. | |
| Crouch details. Control what happens when you press down. | |
| Interface used to determine that an object is an enemy. | |
| An enemy AI which tries to follow the player. Its built using the hack until it works philosophy of AI design, so the code might be a little hard to follow. Currently it doesn't cater for sense distance nor do path finding. Specifically it doesn't plan a route to a player it just tries to get on to higher platforms if the player is higher and lower platforms if the player is lower | |
| This enemy uses only the MoveInX and MoveInY methods of the character controller. It behaves much like Super Mario enemies in that it walks in a given direction unless it runs in to something in which case it turns around | |
| Jump details. Note that jumps are also affected by the Physics.gravity setting. | |
| Ledge details. Control what happens when you hang off a ledge. | |
| Logs the animation state to the console. | |
| A simple collectable item, it plays a particle effect when collected and invokes the Collect method on the HitBox class. Requries a HitBox on the character :) | |
| This script handles characters that don't have symmetrical colliders by flipping the colliders based on the direction the character it facing. It is important that you use the same method of checking direciton here that you use in your animator | |
| Add this to a character to enable the character to take fall damage. | |
| Make the character float gently downwards instead of falling if they hold jump. COuld be changed to use any key (i.e. Input.GetKeyDown() or to not reuqire a key at all (for example as a special ability that is turned on or off by the presence or absence of an item). | |
| A hit box takes damage and passes it to a health component for processing. This allows you to easily move the damage points or alternatively attach them to transforms | |
| Attach a trigger for the head of the enemy and then add this script to it to kill the enemy when you jump on him. | |
| The main control class for a ladder. Put this at the root of your ladder. Can also be used for vine like climbable or extended for other climbable behaviour. | |
| Base class for all paltforms. | |
| A platform that moves left and right. Note that it returns true for parent on stand. | |
| A simple mario like brick, showing how you can respond to hitting something with characters head. | |
| Platform that will fall if you stand on it for more than the decay time. The timer resets each time to you leave the paltform so if you keep jumping you can stay on the platform. | |
| Platform that falls after you touch it. The fall is delayed by the value of fallDelay. | |
| Respawn the player when they touch this. Its a pretty simple implementation. In a real game you probably wont to invoke a death method which does all the things required for death (lives, scores, effects, sounds, etc) | |
| Base class for ladder colliders. Extend this to create your own ladder functions. | |
| Ladder collider. Attach this to every collider used in a ladder. This is like a rung of the ladder. | |
| Top step platform, this script should be attached to the top step of a ladder. | |
| Respawn point, platform implementation. | |
| Base class for rope colliders. Extend this to create your own rope functions. | |
| Rope platform. Attach this to every collider used in a rope. Note that rope colliders must be the child of a rigidbody. | |
| A platform that adds horizontal velocity to the character. For example a convery belt. | |
| A platform which reduces drag, making the character slide around (i.e ice). Could also be used to increase drag (sticky mud or long grass). | |
| Very simple bouncy springboard platform. Boucnes a character with a fix force each time they stand on it. | |
| A simple mario like brick, showing how you can respond to hitting something with characters head. This brick wont break but will instead "bobble" when you hit it. It can optionally spawn an object like a coin | |
| A platform that moves up and down. Note that it returns true for parent on stand. | |
| A very simple projectile that moves across the screen and triggers the damage method on a HitBox if it collides with one. | |
| Raycast character controller a controller for 2D platform games. | |
| This enemy uses only the MoveInX and MoveInY methods of the character controller. It behaves much like Super Mario enemies in that it walks in a given direction unless it runs in to something in which case it turns around | |
| Abstract class for character input, extend this to provide your own input. | |
| An enemy AI which tries to follow the player. Its built using the hack until it works philosophy of AI design, so the code might be a little hard to follow. Currently it doesn't cater for sense distance nor do path finding. Specifically it doesn't plan a route to a player it just tries to get on to higher platforms if the player is higher and lower platforms if the player is lower | |
| This is the 'AI' for the bounce and fall controller. Basically it bounces off things. It also has a sense distance and the enemy wont activate until within this distance. | |
| A simple character input. Arrows to move, left SHIFT to run, SPACE to jump. | |
| A simple mobile input controller which uses the Unity Standard Assets (Mobile) Joystick. | |
| A touch input for the 2D Platform controller | |
| Set gravity to a higher value as it looks and feel better. Make sure the ingore raycasts layer doesn't collide with any of the character layers the defaul layer or itself | |
| Extremely simple "gun". Purely here to demonstrate the hit box/damge features. | |
| This is a simple script for tracking characters health. It provides a Damage method and a | |
| A very simple health bar UI. You could extend to create your own health bar if you wnt to easily integrate with the other sample scripts. | |
| Movement details. | |
| Raycast collider. The main collision object. | |
| Slope details. | |
| Wall details. Controls wall jump and wall slide. |