2D Platform Controller  v1.7.0
Autogenerated code documentation for the 2D Platform Controller.
 All Classes Functions Variables Properties
UnBreakableBrick Class Reference

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. More...

Inherits Platform.

Public Member Functions

override void DoAction (RaycastCollider collider, RaycastCharacterController character)
 This is called when a platform is hit. Override to implement platform behaviour. More...
 
- Public Member Functions inherited from Platform
virtual Transform ParentOnStand (RaycastCharacterController character)
 Does this platform want to have this platform become the characters parent. Used for moving platforms. More...
 
virtual CharacterState GetAnimationState (RaycastCharacterController character)
 Gets the animation for the character. Only called if you have set overrideAnimation to true. More...
 

Public Attributes

GameObject spawnGameObject
 The object activated on hit. More...
 
Vector3 spawnForce
 If the object is a rigidbody we will add some force to the object to add a little juice. More...
 
float spawnActivateTime = 0.5f
 How long after spawning should we wait before turning on physics. This delay gives object a chance to ensure its outside of the boundaries of the brick. More...
 
Material hitMaterial
 Change the material to this after hit so we know the object has spawned. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Platform
virtual void DoStart ()
 Override and add custom initialisation here. More...
 
virtual void Move ()
 Override with custom move code. More...
 
virtual void DoUpdate ()
 Override with custom update code here. More...
 
- Properties inherited from Platform
Vector3 velocity [get, set]
 
Transform myTransform [get, set]
 
virtual bool overrideX [get]
 If you override and return true for this, your platform will stop the character moving in the x direction. Instead you will need to the move the character from your platform code. See the ropes classes as an example. More...
 
virtual bool overrideY [get]
 If you override and return true for this, your platform will stop the character moving in the y direction. Instead you will need to the move the character from your platform code. See the ropes classes as an example. More...
 
virtual bool overrideAnimation [get]
 If you override and return true for this, your platform will stop the character moving in the x direction. instead you will need to the move character. See the ropes classes as an example. More...
 

Detailed Description

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.

When an enemy stands on the platform and it is hit from below the enemy will be killed.

Member Function Documentation

override void UnBreakableBrick.DoAction ( RaycastCollider  collider,
RaycastCharacterController  character 
)
virtual

This is called when a platform is hit. Override to implement platform behaviour.

Parameters
colliderThe collider that did the hitting.
characterThe character that did the hitting.

Reimplemented from Platform.

Member Data Documentation

Material UnBreakableBrick.hitMaterial

Change the material to this after hit so we know the object has spawned.

float UnBreakableBrick.spawnActivateTime = 0.5f

How long after spawning should we wait before turning on physics. This delay gives object a chance to ensure its outside of the boundaries of the brick.

Vector3 UnBreakableBrick.spawnForce

If the object is a rigidbody we will add some force to the object to add a little juice.

GameObject UnBreakableBrick.spawnGameObject

The object activated on hit.


The documentation for this class was generated from the following file: