Feel 5.9.1
The best way to improve your game's feel and make it extra juicy
Loading...
Searching...
No Matches
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.
virtual void SwitchToOffSprite ()
 a public method to switch to off sprite directly
virtual void SwitchToOnSprite ()
 a public method to switch to on sprite directly

Public Attributes

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

Protected Member Functions

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

Protected Attributes

Image _image
SpriteRenderer _spriteRenderer
MMTouchButton _mmTouchButton

Properties

bool CurrentValue [get]
 the current state of the button

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:
  • H:/Code/MoreMountains/feel/Assets/Feel/NiceVibrations/Demo/Common/Scripts/UI/MMSpriteReplace.cs