Class SUiElement<T>
Inheritance
SUiElement<T>
Namespace: SUI
Assembly: SonsSdk.dll
Syntax
public class SUiElement<T> : SUiElement
Type Parameters
Constructors
SUiElement(GameObject)
Declaration
public SUiElement(GameObject root)
Parameters
Type |
Name |
Description |
GameObject |
root |
|
Fields
TextObject
Declaration
protected TMP_Text TextObject
Field Value
Type |
Description |
TMP_Text |
|
VisibilityObservable
Declaration
protected Observable<bool> VisibilityObservable
Field Value
Properties
this[string]
Declaration
public SUiElement this[string id] { get; }
Parameters
Type |
Name |
Description |
string |
id |
|
Property Value
Methods
Active(bool)
Set the root gameobject to active or inactive
Declaration
public T Active(bool active)
Parameters
Type |
Name |
Description |
bool |
active |
|
Returns
Add(SUiElement)
Declaration
public virtual T Add(SUiElement element)
Parameters
Returns
Anchor(AnchorType)
Declaration
public T Anchor(AnchorType anchorType)
Parameters
Returns
AspectRatio(AspectMode)
Sets the aspect ratio mode for the objects's aspect ratio fitter.
Declaration
public T AspectRatio(AspectRatioFitter.AspectMode mode)
Parameters
Type |
Name |
Description |
AspectMode |
mode |
The aspect ratio mode to apply.
|
Returns
BindVisibility(Observable<bool>)
Binds the visibility of the container to an observable boolean value.
Declaration
public T BindVisibility(Observable<bool> observable)
Parameters
Type |
Name |
Description |
Observable<bool> |
observable |
The observable boolean value to bind to.
|
Returns
Class(string)
Declaration
public T Class(string classes)
Parameters
Type |
Name |
Description |
string |
classes |
|
Returns
Dock(EDockType)
An abstraction of the anchor and offset settings
Declaration
public T Dock(EDockType type)
Parameters
Returns
Find<TObj>(string)
Finds a child object and returns it as a SUiElement
Declaration
public TObj Find<TObj>(string path) where TObj : SUiElement
Parameters
Type |
Name |
Description |
string |
path |
|
Returns
Type Parameters
FlexHeight(float)
Declaration
public T FlexHeight(float height)
Parameters
Type |
Name |
Description |
float |
height |
|
Returns
FlexWidth(float)
Declaration
public T FlexWidth(float width)
Parameters
Type |
Name |
Description |
float |
width |
|
Returns
FontAutoSize(bool)
Toggle auto sizing of the main text object
Declaration
public T FontAutoSize(bool enabled)
Parameters
Type |
Name |
Description |
bool |
enabled |
|
Returns
FontColor(string)
Declaration
public T FontColor(string color)
Parameters
Type |
Name |
Description |
string |
color |
|
Returns
FontColor(Color)
Set the font color of the main text object
Declaration
public T FontColor(Color color)
Parameters
Type |
Name |
Description |
Color |
color |
|
Returns
FontSize(int)
Set the font size of the main text object
Declaration
public virtual T FontSize(int size)
Parameters
Type |
Name |
Description |
int |
size |
|
Returns
HFill()
Sets the anchor and offsets to fill horizontally
Declaration
Returns
HOffset(float, float)
Set the vertical rect offset
Declaration
public T HOffset(float left, float right)
Parameters
Returns
Height(float)
Set the size delta height of the rect transform
Declaration
public T Height(float height)
Parameters
Type |
Name |
Description |
float |
height |
|
Returns
Id(string)
Declaration
Parameters
Type |
Name |
Description |
string |
id |
|
Returns
MHeight(float)
Set the minimum height of the layout element
Declaration
public T MHeight(float height)
Parameters
Type |
Name |
Description |
float |
height |
|
Returns
MWidth(float)
Set the minimum width of the layout element
Declaration
public T MWidth(float width)
Parameters
Type |
Name |
Description |
float |
width |
|
Returns
MaxOffset(int?, int?)
Set the maximum offset of the rect transform
Declaration
public T MaxOffset(int? x = null, int? y = null)
Parameters
Type |
Name |
Description |
int? |
x |
|
int? |
y |
|
Returns
MinOffset(int?, int?)
Set the minimum offset of the rect transform
Declaration
public T MinOffset(int? x = null, int? y = null)
Parameters
Type |
Name |
Description |
int? |
x |
|
int? |
y |
|
Returns
Name(string)
Declaration
public T Name(string name)
Parameters
Type |
Name |
Description |
string |
name |
|
Returns
OnClick(Action)
Fire an action when the container is clicked (FOR BUTTONS USE .Notify() INSTEAD)
Declaration
public T OnClick(Action action)
Parameters
Type |
Name |
Description |
Action |
action |
|
Returns
PHeight(float)
Set the preferred height of the layout element
Declaration
public T PHeight(float height)
Parameters
Type |
Name |
Description |
float |
height |
|
Returns
PWidth(float)
Set the preferred width of the layout element
Declaration
public T PWidth(float width)
Parameters
Type |
Name |
Description |
float |
width |
|
Returns
Pivot(float?, float?)
Declaration
public T Pivot(float? x = null, float? y = null)
Parameters
Returns
Position(float?, float?)
Set the anchor position of the rect transform
Declaration
public T Position(float? x, float? y = null)
Parameters
Returns
Ppu(float)
Sets the pixels per unit multiplier for the object's image.
Declaration
Parameters
Type |
Name |
Description |
float |
ppu |
|
Returns
RectPadding(float)
Set the offsets of the rect transform
Declaration
public T RectPadding(float padding)
Parameters
Type |
Name |
Description |
float |
padding |
|
Returns
RectPadding(float, float)
Set the offsets of the rect transform
Declaration
public T RectPadding(float rightLeft, float topBottom)
Parameters
Type |
Name |
Description |
float |
rightLeft |
|
float |
topBottom |
|
Returns
RectPadding(float, float, float, float)
Set the offsets of the rect transform
Declaration
public T RectPadding(float left, float right, float top, float bottom)
Parameters
Returns
RichText(string)
Set the text of the main text object as rich text
Declaration
public virtual T RichText(string text)
Parameters
Type |
Name |
Description |
string |
text |
|
Returns
Size(float?, float?)
Set the size delta of the rect transform
Declaration
public T Size(float? width = null, float? height = null)
Parameters
Returns
Size(Vector2)
Set the size delta of the rect transform
Declaration
public T Size(Vector2 size)
Parameters
Type |
Name |
Description |
Vector2 |
size |
|
Returns
Text(string)
Set the text of the main text object
Declaration
public virtual T Text(string text)
Parameters
Type |
Name |
Description |
string |
text |
|
Returns
Toggle()
Toggle the root gameobject
Declaration
Returns
UnbindVisibility()
Unbinds the visibility of the container from any previously bound observable.
Declaration
public T UnbindVisibility()
Returns
VFill()
Sets the anchor and offsets to fill vertically
Declaration
Returns
VOffset(float, float)
Set the horizontal rect offset
Declaration
public T VOffset(float top, float bottom)
Parameters
Returns
VisibilityObservalbleChanged(bool)
Declaration
protected virtual void VisibilityObservalbleChanged(bool value)
Parameters
Type |
Name |
Description |
bool |
value |
|
Visible(bool)
Set the visibility of the element (by setting the alpha and blocking raycasts)
Declaration
public T Visible(bool visible)
Parameters
Type |
Name |
Description |
bool |
visible |
|
Returns
Width(float)
Set the size delta width of the rect transform
Declaration
public T Width(float width)
Parameters
Type |
Name |
Description |
float |
width |
|
Returns