Skip to content
This repository was archived by the owner on Mar 25, 2020. It is now read-only.

Component

pointcache edited this page Jan 15, 2017 · 2 revisions

Component in URSA is a class that is inherited from ComponentBase and uses this template:

public class NewComponent : ComponentBase {

    public Data data;
    [Serializable]
    public class Data : SerializedData
    {

    }

    public override void OnEnable()
    {
        base.OnEnable();
    }

    public override void OnDisable()
    {
        base.OnDisable();
    }
}

This structure must be followed verbatim when creating your own components, for ease, please use EditorTemplates that allow you to quickly create new components.

We are forced to use public override void OnEnable() Due to how Unity handles "messages", these calls must be on topmost class in hierarchy.

Clone this wiki locally