This component is added to Camera Objects by the PerCameraMeshDrawer class.
It is used to get a callback notification when a particular condition occurs.
Each registered object does not need to poll the camera object state every cycle.
Instead, it is checked once, and only if the condition is true, are the callbacks invoked. Default behavior will invoke the callback function for all registered objects during update, if the camera's transform has changed. Derive from this class, and override IsCallbackNeeded to change this behavior.
|
delegate void | CameraCallbackSignture (Camera camera, Matrix4x4 view, Matrix4x4 projection) |
| The delegate defines the signature of the callback functions used when registering object with the ObjectCallbackCamera class.
|
|
void | InvokeCallbackForAllRegisteredObjects () |
| Function to manually invoke the all stored callback functions. Internally called during OnEnable, and, when IsCallbackNeeded returns true, it is called during Update. Callbacks are stored, and invoked, "unordered".
|
|
void | InvokeCallbackForObject (MonoBehaviour target) |
| Function to manually invoke Callback for a particular object. Searches though all recorded callback for the one that has the MonoBehaviour specified in the Target member. If no such callback has been previously registered, this function will invoke nothing.
|
|
virtual bool | IsCallbackNeeded () |
| Detects change in camera transform and returns true if change detected. Override to change/add behavior.
|
|
delegate void | UpdateCallback () |
| Delegate defines the signature required for callback functions.
|
|
|
static void | RegisterObjectWithCallbackCamera (CameraCallbackSignture function, Camera cam) |
| The function passed in will be called every time the ObjectCallbackCamera determines a notification is required.
|
|
static void | RegisterObjectWithCallbackCamera< TypeOfCallbackCamera > (CameraCallbackSignture function, Camera cam) |
| The function passed in will be called every time the CallbackCamera determines a notification is required.
If the camera being registering with, does not have an existing TypeOfCallbackCamera component, one will be created and added to the camera. The base class version, ObjectCallbackCamera, will invoke the callback when the transform of the camera changes. You may override the IsCallbackNeeded to change this functionality, but will need to pass your derived class into the type parameter for this registration function.
|
|
static void | UnRegisterObjectWithCallbackCamera (CameraCallbackSignture function, Camera cam) |
| Removes the function from the callback set of the provided camera's CallbackCamera component
|
|
static void | UnRegisterObjectWithCallbackCamera< TypeOfCallbackCamera > (CameraCallbackSignture function, Camera cam) |
| Removes the function from the callback set of the provided camera. The callback set the function is removed from, is found in the TypeOfCallbackCamera component attached to the camera. If so such component exists (because it was not registered), this function will have no effect.
|
|