Skip to content

Latest commit

 

History

History
11 lines (6 loc) · 1.21 KB

glue-reference-setbyderived.md

File metadata and controls

11 lines (6 loc) · 1.21 KB

SetByDerived

Introduction

SetByDerived is a variable that allows derived Entities to access variables defined in a base Entity. Once a variable is SetByDerived, any Entities that derive from the given Entity (that is, use it as its BaseEntity) can set the variable to a different value.

When using inheritance, the derived Entity in code inherits from the base Entity, therefore all variables are available in custom code. The SetByDerived is only useful for exposing the variable in Glue.

Usage Example

Consider a situation where your game has three Entities: Enemy, Ghost, and Zombie: ThreeEntities.PNG In this situation the Enemy entity is the base for Ghost and Zombie: ZombieBase.PNG Notice that by default the Enemy's MovementSpeed variable is not part of Zombie or Ghost: NotSetInDerived.PNG If the MovementSpeed in Enemy has its SetByerived value set to True, the variables will automatically appear in the Ghost and Zombie Entities: SetByDerived.PNG