Search Results for

    Show / Hide Table of Contents

    Class UIHandler

    Controls the general UI (like top and bottom bars). Also references the other main panels of the UI.

    Inheritance
    object
    UIHandler
    Namespace: AS2.UI
    Assembly: .dll
    Syntax
    public class UIHandler : MonoBehaviour

    Fields

    | Edit this page View Source

    activeTool

    Declaration
    public UIHandler.UITool activeTool
    Field Value
    Type Description
    UIHandler.UITool
    | Edit this page View Source

    button_backgroundGridActive

    Declaration
    public Button button_backgroundGridActive
    Field Value
    Type Description
    Button
    | Edit this page View Source

    button_bondsActive

    Declaration
    public Button button_bondsActive
    Field Value
    Type Description
    Button
    | Edit this page View Source

    button_circuitViewType

    Declaration
    public Button button_circuitViewType
    Field Value
    Type Description
    Button
    | Edit this page View Source

    button_collisionCheck

    Declaration
    public Button button_collisionCheck
    Field Value
    Type Description
    Button
    | Edit this page View Source

    button_exit

    Declaration
    public Button button_exit
    Field Value
    Type Description
    Button
    | Edit this page View Source

    button_jumpCut

    Declaration
    public Button button_jumpCut
    Field Value
    Type Description
    Button
    | Edit this page View Source

    button_pSetPositioning

    Declaration
    public Button button_pSetPositioning
    Field Value
    Type Description
    Button
    | Edit this page View Source

    button_playPause

    Declaration
    public Button button_playPause
    Field Value
    Type Description
    Button
    | Edit this page View Source

    button_settings

    Declaration
    public Button button_settings
    Field Value
    Type Description
    Button
    | Edit this page View Source

    button_stepBack

    Declaration
    public Button button_stepBack
    Field Value
    Type Description
    Button
    | Edit this page View Source

    button_stepForward

    Declaration
    public Button button_stepForward
    Field Value
    Type Description
    Button
    | Edit this page View Source

    button_toolAdd

    Declaration
    public Button button_toolAdd
    Field Value
    Type Description
    Button
    | Edit this page View Source

    button_toolAddObject

    Declaration
    public Button button_toolAddObject
    Field Value
    Type Description
    Button
    | Edit this page View Source

    button_toolMove

    Declaration
    public Button button_toolMove
    Field Value
    Type Description
    Button
    | Edit this page View Source

    button_toolPSetMove

    Declaration
    public Button button_toolPSetMove
    Field Value
    Type Description
    Button
    | Edit this page View Source

    button_toolRemove

    Declaration
    public Button button_toolRemove
    Field Value
    Type Description
    Button
    | Edit this page View Source

    button_toolStandard

    Declaration
    public Button button_toolStandard
    Field Value
    Type Description
    Button
    | Edit this page View Source

    button_viewType

    Declaration
    public Button button_viewType
    Field Value
    Type Description
    Button
    | Edit this page View Source

    dropdown_chirality

    Declaration
    public TMP_Dropdown dropdown_chirality
    Field Value
    Type Description
    TMP_Dropdown
    | Edit this page View Source

    dropdown_compass

    Declaration
    public TMP_Dropdown dropdown_compass
    Field Value
    Type Description
    TMP_Dropdown
    | Edit this page View Source

    frameMargin

    Margin around the particle system when framing the system in the viewport.

    Declaration
    public float frameMargin
    Field Value
    Type Description
    float
    | Edit this page View Source

    image_circuitViewType

    Declaration
    public Image image_circuitViewType
    Field Value
    Type Description
    Image
    | Edit this page View Source

    image_pSetPositioning

    Declaration
    public Image image_pSetPositioning
    Field Value
    Type Description
    Image
    | Edit this page View Source

    image_playPauseButton

    Declaration
    public Image image_playPauseButton
    Field Value
    Type Description
    Image
    | Edit this page View Source

    image_viewType

    Declaration
    public Image image_viewType
    Field Value
    Type Description
    Image
    | Edit this page View Source

    initializationUI

    Declaration
    public InitializationUIHandler initializationUI
    Field Value
    Type Description
    InitializationUIHandler
    | Edit this page View Source

    objectUI

    Declaration
    public ObjectUIHandler objectUI
    Field Value
    Type Description
    ObjectUIHandler
    | Edit this page View Source

    overlayColor_active

    Declaration
    private Color overlayColor_active
    Field Value
    Type Description
    Color
    | Edit this page View Source

    overlayColor_inactive

    Declaration
    private Color overlayColor_inactive
    Field Value
    Type Description
    Color
    | Edit this page View Source

    particleUI

    Declaration
    public ParticleUIHandler particleUI
    Field Value
    Type Description
    ParticleUIHandler
    | Edit this page View Source

    settingsUI

    Declaration
    public SettingsUIHandler settingsUI
    Field Value
    Type Description
    SettingsUIHandler
    | Edit this page View Source

    sim

    Declaration
    public AmoebotSimulator sim
    Field Value
    Type Description
    AmoebotSimulator
    | Edit this page View Source

    slider_round

    Declaration
    public Slider slider_round
    Field Value
    Type Description
    Slider
    | Edit this page View Source

    slider_speed

    Declaration
    public Slider slider_speed
    Field Value
    Type Description
    Slider
    | Edit this page View Source

    slider_speed_values

    Declaration
    private float[] slider_speed_values
    Field Value
    Type Description
    float[]
    | Edit this page View Source

    sprite_circuitViewTypeCircuitsDisabled

    Declaration
    public Sprite sprite_circuitViewTypeCircuitsDisabled
    Field Value
    Type Description
    Sprite
    | Edit this page View Source

    sprite_circuitViewTypeCircuitsEnabled

    Declaration
    public Sprite sprite_circuitViewTypeCircuitsEnabled
    Field Value
    Type Description
    Sprite
    | Edit this page View Source

    sprite_pSetPositioning_auto

    Declaration
    public Sprite sprite_pSetPositioning_auto
    Field Value
    Type Description
    Sprite
    | Edit this page View Source

    sprite_pSetPositioning_auto2D

    Declaration
    public Sprite sprite_pSetPositioning_auto2D
    Field Value
    Type Description
    Sprite
    | Edit this page View Source

    sprite_pSetPositioning_def

    Declaration
    public Sprite sprite_pSetPositioning_def
    Field Value
    Type Description
    Sprite
    | Edit this page View Source

    sprite_pSetPositioning_line

    Declaration
    public Sprite sprite_pSetPositioning_line
    Field Value
    Type Description
    Sprite
    | Edit this page View Source

    sprite_pause

    Declaration
    public Sprite sprite_pause
    Field Value
    Type Description
    Sprite
    | Edit this page View Source

    sprite_play

    Declaration
    public Sprite sprite_play
    Field Value
    Type Description
    Sprite
    | Edit this page View Source

    sprite_viewTypeCircular

    Declaration
    public Sprite sprite_viewTypeCircular
    Field Value
    Type Description
    Sprite
    | Edit this page View Source

    sprite_viewTypeHexagonal

    Declaration
    public Sprite sprite_viewTypeHexagonal
    Field Value
    Type Description
    Sprite
    | Edit this page View Source

    sprite_viewTypeHexagonalCirc

    Declaration
    public Sprite sprite_viewTypeHexagonalCirc
    Field Value
    Type Description
    Sprite
    | Edit this page View Source

    text_round

    Declaration
    public TextMeshProUGUI text_round
    Field Value
    Type Description
    TextMeshProUGUI
    | Edit this page View Source

    text_speed

    Declaration
    public TextMeshProUGUI text_speed
    Field Value
    Type Description
    TextMeshProUGUI
    | Edit this page View Source

    toggle_alwaysUpdateWhenRoundSliderIsChanged

    Declaration
    public Toggle toggle_alwaysUpdateWhenRoundSliderIsChanged
    Field Value
    Type Description
    Toggle
    | Edit this page View Source

    toolColor_active

    Declaration
    private Color toolColor_active
    Field Value
    Type Description
    Color
    | Edit this page View Source

    toolColor_inactive

    Declaration
    private Color toolColor_inactive
    Field Value
    Type Description
    Color
    | Edit this page View Source

    tools_initMode

    Declaration
    private List<GameObject> tools_initMode
    Field Value
    Type Description
    List<GameObject>
    | Edit this page View Source

    tools_playMode

    Declaration
    private List<GameObject> tools_playMode
    Field Value
    Type Description
    List<GameObject>
    | Edit this page View Source

    topAndBottomBarFraction

    Fraction of the viewport height taken up by the top and bottom bar, used for framing the system in view.

    Declaration
    public float topAndBottomBarFraction
    Field Value
    Type Description
    float
    | Edit this page View Source

    ui

    Declaration
    public GameObject ui
    Field Value
    Type Description
    GameObject

    Methods

    | Edit this page View Source

    Button_CameraCenterPressed()

    Centers the camera to the particles. Sets the (0,0) position if there are no particles.

    Declaration
    public void Button_CameraCenterPressed()
    | Edit this page View Source

    Button_CutPressed()

    Called when the cut rounds button has been pressed. Deletes the history of later rounds than the currently active round.

    Declaration
    public void Button_CutPressed()
    | Edit this page View Source

    Button_ExitPressed()

    Exits the simulator.

    Declaration
    public void Button_ExitPressed()
    | Edit this page View Source

    Button_FrameSystemPressed()

    Changes the camera position and zoom level such that the whole particle system is in frame.

    Declaration
    public void Button_FrameSystemPressed()
    | Edit this page View Source

    Button_OpenPressed()

    Called when the open button has been pressed. Opens the interface to load a saved simulator configuration.

    Declaration
    public void Button_OpenPressed()
    | Edit this page View Source

    Button_PrintLogToFilePressed()

    Called when the save log button has been pressed. Saves the log to a file.

    Declaration
    public void Button_PrintLogToFilePressed()
    | Edit this page View Source

    Button_SavePressed()

    Called when the save button has been pressed. Saves the current simulator configuration.

    Declaration
    public void Button_SavePressed()
    | Edit this page View Source

    Button_ScreenshotPressed()

    Called when the screenshot button has been pressed. Makes a screenshot of the simulation and saves it to a file selected via a file browser.

    Declaration
    public void Button_ScreenshotPressed()
    | Edit this page View Source

    Button_StepBackPressed()

    Called when the step back button has been pressed. Goes back a round if the sim is not running.

    Declaration
    public void Button_StepBackPressed()
    | Edit this page View Source

    Button_StepForwardPressed()

    Called when the step forward button has been pressed. Goes forward a round if the sim is not running.

    Declaration
    public void Button_StepForwardPressed()
    | Edit this page View Source

    Button_ToggleBondsPressed()

    Toggles the bonds on/off.

    Declaration
    public void Button_ToggleBondsPressed()
    | Edit this page View Source

    Button_ToggleCircuitViewPressed()

    Toggles the circuit view on/off.

    Declaration
    public void Button_ToggleCircuitViewPressed()
    | Edit this page View Source

    Button_ToggleCollisionCheck()

    Toggles the collision check on/off.

    Declaration
    public void Button_ToggleCollisionCheck()
    | Edit this page View Source

    Button_TogglePSetPositioningPressed()

    Toggles the positioning mode of the partition sets.

    Declaration
    public void Button_TogglePSetPositioningPressed()
    | Edit this page View Source

    Button_ToggleViewPressed()

    Toggles the view type (hexagon, circle, graph, ...).

    Declaration
    public void Button_ToggleViewPressed()
    | Edit this page View Source

    Button_ToolAddObjectPressed()

    Selects the add object tool.

    Declaration
    public void Button_ToolAddObjectPressed()
    | Edit this page View Source

    Button_ToolAddPressed()

    Selects the add tool.

    Declaration
    public void Button_ToolAddPressed()
    | Edit this page View Source

    Button_ToolMovePressed()

    Selects the move tool.

    Declaration
    public void Button_ToolMovePressed()
    | Edit this page View Source

    Button_ToolPSetMovePressed()

    Selects the partition set move tool.

    Declaration
    public void Button_ToolPSetMovePressed()
    | Edit this page View Source

    Button_ToolRemovePressed()

    Selects the remove tool.

    Declaration
    public void Button_ToolRemovePressed()
    | Edit this page View Source

    Button_ToolStandardPressed()

    Selects the standard selection tool.

    Declaration
    public void Button_ToolStandardPressed()
    | Edit this page View Source

    GetButtonColor_Active()

    Returns the color used to display that the setting is active.

    Declaration
    public Color GetButtonColor_Active()
    Returns
    Type Description
    Color

    The active overlay color.

    | Edit this page View Source

    GetButtonColor_Inactive()

    Returns the color used to display that the setting is inactive.

    Declaration
    public Color GetButtonColor_Inactive()
    Returns
    Type Description
    Color

    The inactive overlay color.

    | Edit this page View Source

    GetDropdownValue_Chirality()

    Gets the chirality value from the corresponding dropdown UI element.

    Declaration
    public Initialization.Chirality GetDropdownValue_Chirality()
    Returns
    Type Description
    Initialization.Chirality

    The selected chirality value. Can be Random, Clockwise or Counterclockwise.

    | Edit this page View Source

    GetDropdownValue_Compass()

    Gets the compass dir value from the corresponding dropdown UI element.

    Declaration
    public Initialization.Compass GetDropdownValue_Compass()
    Returns
    Type Description
    Initialization.Compass

    The selected compass direction. Can be any cardinal direction or Random.

    | Edit this page View Source

    GetPSetViewModeTooltip()

    Generates the tooltip matching the current partition set view type.

    Declaration
    private string GetPSetViewModeTooltip()
    Returns
    Type Description
    string

    The new tooltip message for the partition set view type button.

    | Edit this page View Source

    GetViewModeTooltip()

    Generates the tooltip matching the current view type.

    Declaration
    private string GetViewModeTooltip()
    Returns
    Type Description
    string

    The new tooltip message for the partition set view type button.

    | Edit this page View Source

    HideTopRightButtons()

    Makes the top right buttons that should not be used during Init Mode not interactable. (Originally this method has hidden the button.)

    Declaration
    public void HideTopRightButtons()
    | Edit this page View Source

    HideUI()

    Hides the UI. Use this for things like screenshots.

    Declaration
    public void HideUI()
    | Edit this page View Source

    InitUI()

    Initializes the part of the visual interface that is controlled by this class.

    Declaration
    public void InitUI()
    | Edit this page View Source

    JumpToRound(int)

    Jumps to a certain round. The UI is updated afterwards.

    Declaration
    private void JumpToRound(int newRound)
    Parameters
    Type Name Description
    int newRound

    The round to jump to. Must be in the range of valid rounds.

    | Edit this page View Source

    NotifyPlayPause(bool)

    Notifies the UI handler that the play/pause has been toggled.

    Declaration
    public void NotifyPlayPause(bool running)
    Parameters
    Type Name Description
    bool running

    The currently active running state. True if the simulation is running.

    | Edit this page View Source

    ProcessInputs()

    Processes all the hotkeys that are included in the simulator. Note: You can change the hotkeys if you want.

    Declaration
    private void ProcessInputs()
    | Edit this page View Source

    RegisterSim(AmoebotSimulator)

    Registers the simulator at this object.

    Declaration
    public void RegisterSim(AmoebotSimulator sim)
    Parameters
    Type Name Description
    AmoebotSimulator sim

    The simulator instance.

    | Edit this page View Source

    SetButtonColor(Button, Color)

    Sets the background color of an arbitrary standard button.

    Declaration
    private void SetButtonColor(Button button, Color color)
    Parameters
    Type Name Description
    Button button

    The button to change.

    Color color

    The color the button should have.

    | Edit this page View Source

    ShowTopRightButtons()

    Makes the top right buttons that should not be used during Init Mode interactable. (Originally this method has shown the buttons.)

    Declaration
    public void ShowTopRightButtons()
    | Edit this page View Source

    ShowUI()

    Shows the UI.

    Declaration
    public void ShowUI()
    | Edit this page View Source

    SliderRound_onDragEnd()

    Called when the round slider drag has been finished. Alternative to SliderRound_onValueChanged(). Changes the round of the simulation.

    Declaration
    public void SliderRound_onDragEnd()
    | Edit this page View Source

    SliderRound_onValueChanged()

    Called when the round slider value has been changed. Alternative to SliderRound_onDragEnd(). Changes the round of the simulation.

    Declaration
    public void SliderRound_onValueChanged()
    | Edit this page View Source

    SliderSpeed_onValueChanged()

    Called when the speed slider value has been changed. Changes the speed of the simulation.

    Declaration
    public void SliderSpeed_onValueChanged()
    | Edit this page View Source

    Start()

    Declaration
    private void Start()
    | Edit this page View Source

    ToggleUI()

    Toggles the UI visibility.

    Declaration
    public void ToggleUI()
    | Edit this page View Source

    Update()

    Update loop of the UI Handler. Calls UpdateUI and updates the particle and object panel. Also processes the inputs for hotkeys.

    Declaration
    public void Update()
    | Edit this page View Source

    UpdateTools()

    Updates the color of the tool buttons. The active tool is highlighted.

    Declaration
    private void UpdateTools()
    | Edit this page View Source

    UpdateTooltip(GameObject, string)

    Tries to update the tooltip message of the Tooltip component in the given GameObject.

    Declaration
    private void UpdateTooltip(GameObject go, string message)
    Parameters
    Type Name Description
    GameObject go

    The GameObject that has a Tooltip.

    string message

    The new tooltip message.

    | Edit this page View Source

    UpdateUI(bool)

    Updates the UI without a forced round slider update.

    Declaration
    private void UpdateUI(bool running)
    Parameters
    Type Name Description
    bool running

    Indicates whether or not the simulation is currently running.

    | Edit this page View Source

    UpdateUI(bool, bool)

    Updates the UI (things like enable/disable buttons, set sliders, update rounds, set button colors, etc.).

    Declaration
    public void UpdateUI(bool running, bool forceRoundSliderUpdate)
    Parameters
    Type Name Description
    bool running

    Indicates whether or not the simulation is currently running.

    bool forceRoundSliderUpdate

    Indicates whether the round slider must be updated for a reason other than the simulation running (like pressing the step forward or step back button).

    • Edit this page
    • View Source
    In this article
    Back to top AmoebotSim 2.0 Documentation v1.11
    Copyright © 2025 AmoebotSim 2.0 Authors
    Generated by DocFX