Documentation

Page contents

Updated

Generate PDF from page.

Value units

Description

A unit can be added to property fields from inspector.

Reference

Add Components – Add the required components that are not present in the current gameobject.

Use

Each field construction method has an overload with an string parameter which will set the units.

In this example you can see that the last parameter of each method is the units of each field.

public override void OnInspectorGUI()
{
     CGFEditorUtilities.BuildInt("Integer", "All integer values", _int, "cm/s");
     CGFEditorUtilities.BuildIntPositive("Positive Int", "Only positive integer values", _positiveInt, "sec");
     CGFEditorUtilities.BuildIntNegative("Negative Int", "Only negative integer values", _negativeInt, "km");
}