BasicTouchScreenButton
An abstract class in Root.Township, the global namespace.
Base for a button on an in-world touch screen (such as the camera or menus): tracks pressed state, changes the renderer alpha and plays sounds. Pressed by TouchScreenMenuBase.
- Listed in Global namespace: A to B
- Inherits or implements
MonoBehaviour,ITouchScreenButton - Derived types
FiltersButton,TouchScreenButtonOld,TouchScreenKeyboardKey
Constructors
| Member | What it is |
|---|---|
protected BasicTouchScreenButton() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
4 private and internal fields
| Member | What it is |
|---|---|
private Material material | Instance of the main renderer's material, shared by all its renderers, whose _Alpha shows pressed or idle. |
private AltaEvent onPressed | Event behind Pressed, invoked by Press. |
private AltaEvent onReleased | Event behind Released, invoked by Release. |
private ButtonSoundSettings sounds | Optional press and release sounds, hooked up in Awake. |
Properties
Events
| Member | What it is |
|---|---|
event Action Pressed | Raised when the button is pressed. |
event Action Released | Raised when the button is released. |