Class ObjectUIHandler
Controls the object panel.
Inheritance
object
ObjectUIHandler
Namespace: AS2.UI
Assembly: .dll
Syntax
public class ObjectUIHandler : MonoBehaviour
Fields
|
Edit this page
View Source
attributeNameToIParticleAttribute
Declaration
private Dictionary<string, IParticleAttribute> attributeNameToIParticleAttribute
Field Value
|
Edit this page
View Source
attributeName_Color
Declaration
private readonly string attributeName_Color
Field Value
|
Edit this page
View Source
attributeName_Identifier
Declaration
private readonly string attributeName_Identifier
Field Value
|
Edit this page
View Source
Declaration
public Button button_anchor
Field Value
|
Edit this page
View Source
Declaration
public Color button_color_active
Field Value
|
Edit this page
View Source
Declaration
public Color button_color_default
Field Value
|
Edit this page
View Source
canvasGroup_objectPanel
Declaration
private CanvasGroup canvasGroup_objectPanel
Field Value
Type |
Description |
CanvasGroup |
|
|
Edit this page
View Source
go_attributeParent
Declaration
public GameObject go_attributeParent
Field Value
Type |
Description |
GameObject |
|
|
Edit this page
View Source
go_attributeRandomizationParent
Declaration
public GameObject go_attributeRandomizationParent
Field Value
Type |
Description |
GameObject |
|
|
Edit this page
View Source
go_contentParent
Declaration
public GameObject go_contentParent
Field Value
Type |
Description |
GameObject |
|
|
Edit this page
View Source
go_objectPanel
Declaration
public GameObject go_objectPanel
Field Value
Type |
Description |
GameObject |
|
|
Edit this page
View Source
headerText
Declaration
private TMPro.TextMeshProUGUI headerText
Field Value
Type |
Description |
TextMeshProUGUI |
|
|
Edit this page
View Source
image_anchor
Declaration
private Image image_anchor
Field Value
|
Edit this page
View Source
instance
Declaration
public static ObjectUIHandler instance
Field Value
|
Edit this page
View Source
obj
Declaration
Field Value
|
Edit this page
View Source
settingColor
Declaration
private UISetting_Color settingColor
Field Value
|
Edit this page
View Source
settingID
Declaration
private UISetting_Text settingID
Field Value
|
Edit this page
View Source
settings
Declaration
private Dictionary<string, UISetting> settings
Field Value
Type |
Description |
Dictionary<string, UISetting> |
|
|
Edit this page
View Source
settings_randomization
Declaration
private Dictionary<string, GameObject> settings_randomization
Field Value
Type |
Description |
Dictionary<string, GameObject> |
|
|
Edit this page
View Source
sim
Declaration
private AmoebotSimulator sim
Field Value
Methods
|
Edit this page
View Source
AddAttributes_IDAndColor(IObjectInfo, bool)
Adds the ID and color attributes to the object panel.
Declaration
private void AddAttributes_IDAndColor(IObjectInfo obj, bool initMode)
Parameters
Type |
Name |
Description |
IObjectInfo |
obj |
The selected object
|
bool |
initMode |
Indicates whether or not the system is
in Init Mode.
|
|
Edit this page
View Source
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
|
Edit this page
View Source
Called when the anchor button has been pressed.
Sets the current object as anchor.
Declaration
public void ButtonPressed_Anchor()
|
Edit this page
View Source
ClearPanel()
Clears the object panel. Removes all attributes and texts
after the delimiter, also clears all internally stored attributes.
Declaration
|
Edit this page
View Source
Close()
Declaration
|
Edit this page
View Source
GetShownObject()
Returns the currently shown object in the panel.
Before usage, please check if the panel is open and only use this method if this is the case.
Declaration
public IObjectInfo GetShownObject()
Returns
Type |
Description |
IObjectInfo |
The object currently associated to the panel.
|
|
Edit this page
View Source
IsOpen()
Checks if the object panel is open.
Declaration
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).
|
|
Edit this page
View Source
LockAttributes()
Locks the editing of the attributes.
Declaration
public void LockAttributes()
|
Edit this page
View Source
Open(IObjectInfo)
Opens the object panel for the selected object.
Declaration
public void Open(IObjectInfo obj)
Parameters
Type |
Name |
Description |
IObjectInfo |
obj |
The object that should be shown.
|
|
Edit this page
View Source
RefreshAttributes_IDAndColor()
Updates the ID and color settings.
Declaration
private void RefreshAttributes_IDAndColor()
|
Edit this page
View Source
RefreshHeader()
Updates the header (position, size and anchor information).
Declaration
private void RefreshHeader()
|
Edit this page
View Source
RefreshObjectPanel()
Updates the values in the object panel when shown.
Helpful when values have changed (e.g. after a round).
Declaration
public void RefreshObjectPanel()
|
Edit this page
View Source
ReinitObjectPanel(IObjectInfo, bool)
Internal method. Reopens the object panel with the specified object. Called by the Open(..) method.
Declaration
private void ReinitObjectPanel(IObjectInfo obj, bool initMode)
Parameters
Type |
Name |
Description |
IObjectInfo |
obj |
The object for which the panel should be initialized.
|
bool |
initMode |
Indicates whether or not the system is in Init Mode.
|
|
Edit this page
View Source
SettingChanged_Color(string, string)
Declaration
private void SettingChanged_Color(string name, string value)
Parameters
Type |
Name |
Description |
string |
name |
|
string |
value |
|
|
Edit this page
View Source
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.
|
|
Edit this page
View Source
SimState_RoundChanged()
Notifies the object panel that the round has been changed, so it can refresh.
Declaration
public void SimState_RoundChanged()
|
Edit this page
View Source
SimState_RunningToggled(bool)
Notifies the object panel that the system is running/not running.
Locks or unlocks the attributes, so that changes during runtime are not possible.
Declaration
public void SimState_RunningToggled(bool running)
Parameters
Type |
Name |
Description |
bool |
running |
|
|
Edit this page
View Source
Start()
Declaration
|
Edit this page
View Source
UnlockAttributes()
Unlocks the editing of the attributes.
Declaration
public void UnlockAttributes()
|
Edit this page
View Source
UpdateUI()
Called every frame. Used for dynamic updates of the visual interface.
Declaration