-
Notifications
You must be signed in to change notification settings - Fork 0
Property inheritance
In some case you will need to make your own Property component. To understand how to do that, you can check the source code of Property2 or Property3 components.
You can find them in your Unity Project tab : "Assets/Plugins/Nectunia/PropertyInterface/Package/Scripts/Components/".
To create a component wich will be able to interact with Property, see Create your Tagged component instead.
Bellow you will find an example that do nothing more than Property component but implements all you need to make your own Property child:
using UnityEngine;
using System;
using Nectunia.PropertyInterface;/// <summary>
/// My new Property component
/// </summary>
[Serializable]
public class MyProperty : Property {
// Add your attributs here. Don't forget to add [SerializeField] for thoose wich need to be drawn in Editor
// .../// <summary>
/// Set the Tag.ValueType for all PropertyValue.
/// </summary>
public override void SetValuesType () {
base.SetValuesType();
}/// <summary>
/// Set a new Property.SourceType for all PropertyValue.
/// </summary>
/// The new Property.SourceType.
protected override void SetValuesSourceType (SourceType newType) {
base.SetValuesSourceType(newType);
}
/// <summary>
/// Set a new Component for all PropertyValue.
/// </summary>
/// The new Component.
protected override void SetValuesComponent (Component newComponent) {
base.SetValuesComponent(newComponent);
}
/// <summary>
/// Refresh all object values with the serializedValues.
/// </summary>
public override void RefreshValuesObject () {
base.RefreshValuesObject();
}/// <summary>
/// Synchronize the values with their sources if need.
/// </summary>
public override void SynchronizeValues () {
base.SynchronizeValues();
}
/// <summary>
/// Check if the sources of the values are set or not.
/// </summary>
///
/// True if at least one value.Source is set. False otherwise.
///
public override bool AtLeastOneSourceIsSet () {
return base.AtLeastOneSourceIsSet();
}
}
Home
First look
What about performance ?
Tag
Tag overview
Export Tags
Import Tags
Property
Property overview
Setting a Property
Property Updater
Property inheritance
Find Property by script
Editor GUI
EditorGUI_PropertyInterface
EditorGUILayout_PropertyInterfac
MonoBehaviourTagged
Tagged component overview
Built in tagged component
Create my tagged component
Find MonoBehaviourTagged by script
Error
Null propagating operator
Scripting
Classes descriptions