Welcome to Game Booster Docs
Game Booster is a set of scripts to help you create your game in Unity. It has a lot of daily common logic to accelerate your development. There is components to deal with movement, instantiation, destruction, input, score, and lot more.
The main principle of Game Booster is reusability. To achieve this, each component do simple things, and can be connected with others components, including your own scripts, to achieve more complex behaviours. Many scripts has UnityEvent fields, which allows you to connect some event with other object in your scene.
Game Booster is made mainly to programmers, to reduce the amount of repetitive code created. So, it’s a good practice to create scripts that controls, or are controled by, other Game Booster’s components.
The components are splitted in several categories: Basics, Movement, Physics, Collision Detection, Input, Time, Vars, Score, Mechanics and Audio.
Developer contact: raphaelmarquesapps@gmail.com
Component list:
- Basics components
- Input components
- Movement components
- Physics components
- Collision Detection components
- Time components
- Vars components
- Score components
- Mechanics components
- Audio components
Basics components
Basics components deal with fundamental logic in Game Booster
BehaviourEvents
Creates events for each MonoBehaviour events like Awake, Start, Update, OnEnable, etc. This component helps you to put simple logic in some MonoBehaviour event without creating a new script to it.
Fields:
Enum eventType
: Enum of each event will be receivedUnityEvent actions
: Events that will be called when the event set in EventType happens
Creator
Creates instance of prefabs. Randomically choose one prefab from the list to be instantiated at some spawn point.
Fields:
List<GameObject> prefabs
: Prefabs to be instantiated (random choosen).bool useRotation
: Use spawn point rotation as rotation of the instantiated objectbool insideHierarchy
: Place the instantiated object inside other object’s hierarchyTransform parent
: Object to put the instantiated objects
bool useSpawnPoints
: Use other spawn points instead of this objectList<Transform> spawnPoints
: Spawn points where the prefab will be instantiated (random choosen)
bool autoCreate
: Automatically instantiatefloat startTime
: Time to start prefab instantiationfloat repeatTime
: Time between instantiations
Methods:
void Create()
: Instantiate a prefab using the options set
Destroyer
This component has a few ways to destroy the object it is attached to.
Fields:
float selfDestructionTime
: Time to self destruction. Set 0(zero) to disable.float timeToDestroy
: Time to destroy when ‘DestroyThis’ method is calledGameObject explosionPrefab
: Prefab to replace the destroyed object
Methods:
void DestroyThis()
: destroy this object including all options setvoid DestroyThisNow()
: destroy this object ignoring timeToDestroy optionvoid DestroyThisWithoutExplosion()
: destroy this object ignoring explosionvoid JustDestroyThis()
: destroy this object ignoring all options
ObjectSelector
Selects one object of a list, activating it, and deactivating the others of the list. Can be used to switch between weapons, costumes, screens, etc.
Fields:
GameObject startSelected
: Selected object at startbool autoSelectOnEnable
: Select the ‘startSelected’ object on OnEnable event occoursList\<GameObject\> objects
: Selectable objects
Methods:
void SelectFirst()
: selects the first object of the listvoid SelectNext()
: selects the next object of the list, after the current selectedvoid SelectPrevious()
: selects the previous object of the list, before the current selectedvoid SelectNone()
: deselects all objects (deactivating all)void Select(GameObject obj)
: selects the object passed as parametervoid Select(string name)
: selects the object of the list with the name passed as parametervoid Select(int index)
: selects the object of the list at the position passed as parameter
SceneMethods
Gives access to static methods relative to the scene. This component don’t add features, just gives access point to static methods and properties to be called via events by other components.
Methods:
void LoadScene(string sceneName)
: load another scenevoid ReloadCurrentScene()
: reload current scenevoid ApplicationQuit()
: quit applicationvoid Pause()
: set Time.timeScale = 0void Resume()
: set Time.timeScale = 1
TransformMethods
Methods and properties to set only one axis of position/scale/rotation and copy position/scale/rotation from other transform.
Properties:
float positionX
: set position.x valuefloat positionY
: set position.y valuefloat positionZ
: set position.z valuefloat localPositionX
: set localPosition.x valuefloat localPositionY
: set localPosition.y valuefloat localPositionZ
: set localPosition.z valueVector2 positionXY
: set position.x and position.y valuesVector2 localPositionXY
: set localPosition.x and localPosition.y valuesfloat localScaleX
: set localScale.x valuefloat localScaleY
: set localScale.y valuefloat localScaleZ
: set localScale.z valuefloat eulerAnglesX
: set eulerAngles.x valuefloat eulerAnglesY
: set eulerAngles.y valuefloat eulerAnglesZ
: set eulerAngles.z valuefloat localEulerAnglesX
: set localEulerAngles.x valuefloat localEulerAnglesY
: set localEulerAngles.y valuefloat localEulerAnglesZ
: set localEulerAngles.z value
Methods:
void SetPositionFrom(Transform target)
: copy position from target transformvoid SetLocalPositionFrom(Transform target)
: copy localPosition from target transformvoid SetRotationFrom(Transform target)
: copy rotation from target transformvoid SetLocalRotationFrom(Transform target)
: copy localRotation from target transformvoid SetLocalScaleFrom(Transform target)
: copy localScale from target transform
Input components
Components to get player’s input.
AxisInput
Gets axis input value.
Fields:
string axisName
: Axis name (ex: “Horizontal”, “Vertical” )bool raw
: Get input raw valuefloat multiplier
: Axis will be multiplied by this valueUnityEvent<float> actions
: event called at each frame passing axis value
KeyInput
Gets key input events.
Fields:
EventType eventType
: Type of key eventKeyCode key
: Key codeUnityEvent<bool> actions
: event called when the key event happens
EventType
enum values:
Pressed
: event is called when the key is pressedReleased
: event is called when the key is releasedRepeat
: event is called each update
MousePositionInput
Gets mouse position.
Fields:
PositionType positionType
: Mouse position coordinate.UnityEvent<Vector2> actions
: events called each update passing the mouse position
PositionType
enum values:
World2D
: mouse position in the world coordinates using a orthographic cameraScreen
: absolute mouse position in the screenViewport
: mouse position relative to screen from (0,0) at botton left to (1,1) at top rightCenteredViewport
: mouse position relative to screen with (0,0) at screen center
Movement components
Components to control object’s movement.
AngularVelocity2D
Controls the Rigidbody2D/Transform angular velocity.
Fields:
float velocity
:ControlType controlType
:
Methods:
void ApplyVelocity()
: apply the velocity to the Rigidbody2D/Transform
ControlType
enum values:
Continuous
: angular velocity is continuous setOnStart
: angular velocity is set onStart
eventOnEnable
: angular velocity is set onOnEnable
eventManual
: angular velocity is set when the methodApplyVelocity()
is called
AngularVelocity3D
Controls the Rigidbody3D/Transform angular velocity.
Fields:
Vector3 angularVelocity
: Current angular velocityfloat angularVelocityX
: Current x angular velocityfloat angularVelocityY
: Current y angular velocityfloat angularVelocityZ
: Current z angular velocityControlType controlType
: How the angular velocity is controled
Methods:
void ApplyVelocity()
: apply the velocity to the Rigidbody3D/Transform
ControlType
enum values:
Continuous
: angular velocity is continuous setOnStart
: angular velocity is set onStart
eventOnEnable
: angular velocity is set onOnEnable
eventManual
: angular velocity is set when the methodApplyVelocity()
is called
FollowScreenPosition2D
Follows a position relative to screen.
Fields:
ControlType controlType
: How the position is controledVector2 viewportAnchor
: Screen viewport anchor (from 0.0 to 1.0)Vector2 offset
: Position offset in world coordinates
Methods:
void ApplyPosition()
: apply the position relative to screen
ControlType
enum values:
Continous
: Apply position every frameOnStart
: Apply position onStart
eventOnEnable
: Apply position onOnEnable
eventManual
: Apply position when the methodApplyPosition()
is called
FollowTarget2D
Follows a target position.
Fields:
Transform target
: Target that will be followedVector2 offset
: Position offset from targetfloat speed
: Speed at which the object will move to target. Set 0(zero) to infinity speed.Axis axis
: Axis affected by target position
Axis
enum values:
XY
: affects x and y axisX
: affects x axisY
: affects y axis
FollowTarget3D
Follow a target position.
Fields:
Transform target
: Target that will be followedVector3 offset
: Position offset from targetfloat speed
: Speed at which the object will move to target. Set 0(zero) to infinity speed.Axis axis
: Axis affected by target position
Axis
enum values :
XYZ
: affects x, y and x axisXY
: affects x and y axisXZ
: affects x and z axisYZ
: affects y and z axisX
: affects x axisY
: affects y axisZ
: affects z axis
LookToTarget2D
Makes the object look (rotate) to some target.
Fields:
Transform target
: Target the object will look to.float speed
: Angular speed at which the object will rotate. Set 0(zero) to infinity speed.float angleOffset
: Angle offset to fix object rotation
Velocity2D
Controls Rigidbody2D/Transform velocity.
Fields:
Vector2 velocity
: Current velocityfloat velocityX
: Current x velocityfloat velocityY
: Current y velocitybool local
: Use object local orientationControlType controlType
: How the velocity is controlledAxis axis
: Axis affected
Methods:
void ApplyVelocity()
: Applies current velocity
ControlType
enum values:
Continous
: Apply velocity every frameOnStart
: Apply velocity onStart
eventOnEnable
: Apply velocity onOnEnable
eventManual
: Apply velocity when the methodApplyVelocity()
is called
Axis
enum values:
XY
: affects x and y axisX
: affects x axisY
: affects y axis
Velocity3D
Controls Rigidbody3D/Transform velocity.
Fields:
Vector3 velocity
: Current velocityfloat velocityX
: Current x velocityfloat velocityY
: Current y velocityfloat velocityZ
: Current z velocitybool local
: Use object local orientationControlType controlType
: How the velocity is controlledAxis axis
: Axis affected
Methods:
void ApplyVelocity()
: Applies current velocity
ControlType
enum values:
Continous
: Apply velocity every frameOnStart
: Apply velocity onStart
eventOnEnable
: Apply velocity onOnEnable
eventManual
: Apply velocity when the methodApplyVelocity()
is called
Axis
enum values :
XYZ
: affects x, y and x axisXY
: affects x and y axisXZ
: affects x and z axisYZ
: affects y and z axisX
: affects x axisY
: affects y axisZ
: affects z axis
Physics components
Components to control some physics properties.
Rigidbody2DMethods
Extra methods to control Rigidbody2D.
Fields:
float velocityX
: set x velocityfloat velocityY
: set y velocity
Methods:
void InvertVelocity()
: inverts rigidbody velocity (velocity = -velocity)void InvertVelocityX()
: inverts rigidbody x velocity (velocity.x = -velocity.x)void InvertVelocityY()
: inverts rigidbody y velocity (velocity.y = -velocity.y)void InvertAngularVelocity()
: inverts rigidbody angular velocity (angularVelocity = -angularVelocity)void NormalizeVelocity(float speed)
: normalizes rigidbody velocity (velocity = velocity.normalized * speed
RigidbodyMethods
Extra methods to control Rigidbody.
Fields:
float velocityX
: set x velocityfloat velocityY
: set y velocityfloat velocityZ
: set z velocityfloat angularVelocityX
: set x angular velocityfloat angularVelocityY
: set y angular velocityfloat angularVelocityZ
: set z angular velocity
Methods:
void InvertVelocity()
: inverts rigidbody velocity (velocity = -velocity)void InvertVelocityX()
: inverts rigidbody x velocity (velocity.x = -velocity.x)void InvertVelocityY()
: inverts rigidbody y velocity (velocity.y = -velocity.y)void InvertVelocityZ()
: inverts rigidbody z velocity (velocity.z = -velocity.z)void InvertAngularVelocityX()
: inverts rigidbody angular velocity x (angularVelocity.x = -angularVelocity.x)void InvertAngularVelocityY()
: inverts rigidbody angular velocity y (angularVelocity.y = -angularVelocity.y)void InvertAngularVelocityZ()
: inverts rigidbody angular velocity z (angularVelocity.z = -angularVelocity.z)void NormalizeVelocity(float speed)
: normalizes rigidbody velocity (velocity = velocity.normalized * speedvoid NormalizeVelocityXY(float speed)()
: normalizes rigidbody velocity xyvoid NormalizeVelocityXZ(float speed)()
: normalizes rigidbody velocity xzvoid NormalizeVelocityYZ(float speed)()
: normalizes rigidbody velocity yz
SpeedLimit2D
Limits the rididbody speed below a value.
Fields:
float maxSpeed
: Maximum speed allowed
SpeedLimit3D
Limits the rididbody speed below a value.
Fields:
float maxSpeed
: Maximum speed allowed
Collision Detection components
CollisionDetector2D
Detects 2D collisions.
Fields:
CollisionEvent collisionEvent
: Collision eventCollisionType collisionType
: Collider typestring tags
: Tags to filter collision. Use ‘;’ to separate more tags.UnityEvent<GameObject> actions
: Event called when a collision occurs
CollisionEvent
enum values:
Enter
: When this rigidbody/collider has begun touching another rigidbody/colliderExit
: When this rigidbody/collider has stopped touching another rigidbody/colliderStay
: Once per frame for every collider/rigidbody that is touching rigidbody/collider
CollisionType
enum values:
Any
: Collision and Trigger eventsCollision
: Only collision events (non trigger)Trigger
: Only trigger events
CollisionDetector3D
Detects 3D collisions.
Fields:
CollisionEvent collisionEvent
: Collision eventCollisionType collisionType
: Collider typestring tags
: Tags to filter collision. Use ‘;’ to separate more tags.UnityEvent<GameObject> actions
: Event called when a collision occurs
CollisionEvent
enum values:
Enter
: When this rigidbody/collider has begun touching another rigidbody/colliderExit
: When this rigidbody/collider has stopped touching another rigidbody/colliderStay
: Once per frame for every collider/rigidbody that is touching rigidbody/collider
CollisionType
enum values:
Any
: Collision and Trigger eventsCollision
: Only collision events (non trigger)Trigger
: Only trigger events
Time components
Components to deal with actions over time.
TimedActions
Executes actions repeatedly over time.
Fields:
float startTime
: Time to wait before the first execution startsfloat repeatTime
: Time between two executionsUnityEvent actions
: Events called
TimedActionSequence
Executes a sequence of actions with time between them.
Fields:
TimedAction[] actions
: Actions to be executedTimedAction
:float waitTime
: Time to wait before executeUnityEvent actions
: Actions to execute
ControlType controlType
: How actions are executedbool continuous
: Continuous execute actions
Methods:
void CallActions()
: Start execute actions
ControlType
enum values:
OnStart
: Executes whenStart
event occursOnEnable
: Executes whenOnEnable
event occursManual
: Executes when methodCallActions
is called
Timer
A timer (clock).
Fields:
float currentTime
: Current time (seconds)float startTime
: Initial timebool countdown
: If the timer is countdownfloat minValue
: Minimum timer valuefloat maxvalue
: Maximum timer valuebool paused
: If the timer is pausedTimerEvents events
: Timer eventsUnityEvent<float> onChange
: Event called when the timer value changesUnityEvent<float> onMinValue
: Event called when the timer reaches the min valueUnityEvent<float> onMaxValue
: Event called when the timer reaches the max valueint textDigits
: Digits to show at the OnChangeText eventUnityEvent<string> onChangeText
: Event called when the timer value changes, passing its conversion to string
Methods:
void AddTime(float time)
: Adds some time to currentTimevoid Pause()
: Pause the clockvoid Resume()
: Resume the clockvoid SwitchPause()
: Swith between Paused and Resumed clock
Vars components
Components to store variables inside components.
IntVar
Stores a global int variable.
Fields:
string id
: variable identifierint value
: current valueint startValue
: start variable valueFilterType filter
: Filter to apply when value changesbool limitValue
: limit variable valueint minValue
: min value allowedint maxValue
: max value allowed
bool storeOnPlayerPrefs
: store this variable in PlayerPrefsstring playerPrefsKey
: PlayerPrefs keybool autoLoadOnStart
: auto load variable from PlayerPrefsbool autoSave
: auto save variable in PlayerPrefs
Methods:
void Add(int inc)
: Adds this variable to some value (value += inc)void Multiply(int multiplier)
: Multiply this variable by some value (value *= multiplier)void Divide(int divider)
: Divide this variable by some value (value /= divider)void SetValue(int value)
: Change this variable valuevoid ResetValue()
: Reset value tostartValue
void SaveOnPlayerPrefs()
: Save on PlayerPrefsvoid LoadFromPlayerPrefs()
: Load from PlayerPrefs
FilterType
enum values:
None
: No filterKeepMinValue
: Keep minimum value when value changesKeepMaxValue
: keep maximum value when value changes
IntVarRef
Reference to a IntVar component.
Fields:
string varId
: ReferencedIntVar
identifierGlobalVariablePlace varPlace
: ReferencedIntVar
search placeGlobalVarGetEvents<int> getValue
: Ways to get referencedIntVar
valuebool condition
: submit thegetValue
to some conditionbool ignoreConditionOnStart
: ignore this condition on first value getGlobalVarComparisonType comparison
: condition comparisonint comparisonValue
: condition comparison value
UnityEvent<int> onValueChange
: event called when the value changesUnityEvent<string> onValueChangeText
: event called when the value changes passing its conversion to string
Methods:
void Add(int inc)
: Adds the referenced variable to some value (value += inc)void Multiply(int multiplier)
: Multiply the referenced variable by some value (value *= multiplier)void Divide(int divider)
: Divide the referenced variable by some value (value /= divider)void SetValue(int value)
: Change the referenced variable valuevoid ResetValue()
: Reset the referenced variable value tostartValue
void SaveOnPlayerPrefs()
: Save the referenced variable on PlayerPrefsvoid LoadFromPlayerPrefs()
: Load the referenced variable from PlayerPrefs
GlobalVariablePlace
enum values:
Anywhere
: Find theIntVar
anywhere in the sceneSelf
: Find theIntVar
in its ownGameObject
Children
: Find theIntVar
in this object’s childrenParent
: Find theIntVar
in this object’s parents
GlobalVarComparisonType
enum values:
Equals
: if the variable value is equals to thecomparisonValue
NotEquals
: if the variable value is not equals to thecomparisonValue
LessThan
: if the variable value is less than thecomparisonValue
LessOrEqualTo
: if the variable value is less or equal to thecomparisonValue
GreaterThan
: if the variable value is greater than thecomparisonValue
GreaterOrEqualTo
: if the variable value is greater or equal to thecomparisonValue
FloatVar
Stores a global float variable.
Fields:
string id
: variable identifierfloat value
: current valuefloat startValue
: start variable valueFilterType filter
: Filter to apply when value changesbool limitValue
: limit variable valuefloat minValue
: min value allowedfloat maxValue
: max value allowed
bool storeOnPlayerPrefs
: store this variable in PlayerPrefsstring playerPrefsKey
: PlayerPrefs keybool autoLoadOnStart
: auto load variable from PlayerPrefsbool autoSave
: auto save variable in PlayerPrefs
Methods:
void Add(float inc)
: Adds this variable to some value (value += inc)void Multiply(float multiplier)
: Multiply this variable by some value (value *= multiplier)void Divide(float divider)
: Divide this variable by some value (value /= divider)void SetValue(float value)
: Change this variable valuevoid ResetValue()
: Reset value tostartValue
void SaveOnPlayerPrefs()
: Save on PlayerPrefsvoid LoadFromPlayerPrefs()
: Load from PlayerPrefs
FilterType
enum values:
None
: No filterKeepMinValue
: Keep minimum value when value changesKeepMaxValue
: keep maximum value when value changes
FloatVarRef
Reference to a FloatVar component.
Fields:
string varId
: ReferencedFloatVar
identifierGlobalVariablePlace varPlace
: ReferencedFloatVar
search placeGlobalVarGetEvents<float> getValue
: Ways to get referencedFloatVar
valuebool condition
: submit thegetValue
to some conditionbool ignoreConditionOnStart
: ignore this condition on first value getGlobalVarComparisonType comparison
: condition comparisonfloat comparisonValue
: condition comparison value
UnityEvent<float> onValueChange
: event called when the value changesUnityEvent<string> onValueChangeText
: event called when the value changes passing its conversion to string
Methods:
void Add(float inc)
: Adds the referenced variable to some value (value += inc)void Multiply(float multiplier)
: Multiply the referenced variable by some value (value *= multiplier)void Divide(float divider)
: Divide the referenced variable by some value (value /= divider)void SetValue(float value)
: Change the referenced variable valuevoid ResetValue()
: Reset the referenced variable value tostartValue
void SaveOnPlayerPrefs()
: Save the referenced variable on PlayerPrefsvoid LoadFromPlayerPrefs()
: Load the referenced variable from PlayerPrefs
GlobalVariablePlace
enum values:
Anywhere
: Find theFloatVar
anywhere in the sceneSelf
: Find theFloatVar
in its ownGameObject
Children
: Find theFloatVar
in this object’s childrenParent
: Find theFloatVar
in this object’s parents
GlobalVarComparisonType
enum values:
Equals
: if the variable value is equals to thecomparisonValue
NotEquals
: if the variable value is not equals to thecomparisonValue
LessThan
: if the variable value is less than thecomparisonValue
LessOrEqualTo
: if the variable value is less or equal to thecomparisonValue
GreaterThan
: if the variable value is greater than thecomparisonValue
GreaterOrEqualTo
: if the variable value is greater or equal to thecomparisonValue
BoolVar
Stores a global bool variable.
Fields:
string id
: variable identifierbool value
: current valuebool startValue
: start variable valuebool storeOnPlayerPrefs
: store this variable in PlayerPrefs (as an int 0 or 1)string playerPrefsKey
: PlayerPrefs keybool autoLoadOnStart
: auto load variable from PlayerPrefsbool autoSave
: auto save variable in PlayerPrefs
Methods:
-
void Or(bool value)
: Applies an ‘or’ operator with some value (varValue = varValuevalue) void And(bool value)
: Applies an ‘and’ operator with some value (varValue = varValue && value)void Neg()
: Inverts the value (varValue = !varValue)void SetValue(int value)
: Change this variable valuevoid ResetValue()
: Reset value tostartValue
void SaveOnPlayerPrefs()
: Save on PlayerPrefsvoid LoadFromPlayerPrefs()
: Load from PlayerPrefs
BoolVarRef
Reference to a BoolVar component.
Fields:
string varId
: ReferencedBoolVar
identifierGlobalVariablePlace varPlace
: ReferencedBoolVar
search placeGlobalVarGetEvents<bool> getValue
: Ways to get referencedBoolVar
valuebool condition
: submit thegetValue
to some conditionbool ignoreConditionOnStart
: ignore this condition on first value getGlobalVarComparisonType comparison
: condition comparisonbool comparisonValue
: condition comparison value
UnityEvent<bool> onValueChange
: event called when the value changesUnityEvent<string> onValueChangeText
: event called when the value changes passing its conversion to string
Methods:
-
void Or(bool value)
: Applies an ‘or’ operator with some value (varValue = varValuevalue) void And(bool value)
: Applies an ‘and’ operator with some value (varValue = varValue && value)void Neg()
: Inverts the value (varValue = !varValue)void SetValue(int value)
: Change this referenced variable valuevoid ResetValue()
: Reset the referenced variable value tostartValue
void SaveOnPlayerPrefs()
: Save the referenced variable on PlayerPrefsvoid LoadFromPlayerPrefs()
: Load the referenced variable from PlayerPrefs
GlobalVariablePlace
enum values:
Anywhere
: Find theBoolVar
anywhere in the sceneSelf
: Find theBoolVar
in its ownGameObject
Children
: Find theBoolVar
in this object’s childrenParent
: Find theBoolVar
in this object’s parents
GlobalVarComparisonType
enum values:
Equals
: if the variable value is equals to thecomparisonValue
NotEquals
: if the variable value is not equals to thecomparisonValue
LessThan
: if the variable value is less than thecomparisonValue
LessOrEqualTo
: if the variable value is less or equal to thecomparisonValue
GreaterThan
: if the variable value is greater than thecomparisonValue
GreaterOrEqualTo
: if the variable value is greater or equal to thecomparisonValue
Score components
Components to score and change player’s score and record.
Score
Stores player score and record.
Fields:
string id
: Score id to differentiate multiple scoresint value
: Current scoreint recordValue
: Current score recordbool saveScore
: If the score should be automatically savedstring valuePlayerPrefsKey
: Score PlayerPrefs’s key
bool saveRecord
: If the record should be automatically savedstring recordPlayerPrefsKey
: Score PlayerPrefs’s key
ScoreEvents events
: Events relative to score and recordUnityEvent<int> onScoreChange
: Event called when score changesUnityEvent<int> onRecordChange
: Event called when record changesUnityEvent<int> onNewRecord
: Event called when score makes a new recordUnityEvent<string> onScoreChangeText
: Event called when score changes passing its conversion to stringUnityEvent<string> onRecordChangeText
: Event called when record changes passing its conversion to string
Methods:
void IncScore()
: Adds 1 to scorevoid AddScore(int scoreChange)
: Add some value to scorevoid ResetScore()
: Reset score value do 0(zero).
ScoreMaker
Adds score to Score component.
Fields:
string scoreId
: Score component idint scoreChange
: Amount of score to be added
Methods:
void ApplyScore()
: addscoreChange
value to referenced scorevoid AddScore(int scoreChange)
: add some value passed as parameter to referenced score
Mechanics components
Some simple mechanics.
MoveFourDirections2D
Controls an 2D object in all directions.
Fields:
string horizontalAxis
: Horizontal axis namestring verticalAxis
: Vertical axis namefloat speed
: Normalized speed
Platform2D
Simple Platform character physics control.
Fields:
float walkInput
: Controls walk direction (-1 to walk left, 0 to stop, +1 to walk right)float walkSpeed
: Speed the character walksfloat jumpSpeed
: Speed set to y axis when character jumpsGroundCheckConfig groundCheckConfig
: Ground check optionsLayerMask platformLayers
: Physics Layers to check if character is toutching groundfloat width
: raycast widthfloat height
: raycast heightint rays
: Number of raycasts
PlatformEvents events
: events related to platform characterUnityEvent onJump
: Event called when the character jumpsUnityEvent onLand
: Event called when the character fall on groundUnityEvent onMoving
: Event called when the character starts moveUnityEvent onStop
: Event called when the character stops moveUnityEvent onAir
: Event called when the character go on air without jumping (like falling from a platform)
bool defaultInput
: Use default input (keyboard arrows)string horizontalAxis
: Horizontal axis nameKeyCode jumpKey
: Jump key
Methods:
void Jump()
: jump if character is on ground
Tank2D
Simple Tank physics control (walk forward and rotate).
Fields:
float turnInput
: Controls Tank turn direction (-1 to turn left, 0 to stop, +1 to turn right)float moveInput
: Controls Tank move direction (-1 to move backward, 0 to stop, +1 to move forward)float moveSpeed
: speed of Tank movementfloat turnSpeed
: speed of Tank rotation (in degrees/second)bool onlyTurnIfMoving
: If the Tank can only turn if its movingbool defaultInput
: If use default inputstring horizontalAxis
: Horizontal (turn) axis namestring verticalAxis
: Vertical (move) axis name
Audio components
Some components do control audio in the scene.
AudioManager
Manager for many AudioSources. Each AudioSource must be attached to a different ´GameObject´ with the right name set.
Fields:
List<AudioSource> audios
: List of AudioSources managed by this object.
Methods:
void PlayAudio(string name)
: Play some audiosource with the name passed as parametervoid StopAudio(string name)
: Stop some audiosource with the name passed as parameter
AudioManagerControl
Commands the AudioManager component. This component is useful to control the AudioManager from inside a prefab.
Methods:
void PlayAudio(string name)
: Play some audiosource in theAudioManager
with the name passed as parametervoid StopAudio(string name)
: Stop some audiosource in theAudioManager
with the name passed as parameter