Custom UI Element
public class CustomUIElement : MonoBehaviour, IUIElement
{
// UI Manager filters the data based on keys.
// If the data doesn't contain this key, UI Manager never
// forwards that data to this element.
public string Key => "myCustomKey";
public void BuildContent(UIContentData data)
{
// content building logic comes here.
}
}UI Content Data
// return the existing keys in this content
public List<string> Keys;
// Add a new paramter to the content
// If the key already exist you can choose whether or not to overwrite.
public void Add(string key, object value, bool overwrite = false)
// Get the value of the given key (if none found use the default value)
public T Get<T>(string key, T defaultValue)
// Does the parameter with the given key match the type?
public bool IsType<T>(string key)Last updated