Table of Contents

Class ModularInputField

Namespace
Fallencake.UI
Assembly
Fallencake.UI.dll

Modular wrapper over TMPro.TMP_InputField that adds animation hooks, audio feedback via IInputFieldAudioProvider and convenient submit handling.

[RequireComponent(typeof(TMP_InputField))]
public class ModularInputField : MonoBehaviour, IInputFieldAudioProvider, IAudioProvider
Inheritance
object
Object
Component
Behaviour
MonoBehaviour
ModularInputField
Implements

Fields

OnSubmitEvent

public UnityEvent OnSubmitEvent

Field Value

UnityEvent

Properties

AudioSource

AudioSource used to play sounds.

public AudioSource AudioSource { get; set; }

Property Value

AudioSource

Component

Owning component used by handlers for context and coroutines.

public MonoBehaviour Component { get; }

Property Value

MonoBehaviour

DeselectSound

Sound played on deselect.

public AudioData DeselectSound { get; }

Property Value

AudioData

EnableSounds

Enables/disables sound playback for this component.

public bool EnableSounds { get; set; }

Property Value

bool

EndEditSound

Sound for end-edit/submit.

public AudioData EndEditSound { get; }

Property Value

AudioData

PressSound

Sound played on press/submit.

public AudioData PressSound { get; }

Property Value

AudioData

SelectSound

Sound played on select/hover.

public AudioData SelectSound { get; }

Property Value

AudioData

Selectable

UI selectable to bind event triggers to.

public Selectable Selectable { get; }

Property Value

Selectable

TypeSound

Sound for character typing.

public AudioData TypeSound { get; }

Property Value

AudioData

UseDeselectSound

Enables deselect sound playback.

public bool UseDeselectSound { get; set; }

Property Value

bool

UsePressSound

Enables press sound playback.

public bool UsePressSound { get; set; }

Property Value

bool

UseSelectSound

Enables select sound playback.

public bool UseSelectSound { get; set; }

Property Value

bool

Volume

Per-component volume multiplier.

public float Volume { get; set; }

Property Value

float

Methods

Deselect()

Triggers deselect animation if field is empty (placeholder visible).

public void Deselect()

Dispose()

Disposes internal audio handler and releases resources.

public void Dispose()

OnDeselect(BaseEventData)

Called by the EventSystem when a new object is being selected.

public void OnDeselect(BaseEventData eventData)

Parameters

eventData BaseEventData

OnPointerClick(PointerEventData)

Use this callback to detect clicks.

public void OnPointerClick(PointerEventData eventData)

Parameters

eventData PointerEventData

OnSelect(BaseEventData)

public void OnSelect(BaseEventData eventData)

Parameters

eventData BaseEventData

OnSubmit(BaseEventData)

public void OnSubmit(BaseEventData eventData)

Parameters

eventData BaseEventData

PlayDeselectSound()

public void PlayDeselectSound()

PlayPressSound()

public void PlayPressSound()

PlaySelectSound()

public void PlaySelectSound()

PlayTextInputSound()

Plays a text input sound if enabled and clip is assigned.

public void PlayTextInputSound()

Select()

Triggers select animation if field is empty (placeholder visible).

public void Select()

UpdateInteractable(bool)

Updates interactivity for the input field and audio handler.

public void UpdateInteractable(bool isInteractable)

Parameters

isInteractable bool

Target interactable state.

UpdateStateInstant()

Waits for animator initialization and applies instant state to match current text.

public IEnumerator UpdateStateInstant()

Returns

IEnumerator