Skip to content

Property Overview

Nectunia edited this page Sep 26, 2020 · 13 revisions

What is it for ?

A Property is a component wich allow to add properties in GameObjects.

Property's elements

Property components are composed of 2 elements :

  • A TagID (used to refer a Tag)
  • A PropertyValue (where all the Property settings are stored)

Property composition

The TypedValue is stored in the PropertyValue and will be define by the Type set in the Tag.
In the above example, the Type is set to Boolean in the Tag named "T-Boolean". So the TypedValue is a checkbox.

Property composition

Property's values

As Vector fields, Property components can have several values. By default they can have 3 values maximum :

  • Property => one value (A) Property1_Values
  • Property2 => two values (A, B) Property2_Values
  • Property3 => three values (A, B, C) Property3_Values

warning Property, Property2 and Property3 are differents components.

Property2 and Property3 exist because it can be usefull sometime to have distinct values for the same Property. For example, if you take the Health characteristic for your player. With Property2, you can set the current Health (A) and the max Heatlh (B). With Property3, you can set the min Health (A), the current Health (B) and the max Health (C).

If you need more values for your Property, you can make your own Property component. See Property inheritance.

How does it works?

In editor mode, you will setting the Property's value.
At runtime, the value will be updated by your custom tagged components.

Add a Property

A Property is a component. So you can add it as any other component.
Select a GameObject in the scene view and click on "Add component" button in the inspector view :

Add a Property