CustomInitialize

Introduction

CustomInitialize is a function which is called once per instance when it is initialized. Initialization happens:

  • When an instance is created either in code by using the “new” operator, or if an instance is added through Glue. See below for more information.
  • Whenever an Entity is recycled through a factory.

CustomInitialize and AddToManagers

The CustomInitialize method will only be called when an Entity instance is added to managers. For example consider the following code: