Skip to content

YaCustomPropertyAPI

Creates CustomPropertyAccessor instances for custom property management.

Functions

table YaCustomPropertyAPI.GetLuaObject(string key)

ReturnsThe lua object associated with the key or nil if not exists.
Returns a lua object associated with the key.
1
local o = YaCustomPropertyAPI.GetLuaObject("some-key")
  • key The key.

void YaCustomPropertyAPI.SetLuaObject(string key, table value)

Saves a lua object associated with a key.
1
2
local o = { name = "John", age = 30 }
YaCustomPropertyAPI.SetLuaObject("some-key", o)
  • key The key.
  • value The lua object.

CustomPropertyAccessor YaCustomPropertyAPI.GetCustomPropertyAccessor(YaEntity entity)

Returnsthe CustomPropertyAccessor for the entity.
Gets a CustomPropertyAccessor for the entity.
  • entity The entity to get CustomPropertyAccessor

boolean YaCustomPropertyAPI.HasCustomPropertyAccessor(YaEntity entity)

Returnstrue if the entity has CustomPropertyAccessor
Checks whether the entity has CustomPropertyAccessor.
  • entity The entity to check

CustomPropertyAccessor YaCustomPropertyAPI.AddOrGetCustomPropertyAccessor(YaEntity entity)

Returnsthe CustomPropertyAccessor for the entity
Add CustomPropertyAccessor to the entity.
  • entity The entity to add or get CustomPropertyAccessor