Feel  5.1
The best way to improve your game's feel and make it extra juicy
Lofelt.NiceVibrations.MMSpriteReplace Class Reference

A class to add to an Image or SpriteRenderer to have it act like a button with a different sprite for on and off states More...

Inheritance diagram for Lofelt.NiceVibrations.MMSpriteReplace:

Public Member Functions

virtual void Swap ()
 A public method to change the sprite More...
 
virtual void SwitchToOffSprite ()
 a public method to switch to off sprite directly More...
 
virtual void SwitchToOnSprite ()
 a public method to switch to on sprite directly More...
 

Public Attributes

Sprite OnSprite
 the sprite to use when in the "on" state More...
 
Sprite OffSprite
 the sprite to use when in the "off" state More...
 
bool StartsOn = true
 if this is true, the button will start if "on" state More...
 

Protected Member Functions

virtual void Start ()
 On Start we initialize our button More...
 
virtual void Initialization ()
 On init, we grab our image component, and set our sprite in its initial state More...
 
virtual void SpriteOff ()
 sets the image's sprite to off More...
 
virtual void SpriteOn ()
 sets the image's sprite to on More...
 

Protected Attributes

Image _image
 
SpriteRenderer _spriteRenderer
 
MMTouchButton _mmTouchButton
 

Properties

bool CurrentValue [get]
 the current state of the button More...
 

Detailed Description

A class to add to an Image or SpriteRenderer to have it act like a button with a different sprite for on and off states

Member Function Documentation

◆ Initialization()

virtual void Lofelt.NiceVibrations.MMSpriteReplace.Initialization ( )
protectedvirtual

On init, we grab our image component, and set our sprite in its initial state

◆ SpriteOff()

virtual void Lofelt.NiceVibrations.MMSpriteReplace.SpriteOff ( )
protectedvirtual

sets the image's sprite to off

◆ SpriteOn()

virtual void Lofelt.NiceVibrations.MMSpriteReplace.SpriteOn ( )
protectedvirtual

sets the image's sprite to on

◆ Start()

virtual void Lofelt.NiceVibrations.MMSpriteReplace.Start ( )
protectedvirtual

On Start we initialize our button

◆ Swap()

virtual void Lofelt.NiceVibrations.MMSpriteReplace.Swap ( )
virtual

A public method to change the sprite

◆ SwitchToOffSprite()

virtual void Lofelt.NiceVibrations.MMSpriteReplace.SwitchToOffSprite ( )
virtual

a public method to switch to off sprite directly

◆ SwitchToOnSprite()

virtual void Lofelt.NiceVibrations.MMSpriteReplace.SwitchToOnSprite ( )
virtual

a public method to switch to on sprite directly

Member Data Documentation

◆ _image

Image Lofelt.NiceVibrations.MMSpriteReplace._image
protected

◆ _mmTouchButton

MMTouchButton Lofelt.NiceVibrations.MMSpriteReplace._mmTouchButton
protected

◆ _spriteRenderer

SpriteRenderer Lofelt.NiceVibrations.MMSpriteReplace._spriteRenderer
protected

◆ OffSprite

Sprite Lofelt.NiceVibrations.MMSpriteReplace.OffSprite

the sprite to use when in the "off" state

◆ OnSprite

Sprite Lofelt.NiceVibrations.MMSpriteReplace.OnSprite

the sprite to use when in the "on" state

◆ StartsOn

bool Lofelt.NiceVibrations.MMSpriteReplace.StartsOn = true

if this is true, the button will start if "on" state

Property Documentation

◆ CurrentValue

bool Lofelt.NiceVibrations.MMSpriteReplace.CurrentValue
get

the current state of the button


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