/// <summary> /// Register a FieldReactor with EMController. Called automatically by every FieldReactor on scene start or /// upon its creation, whichever is earlier. /// </summary> /// <param name="NewFieldReactor">FieldReactor to register.</param> public void RegisterFieldReactor(FieldReactor NewFieldReactor) { // Make sure new field reactor isn't already registered if (fieldReactors.Contains(NewFieldReactor)) { return; } // Add new field reactor fieldReactors.Add(NewFieldReactor); // Register field type RegisterFieldType(NewFieldReactor.fieldReactingTo); OnFieldReactorRegistered?.Invoke(NewFieldReactor); }
/// <summary> /// Removes a FieldReactor from EMController's registry. Called automatically by all FieldReactors on their /// destruction. /// </summary> /// <param name="RemoveFieldReactor">FieldReactor to remove.</param> public void UnRegisterFieldReactor(FieldReactor RemoveFieldReactor) { fieldReactors.Remove(RemoveFieldReactor); OnFieldReactorUnregistered?.Invoke(RemoveFieldReactor); }