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...
|
| virtual void | Swap () |
| | A public method to change the sprite.
|
| virtual void | SwitchToOffSprite () |
| | a public method to switch to off sprite directly
|
| virtual void | SwitchToOnSprite () |
| | a public method to switch to on sprite directly
|
|
| Sprite | OnSprite |
| | the sprite to use when in the "on" state
|
| Sprite | OffSprite |
| | the sprite to use when in the "off" state
|
| bool | StartsOn = true |
| | if this is true, the button will start if "on" state
|
|
| virtual void | Start () |
| | On Start we initialize our button.
|
| virtual void | Initialization () |
| | On init, we grab our image component, and set our sprite in its initial state.
|
| virtual void | SpriteOff () |
| | sets the image's sprite to off
|
| virtual void | SpriteOn () |
| | sets the image's sprite to on
|
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.
◆ 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
◆ _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
◆ CurrentValue
| bool Lofelt.NiceVibrations.MMSpriteReplace.CurrentValue |
|
get |
the current state of the button
The documentation for this class was generated from the following file:
- H:/Code/MoreMountains/feel/Assets/Feel/NiceVibrations/Demo/Common/Scripts/UI/MMSpriteReplace.cs