Search Results for

    Show / Hide Table of Contents

    Class WorldSpaceUIHandler

    Controls the world space UI overlay (which shows the attributes of the particles).

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

    Constructors

    | Edit this page View Source

    WorldSpaceUIHandler()

    Declaration
    public WorldSpaceUIHandler()

    Fields

    | Edit this page View Source

    asciiDirectionArrows

    Declaration
    private Dictionary<Direction, string> asciiDirectionArrows
    Field Value
    Type Description
    Dictionary<Direction, string>
    | Edit this page View Source

    button_hideOverlay

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

    cameraRotation

    Declaration
    private float cameraRotation
    Field Value
    Type Description
    float
    | Edit this page View Source

    color_particleTextBackgroundClockwise

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

    color_particleTextBackgroundCounterClockwise

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

    color_particleTextBackgroundDefault

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

    color_particleTextBackgroundFalse

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

    color_particleTextBackgroundTrue

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

    display_identifier

    Declaration
    private string display_identifier
    Field Value
    Type Description
    string
    | Edit this page View Source

    display_isVisible

    Declaration
    private bool display_isVisible
    Field Value
    Type Description
    bool
    | Edit this page View Source

    display_type

    Declaration
    private WorldSpaceUIHandler.TextType display_type
    Field Value
    Type Description
    WorldSpaceUIHandler.TextType
    | Edit this page View Source

    font_arrows

    Declaration
    public TMP_FontAsset font_arrows
    Field Value
    Type Description
    TMP_FontAsset
    | Edit this page View Source

    font_basic

    Declaration
    public TMP_FontAsset font_basic
    Field Value
    Type Description
    TMP_FontAsset
    | Edit this page View Source

    font_circles

    Declaration
    public TMP_FontAsset font_circles
    Field Value
    Type Description
    TMP_FontAsset
    | Edit this page View Source

    go_worldSpaceUI

    Declaration
    public GameObject go_worldSpaceUI
    Field Value
    Type Description
    GameObject
    | Edit this page View Source

    instance

    Declaration
    public static WorldSpaceUIHandler instance
    Field Value
    Type Description
    WorldSpaceUIHandler
    | Edit this page View Source

    isVisible

    Declaration
    private bool isVisible
    Field Value
    Type Description
    bool
    | Edit this page View Source

    particleTextUIData

    Declaration
    public Dictionary<IParticleState, WorldSpaceUIHandler.ParticleTextUIData> particleTextUIData
    Field Value
    Type Description
    Dictionary<IParticleState, WorldSpaceUIHandler.ParticleTextUIData>
    | Edit this page View Source

    pool_particleTextUI

    Declaration
    private Stack<GameObject> pool_particleTextUI
    Field Value
    Type Description
    Stack<GameObject>
    | Edit this page View Source

    showCompassDirArrows

    Declaration
    public bool showCompassDirArrows
    Field Value
    Type Description
    bool
    | Edit this page View Source

    tempParticleStack

    Declaration
    private Stack<IParticleState> tempParticleStack
    Field Value
    Type Description
    Stack<IParticleState>

    Methods

    | Edit this page View Source

    AddParticleTextUI(IParticleState, Vector2, bool)

    Adds a particle to the overlay system.

    Declaration
    public GameObject AddParticleTextUI(IParticleState particle, Vector2 particlePosition, bool isVisible = true)
    Parameters
    Type Name Description
    IParticleState particle

    The particle to add.

    Vector2 particlePosition

    The initial position of the particle.

    bool isVisible

    If the particle overlay is initially visible.

    Returns
    Type Description
    GameObject

    The GameObject holding the overlay text.

    | Edit this page View Source

    DisplayText(TextType, string, bool)

    Displays the overlay over every particle that has the given attribute/value/text.

    Declaration
    public void DisplayText(WorldSpaceUIHandler.TextType type, string identifier, bool showOverlay = true)
    Parameters
    Type Name Description
    WorldSpaceUIHandler.TextType type

    The type of data to display.

    string identifier

    Identifier of the field to be displayed, e.g., an attribute name.

    bool showOverlay

    Determines whether the overlay should be shown.

    | Edit this page View Source

    DisplayTextForParticle(IParticleState)

    Displays the currently set overlay for a given particle.

    Declaration
    private void DisplayTextForParticle(IParticleState particle)
    Parameters
    Type Name Description
    IParticleState particle

    The particle for which the overlay should be displayed.

    | Edit this page View Source

    HideAll()

    Hides the world space UI and clears the line drawer. Call ShowVisible() to show the current overlay again.

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

    IsActive()

    Checks if the UI is active.

    Declaration
    public bool IsActive()
    Returns
    Type Description
    bool

    true if and only if the UI overlay is currently active.

    | Edit this page View Source

    ParticleUpdate(IParticleState, Vector3)

    Called by every particle after their regular movement updates.

    Declaration
    public void ParticleUpdate(IParticleState particle, Vector3 curPos)
    Parameters
    Type Name Description
    IParticleState particle

    The particle that should be updated.

    Vector3 curPos

    The current world position of the particle.

    | Edit this page View Source

    PoolCreate_particleTextUI(IParticleState, bool)

    Makes a new text overlay GameObject available using the pooling mechanism.

    Declaration
    public GameObject PoolCreate_particleTextUI(IParticleState particle, bool isVisible)
    Parameters
    Type Name Description
    IParticleState particle

    The particle to which the text overlay should belong.

    bool isVisible

    Determines whether the overlay element should be visible.

    Returns
    Type Description
    GameObject

    The new text overlay GameObject.

    | Edit this page View Source

    PoolRealease_particleTextUI(IParticleState)

    Releases the text overlay element belonging to the given particle and returns it to the pool.

    Declaration
    public void PoolRealease_particleTextUI(IParticleState particle)
    Parameters
    Type Name Description
    IParticleState particle

    The particle whose overlay should be released.

    | Edit this page View Source

    Refresh()

    Refreshes the overlay if it is already shown. Call this when something has changed in the shown attributes.

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

    RemoveParticleTextUI(IParticleState)

    Removes a particle from the overlay system.

    Declaration
    public bool RemoveParticleTextUI(IParticleState particle)
    Parameters
    Type Name Description
    IParticleState particle

    The particle to remove.

    Returns
    Type Description
    bool

    true if and only if the given particle was successfully removed.

    | Edit this page View Source

    SetCameraRotation(float)

    Sets the rotation of the particle overlay. Use this in combination with the global rotation of the main camera.

    Declaration
    public void SetCameraRotation(float cameraRotationDegrees)
    Parameters
    Type Name Description
    float cameraRotationDegrees

    The main camera's current rotation in degrees.

    | Edit this page View Source

    ShowVisible()

    Shows the world space UI (all elements that are flagged as visible). This is the default value. Call HideAll() to hide it.

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

    Start()

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

    SwitchInitSimMode(bool)

    Listener for the Init/Simulation Mode switch event. Disables the attribute overlay when the Mode is changed.

    Declaration
    private void SwitchInitSimMode(bool initMode)
    Parameters
    Type Name Description
    bool initMode

    Whether Init Mode was opened (the value is ignored).

    | Edit this page View Source

    UpdateParticleText(IParticleState, bool)

    Updates the particle overlay for a single particle with a "True" or "False" text. Also sets a color based on the true/false value.

    Declaration
    private void UpdateParticleText(IParticleState particle, bool isTrue)
    Parameters
    Type Name Description
    IParticleState particle

    The particle for which the overlay should be updated.

    bool isTrue

    The truth value to display.

    | Edit this page View Source

    UpdateParticleText(IParticleState, string)

    Updates the particle overlay for a single particle with a text.

    Declaration
    private void UpdateParticleText(IParticleState particle, string text)
    Parameters
    Type Name Description
    IParticleState particle

    The particle for which the overlay should be updated.

    string text

    The text to display.

    | Edit this page View Source

    UpdateParticleTextPosition(IParticleState, Vector2)

    Updates the position of the particle overlay.

    Declaration
    private void UpdateParticleTextPosition(IParticleState particle, Vector2 particlePosition)
    Parameters
    Type Name Description
    IParticleState particle

    The particle for which the position of the overlay should be updated.

    Vector2 particlePosition

    The new overlay position.

    | Edit this page View Source

    UpdateParticleText_Chirality(IParticleState, bool)

    Updates the particle overlay for a single particle with a text showing its chirality. The chirality is displayed using an ASCII character that shows a circular arrow.

    Declaration
    private void UpdateParticleText_Chirality(IParticleState particle, bool counterClockwise)
    Parameters
    Type Name Description
    IParticleState particle

    The particle for which the overlay should be updated.

    bool counterClockwise

    The chirality to set.

    | Edit this page View Source

    UpdateParticleText_CompassDir(IParticleState, Direction)

    Updates the particle overlay for a single particle with a text showing its compass direction. The direction is displayed using an ASCII character that shows an arrow, if this is enabled.

    Declaration
    private void UpdateParticleText_CompassDir(IParticleState particle, Direction compassDir)
    Parameters
    Type Name Description
    IParticleState particle

    The particle for which the overlay should be updated.

    Direction compassDir

    The compass dir to display.

    • 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