public static Example_Session Instance; // the only way to access session comp from other classes and the only accepted static. public override void LoadData() { // amogst the earliest execution points, but not everything is available at this point. // main entry point: MyAPIGateway // entry point for reading/editing definitions: MyDefinitionManager.Static // these can be used anywhere as they're types not fields. Instance = this; }
protected override void UnloadData() { // executed when world is exited to unregister events and stuff Instance = null; // important for avoiding this object to remain allocated in memory }