-
Notifications
You must be signed in to change notification settings - Fork 1
COP_update_object_global_template
Inherits: Node
Node template script for creating new scripts containing all the global update object's methods and properties.
COP_update_object_global_template is a Node template script. You can use this template script to create new scripts/objects that will act as global update objects. You can also add these methods and properties to your script to make your script into an update object. It is the methods and properties that makes a script to an update object. Global update object means that the update manager property is referenced by selecting the resource cop_update_manager_global_helper.
Type | Name | Default Value |
---|---|---|
COP_UpdateManagerGlobalHelper | update_manager |
Return Type | Name |
---|---|
void | update( float delta ) |
void | set_active( bool is_enable ) |
bool | is_active() |
void | on_enable() |
void | on_disable() |
void | _add_self_to_manager() |
bool | _is_update_object() |
COP_UpdateManagerGlobalHelper update_manager
Resource reference to the update manager that will update this object per frame.
void update ( float delta )
This is the method that will be called per frame by the update manager which also depends on the update manager settings. This basically means that the logic you would usually put in _physics_process(delta) or _process(delta) must be put in here. The delta parameter provided here is the calculated delta from the update manager.
void set_active ( bool is_enable )
This method activates/deactivates this update object. Your logic for how the update object will be activated and deactivated MUST go here.
Note: Deactivating an update object will make the update manager NOT call the update object's update(delta). This will make the update manager skip the deactivated update object which in turn will save performance because the update object's logic will NOT be called. The update manager also uses the method is_active() to check if the update object is active or NOT.
bool is_active ()
This method is checked by the update manager to see if this update object is active or NOT. Give the logic here that will tell the update manager if the update object is active or NOT. True means active update object. False means deactive update object.
NOTE: A deactivated update object will be skipped by the update manager. This means that the update(delta) method for the update object will NOT be called and thus will save performance because the update object's logic will NOT be called. The method set_active() activates/deactivates the update object.
This method is called when the update manager is enabled through script. If you want to give any logic that will be called when the update manager is enabled then put those logic here.
Note: This method is optional and can be removed from your script if NOT needed. This method is ONLY called by the update manager and should NOT be called from other scripts.
This method is called when the update manager is disabled through script. If you want to give any logic that will be called when the update manager is disabled then put those logic here.
Note: This method is optional and can be removed from your script if NOT needed. This method is ONLY called by the update manager and should NOT be called from other scripts.
This method adds this update object to the referenced update_manager by the Automation logic.
Note: This method should NOT be called or overridden because it is ONLY used by the Automation logic in the editor mode.
bool _is_update_object ()
This method checks if the object is an update object, which it is, and always returns true. This is needed by the Automation logic to use duck typing to check if the object is an update object.
Note: This method should NOT be overridden or changed because it is used by the Automation logic to check if the object is an update object.
- Tutorial Bar
- Tutorial Debug
- Tutorial Instantiate Object
- Tutorial Pool
- Tutorial Timer
- Tutorial Update Manager
- Tutorial Variable Creator
- Bars
- Debugs
- Maths
- Pools
- Resources
- Fixed Vars
- Managers
- Observers
- Vars
- Script Templates
- Timers
- Updates