This repository has been archived by the owner on Mar 25, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Creating custom rVars
pointcache edited this page Jan 15, 2017
·
4 revisions
To start creating your own Reactive Variables take a look at
- Move it somewhere outside of URSA folder.
- Open
CustomRVars
file. - Duplicate this block , uncomment it , and fill in your own type
/*
[Serializable]
public class r_TYPE : rVar<TYPE>
{
public r_TYPE() : base() {}
public r_TYPE(TYPE initialValue): base(initialValue){}
public static implicit operator TYPE(r_TYPE var) { return var.Value; }
}
*/
[Serializable]
public class r_Vector6 : rVar<Vector6>
{
public r_Vector6 () : base() {}
public r_Vector6 (Vector6 initialValue): base(initialValue){}
public static implicit operator Vector6(r_Vector6 var) { return var.Value; }
}
- Open
CustomRVarsDrawers
file - Uncomment this block and add your custom types on top
/*
[UnityEditor.CustomPropertyDrawer(typeof(r_TYPE1))]
[UnityEditor.CustomPropertyDrawer(typeof(r_TYPE2))]
[UnityEditor.CustomPropertyDrawer(typeof(r_TYPE3))]
public class ExtendInspectorDisplayDrawer : rVarDrawer { }
*/
/*
[UnityEditor.CustomPropertyDrawer(typeof(r_TYPE1))]
[UnityEditor.CustomPropertyDrawer(typeof(r_TYPE2))]
*/
[UnityEditor.CustomPropertyDrawer(typeof(r_Vector6))]
public class ExtendInspectorDisplayDrawer : rVarDrawer { }
Done.