• Installation Guide
  • Amoebot Model
  • User Guide
  • Model Reference
  • Dev Guide
  • API Documentation
Search Results for

    Show / Hide Table of Contents
    • AS2
      • AlgorithmGenerator
      • AlgorithmGeneratorEditor
      • AlgorithmManager
      • AlgorithmManager.AlgorithmInfo
      • AmoebotFunctions
      • AmoebotSimulator
      • CameraUtils
      • CellRect
      • CellRect.CellRect_Iterator
      • ColorData
      • Config
      • ConfigData
      • ConfigData.AdditionalConfiguration
      • ConfigData.SettingsMenu
      • ConfigurationEditor
      • ConfigurationEditorBehavior
      • Constants
      • Direction
      • DirectionHelpers
      • EventDatabase
      • FileBrowser
      • FileBrowser.FileTypeHandler
      • FilePaths
      • InitModeSaveData
      • InitParticleSaveData
      • InitRandomWithHoles
      • Initialization
      • Initialization.Chirality
      • Initialization.Compass
      • InitializationMethod
      • InitializationMethod.DistanceSortedVectorList
      • InitializationMethodManager
      • InitializationMethodManager.AlgorithmInfo
      • InitializationStateSaveData
      • Log
      • MaterialDatabase
      • MessageSaveData
      • MinMax
      • MouseController
      • PSPlacementMode
      • ParticleAttributeEnumSaveData
      • ParticleAttributePCSaveData
      • ParticleAttributeSaveDataBase
      • ParticleAttributeSaveData<T>
      • ParticleObjectSaveData
      • ParticleStateSaveData
      • PinConfigurationHistorySaveData
      • PinConfigurationSaveData
      • RandomNumberGenerator
      • SaveStateUtility
      • SimulationStateSaveData
      • StatusInfoAttribute
      • TypeConverter
      • TypeConverter.ConversionResult
      • UIDatabase
      • ValueHistorySaveData<T>
    • AS2.Algos.BeepFailureTest
      • BeepFailureTestParticle
    • AS2.Algos.BinOpTest
      • BinOpTestInitializer
      • BinOpTestParticle
      • BinOpTestParticle.Mode
    • AS2.Algos.BoundaryTest
      • BoundaryTestParticle
      • Phase
      • SCMode
    • AS2.Algos.BoundaryTestSub
      • BoundaryTestSubParticle
    • AS2.Algos.ChiralityCompass
      • ChiralityAndCompassInitializer
      • ChiralityAndCompassParticle
      • CoinTossResult
      • DirectionMessage
    • AS2.Algos.CollisionTestAlgo
      • CollisionTestAlgoInitializer
      • CollisionTestAlgoParticle
    • AS2.Algos.CollisionTestAlgo2
      • CollisionTestAlgo2Initializer
      • CollisionTestAlgo2Particle
      • Role
    • AS2.Algos.ExpandedCircuitTest
      • ExpandedCircuitTestInitializer
      • ExpandedCircuitTestParticle
    • AS2.Algos.JMTest
      • JMTestInitializer
      • JMTestParticle
    • AS2.Algos.LeaderElection
      • LeaderElectionInitializer
      • LeaderElectionParticle
    • AS2.Algos.LineFormation
      • LineFormationInitializer
      • LineFormationParticleSync
      • LineFormationParticleSync.LFState
      • MyMessage
      • MyMessage.Direction
    • AS2.Algos.ObjectTest
      • ObjectTestInitializer
      • ObjectTestParticle
    • AS2.Algos.PASCTestAlgo
      • PASCTestAlgoInitializer
      • PASCTestAlgoParticle
    • AS2.Algos.SingleSourceSP
      • SingleSourceSPInitializer
      • SingleSourceSPParticle
      • SingleSourceSPParticle.Phase
    • AS2.Algos.SmartMaterial
      • SmartMaterialInitializer
      • SmartMaterialParticle
    • AS2.Algos.SubroutineTest
      • SubroutineTestInitializer
      • SubroutineTestParticle
    • AS2.Algos.SubroutineTest2
      • SubroutineTest2Initializer
      • SubroutineTest2Particle
    • AS2.Sim
      • ActionType
      • AlgorithmException
      • AmoebotSimException
      • BondMovementInfo
      • BondMovementInfoList
      • Circuit
      • CollisionChecker
      • CollisionChecker.DebugLine
      • EdgeMovement
      • IParticleAttribute
      • IParticleObject
      • IReplayHistory
      • InitializationParticle
      • InvalidActionException
      • JointMovementInfo
      • Message
      • Neighbor<T>
      • OpenInitParticle
      • Particle
      • ParticleAction
      • ParticleAlgorithm
      • ParticleAttributeBase
      • ParticleAttributeFactory
      • ParticleAttributeWithHistory<T>
      • ParticleAttribute_Bool
      • ParticleAttribute_Direction
      • ParticleAttribute_Enum<T>
      • ParticleAttribute_Float
      • ParticleAttribute_Int
      • ParticleAttribute_PinConfiguration
      • ParticleAttribute_String
      • ParticleAttribute<T>
      • ParticleException
      • ParticleFactory
      • ParticleObject
      • ParticleSystem
      • ParticleSystem_Utils
      • PartitionSet
      • Pin
      • PinConfiguration
      • SimulationException
      • SimulatorException
      • SimulatorStateException
      • SysPartitionSet
      • SysPin
      • SysPinConfiguration
      • ValueHistoryBondInfo
      • ValueHistoryJointMovement
      • ValueHistoryMessage
      • ValueHistoryPinConfiguration
      • ValueHistory<T>
    • AS2.Subroutines
      • Subroutine
    • AS2.Subroutines.BinStateHelpers
      • BinAttributeBitField
      • BinAttributeBool
      • BinAttributeDirection
      • BinAttributeEnum<T>
      • BinAttributeInt
      • BinAttribute<T>
    • AS2.Subroutines.BinaryOps
      • BinOpUtils
      • SubAddition
      • SubBinOps
      • SubBinOps.Mode
      • SubComparison
      • SubComparison.ComparisonResult
      • SubDivision
      • SubMSBDetection
      • SubMultiplication
      • SubSubtraction
    • AS2.Subroutines.BoundaryTest
      • SubBoundaryTest
    • AS2.Subroutines.ETT
      • Comparison
      • SubETT
    • AS2.Subroutines.LeaderElection
      • SubLeaderElection
    • AS2.Subroutines.LeaderElectionFast
      • SubLeaderElectionFast
    • AS2.Subroutines.LeaderElectionSync
      • SubLeaderElectionSync
    • AS2.Subroutines.PASC
      • SubPASC
      • SubPASC2
      • SubPASC2.NbrType
    • AS2.UI
      • ButtonHoldTrigger
      • ClickAction
      • ClickAction.ClickButton
      • ClickAction.ClickType
      • InitializationUIHandler
      • InputAction
      • InputAction.InputType
      • InputController
      • InputHandler
      • InputHandler.MouseState
      • InputManager
      • LineDrawer
      • LogUIHandler
      • LogUIHandler.EntryType
      • ObjectUIHandler
      • ParticleUIExtensionSmoothLerp
      • ParticleUIHandler
      • SettingsUIHandler
      • SizeFitter
      • Tooltip
      • TooltipHandler
      • UIHandler
      • UIHandler.UITool
      • UISetting
      • UISetting_Color
      • UISetting_Color.InputType
      • UISetting_Dropdown
      • UISetting_Header
      • UISetting_MinMax
      • UISetting_MinMax.InputType
      • UISetting_Slider
      • UISetting_Spacing
      • UISetting_Text
      • UISetting_Text.InputType
      • UISetting_Toggle
      • UISetting_ValueSlider
      • WorldSpaceBackgroundUIHandler
      • WorldSpaceUIHandler
      • WorldSpaceUIHandler.ParticleTextUIData
      • WorldSpaceUIHandler.TextType
    • AS2.Visuals
      • CircleDistributionCircleArea
      • CircleDistributionCircleLine
      • IGenerateDynamicMesh
      • IObjectInfo
      • IParticleGraphicsAdapter
      • IParticleState
      • InstancedDrawer
      • MaterialPropertyBlockData
      • MaterialPropertyBlockData_Circuits
      • MaterialPropertyBlockData_Objects
      • MaterialPropertyBlockData_Particles
      • MeshCreator_CircularView
      • MeshCreator_HexagonalView
      • ObjectGraphicsAdapter
      • ObjectGraphicsAdapter.VertexInfo
      • PSetDragHandler
      • ParticleBondGraphicState
      • ParticleGraphicsAdapterImpl
      • ParticleGraphicsAdapterImpl.ParticleMovement
      • ParticleGraphicsAdapterImpl.PositionSnap
      • ParticleJointMovementState
      • ParticleMovementState
      • ParticlePinGraphicState
      • ParticlePinGraphicState.CodeOverrideType_Node
      • ParticlePinGraphicState.NeighborPinConnection
      • ParticlePinGraphicState.PSetData
      • ParticlePinGraphicState.PSetData.GraphicalData
      • ParticlePinGraphicState.PSetData.GraphicalData.CodeOverrideType_PSet
      • ParticlePinGraphicState.PinDef
      • PartitionSetViewType
      • Polar2DCoordinate
      • PriorityQueue<T>
      • RenderBatchIndex
      • RenderSystem
      • RendererBackground
      • RendererCircuitPins_RenderBatch
      • RendererCircuitPins_RenderBatch.PropertyBlockData
      • RendererCircuitsAndBonds
      • RendererCircuits_Instance
      • RendererCircuits_Instance.GDRef
      • RendererCircuits_Instance.ParticleCircuitData
      • RendererCircuits_Instance.ParticleCircuitData.PSetInnerPinRef
      • RendererCircuits_Instance.ParticleCircuitData.PSetInnerPinRef.PinType
      • RendererCircuits_RenderBatch
      • RendererCircuits_RenderBatch.PropertyBlockData
      • RendererCircuits_RenderBatch.PropertyBlockData.ActiveState
      • RendererCircuits_RenderBatch.PropertyBlockData.LineType
      • RendererObjects
      • RendererParticles
      • RendererParticles_RenderBatch
      • RendererParticles_RenderBatch.PropertyBlockData
      • RendererUI
      • TextureCreator
      • ViewType
    • AS2.Visuals.Library
      • DegreeConstants
      • InterpolationConstants
      • MatrixConstants
      • MeshConstants
      • VectorConstants
      • BasicSample
      • CanvasSampleSaveFileImage
      • CanvasSampleSaveFileText
      • HexagonalExpansionPrototype

    Class ParticleUIHandler

    Controls the particle panel.

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

    Fields

    attributeNameToIParticleAttribute

    Declaration
    private Dictionary<string, IParticleAttribute> attributeNameToIParticleAttribute
    Field Value
    Type Description
    Dictionary<string, IParticleAttribute>

    button_color_active

    Declaration
    public Color button_color_active
    Field Value
    Type Description
    Color

    button_color_default

    Declaration
    public Color button_color_default
    Field Value
    Type Description
    Color

    button_rootParticle

    Declaration
    public Button button_rootParticle
    Field Value
    Type Description
    Button

    canvasGroup_particlePanel

    Declaration
    private CanvasGroup canvasGroup_particlePanel
    Field Value
    Type Description
    CanvasGroup

    go_attributeParent

    Declaration
    public GameObject go_attributeParent
    Field Value
    Type Description
    GameObject

    go_attributeRandomizationParent

    Declaration
    public GameObject go_attributeRandomizationParent
    Field Value
    Type Description
    GameObject

    go_contentParent

    Declaration
    public GameObject go_contentParent
    Field Value
    Type Description
    GameObject

    go_particlePanel

    Declaration
    public GameObject go_particlePanel
    Field Value
    Type Description
    GameObject

    headerText

    Declaration
    private TMPro.TextMeshProUGUI headerText
    Field Value
    Type Description
    TextMeshProUGUI

    image_rootParticle

    Declaration
    private Image image_rootParticle
    Field Value
    Type Description
    Image

    instance

    Declaration
    public static ParticleUIHandler instance
    Field Value
    Type Description
    ParticleUIHandler

    particle

    Declaration
    private IParticleState particle
    Field Value
    Type Description
    IParticleState

    settings

    Declaration
    private Dictionary<string, UISetting> settings
    Field Value
    Type Description
    Dictionary<string, UISetting>

    settings_randomization

    Declaration
    private Dictionary<string, GameObject> settings_randomization
    Field Value
    Type Description
    Dictionary<string, GameObject>

    sim

    Declaration
    private AmoebotSimulator sim
    Field Value
    Type Description
    AmoebotSimulator

    Methods

    AddAttribute(IParticleAttribute)

    Adds a particle attribute to the particle panel.

    Declaration
    public void AddAttribute(IParticleAttribute particleAttribute)
    Parameters
    Type Name Description
    IParticleAttribute particleAttribute

    The attribute to be added.

    AddAttributes_ChiralityAndCompassDir(IParticleState, bool)

    Adds the chirality and compass dir attributes to the particle panel attributes. These attributes are contained in all possible particles.

    Declaration
    public void AddAttributes_ChiralityAndCompassDir(IParticleState p, bool initMode)
    Parameters
    Type Name Description
    IParticleState p

    The selected particle.

    bool initMode

    Indicates whether or not the system is in Init Mode.

    AddStatusInfoButtons(IParticleState)

    Adds buttons for calling the current algorithm's status info methods, in case it has defined any.

    Declaration
    private void AddStatusInfoButtons(IParticleState p)
    Parameters
    Type Name Description
    IParticleState p

    The currently selected particle.

    AttributeChangeValid()

    Returns true if the attribute is allowed to be changed. The particle panel must be active and the system has to be in the latest round while being paused to do so.

    Declaration
    private bool AttributeChangeValid()
    Returns
    Type Description
    bool

    AttributeClicked(string)

    Called when an attribute has been clicked. Opens the world space UI overlay which shows this attribute's state for all particles.

    Declaration
    public void AttributeClicked(string name)
    Parameters
    Type Name Description
    string name

    The name of the clicked attribute.

    ButtonPressed_Randomize(string, bool)

    Callback for when a randomization button has been pressed. Gives the associated attribute a random value on either just the selected particle or all particles.

    Declaration
    public void ButtonPressed_Randomize(string attributeName, bool randomizeAll)
    Parameters
    Type Name Description
    string attributeName

    The name of the associated attribute.

    bool randomizeAll

    Indicates whether all particles should get a random value for this attribute.

    ButtonPressed_RootParticle()

    Called when the root particle button has been pressed. Sets the current particle as root particle.

    Declaration
    public void ButtonPressed_RootParticle()

    ClearPanel()

    Clears the particle panel. Removes all attributes and texts after the delimiter, also clears all internally stored attributes.

    Declaration
    public void ClearPanel()

    Close()

    Closes the particle panel.

    Declaration
    public void Close()

    GetShownParticle()

    Returns the currently shown particle in the panel. Before usage, please check if the panel is open and only use this method if this is the case.

    Declaration
    public IParticleState GetShownParticle()
    Returns
    Type Description
    IParticleState

    The particle currently associated to the panel.

    InitRandomizationGameObject(GameObject, string)

    Adds listeners to the given randomization button panel.

    Declaration
    public void InitRandomizationGameObject(GameObject dicePanel, string attributeName)
    Parameters
    Type Name Description
    GameObject dicePanel

    The panel holding two randomization buttons, one for setting a single random value and one for setting all random values.

    string attributeName

    The name of the attribute affected by the randomization.

    IsOpen()

    Checks if the particle panel is open.

    Declaration
    public bool IsOpen()
    Returns
    Type Description
    bool

    true if and only if the panel is open, indicated by its alpha value being 1 (i.e. the panel is not transparent).

    LockAttributes()

    Locks the editing of the attributes.

    Declaration
    public void LockAttributes()

    Open(IParticleState)

    Opens the particle panel for the defined particle.

    Declaration
    public void Open(IParticleState p)
    Parameters
    Type Name Description
    IParticleState p

    The particle that should be shown.

    RefreshAttribute(IParticleAttribute)

    Updates the specific attribute.

    Declaration
    private void RefreshAttribute(IParticleAttribute particleAttribute)
    Parameters
    Type Name Description
    IParticleAttribute particleAttribute

    The attribute to be refreshed.

    RefreshAttributes_ChiralityAndCompassDir()

    Updates chirality and compass dir.

    Declaration
    private void RefreshAttributes_ChiralityAndCompassDir()

    RefreshHeader()

    Updates the header (position, expansion and anchor information).

    Declaration
    private void RefreshHeader()

    RefreshParticlePanel()

    Updates the values in the particle panel when shown. Helpful when values have changed (e.g. after a round).

    Declaration
    private void RefreshParticlePanel()

    ReinitParticlePanel(IParticleState, bool)

    Internal method. Reopens the particle panel with the specified particle. Called by the Open(..) method.

    Declaration
    private void ReinitParticlePanel(IParticleState p, bool initMode)
    Parameters
    Type Name Description
    IParticleState p

    The particle for which the panel should be initialized.

    bool initMode

    Indicates whether or not the system is in Init Mode.

    SettingChanged_Dropdown(string, string)

    Called when one attribute has been changed by the user. Forwards this to the particle system and refreshes the relevant UI.

    Declaration
    private void SettingChanged_Dropdown(string name, string value)
    Parameters
    Type Name Description
    string name

    The name of the attribute.

    string value

    SettingChanged_Text(string, string)

    Called when one attribute has been changed by the user. Forwards this to the particle system and refreshes the relevant UI.

    Declaration
    private void SettingChanged_Text(string name, string text)
    Parameters
    Type Name Description
    string name

    The name of the attribute.

    string text

    The new value of the attribute.

    SettingChanged_Toggle(string, bool)

    Called when one attribute has been changed by the user. Forwards this to the particle system and refreshes the relevant UI.

    Declaration
    private void SettingChanged_Toggle(string name, bool isOn)
    Parameters
    Type Name Description
    string name

    The name of the attribute.

    bool isOn

    SettingChanged_Value(string, float)

    Called when one attribute has been changed by the user. Forwards this to the particle system and refreshes the relevant UI.

    Declaration
    private void SettingChanged_Value(string name, float value)
    Parameters
    Type Name Description
    string name

    The name of the attribute.

    float value

    The new value of the attribute.

    SettingHeldDown(string, float)

    Called when a particle attribute has been clicked and held for some time. This should take the value of the attribute and set it at all other particles.

    Declaration
    private void SettingHeldDown(string name, float duration)
    Parameters
    Type Name Description
    string name

    The name of the attribute.

    float duration

    The duration for which it was held down.

    SimState_RoundChanged()

    Notifies the particle panel that the round has been changed, so it can refresh.

    Declaration
    public void SimState_RoundChanged()

    SimState_RunningToggled(bool)

    Notifies the particle panel that the system is running/not running. Locks or unlocks the particle attributes, so that changes during runtime are not possible.

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

    Start()

    Declaration
    private void Start()

    UnlockAttributes()

    Unlocks the editing of the attributes.

    Declaration
    public void UnlockAttributes()

    UpdateUI()

    Called every frame. Used for dynamic updates of the visual interface.

    Declaration
    public void UpdateUI()
    In this article
    Back to top AmoebotSim 2.0 Documentation v1.11
    Copyright © 2025 AmoebotSim 2.0 Authors
    Generated by DocFX