PoolBaseTSource, TInstance, TSettingsNotificationMode Property |
[This is preliminary documentation and is subject to change.]
Namespace: Umbrace.Unity.PurePool
public abstract NotificationMode NotificationMode { get; set; }
Depending on the modes chosen, the pool will inform the components on the pooled object in different ways. The modes can be combined to support components on the same object that require differing modes.
If a component needs to handle the notification but its class cannot be modified, a separate component should be created and attached to the object, which will handle the notification on the original component's behalf.
Notification Mode | Description |
---|---|
Interface | A custom interface that is applied to any components that need to respond to the notification. Components attached to the pooled object should implement the IPoolable interface if they wish to perform actions when the object is acquired from, or released to, the pool. |
SendMessage | The built-in Unity messaging system that sends notifications using the SendMessage(String) method. Components attached to the pooled object should implement the OnAcquire method to receive a notification when the object is acquired from the pool, and the OnRelease method to receive a notification when the object is released back to the pool. |
UnityMessagingInterface | The built-in Unity messaging system that sends notifications using the ExecuteEvents class, using an interface applied to any components that need to respond to the notification. |