-
Notifications
You must be signed in to change notification settings - Fork 1
observer_template
Inherits: Resource
Resource template script for creating new observer types.
observer_template is a Resource template script. You can use this template script to create new scripts/objects that will act as an observer. These scripts basically stores and shares the reference to a value. Also when the value has been changed then the changed value will also be emitted to its observers through the callables in the Singal. This class works as the Observer Pattern. The value can NOT be set during editor mode but it can ONLY be set during run time. Example of observers scripts are cop_observer_bool, cop_observer_float and cop_observer_int.
Note: Make sure to give a unique class name for the new script so that you can create it in the editor.
Type | Name | Default Value |
---|---|---|
untype | _value |
Return Type | Name |
---|---|
untype | get_value() |
untype | get_value_emit() |
void | set_value( untype value ) |
void | set_value_emit( untype value ) |
void | disconnect_all() |
Emitted when the _value has been changed through the method set_value_emit(). The parameter for the signal is untype. So make sure to give the type of the value parameter same as the property _value type. If NOT then every time this signal is emitted it will then throw an error.
The stored value that will be sent to observers when ever this value changes through the method set_value_emit(). This value is also emitted to observers when the method get_value_emit() is called. You can also get/set the value without the need for emitting by calling the methods get_value() or set_value() respectively. Note: This property is untype so make sure to set the type for the property.
This method returns the _value without emitting to the observers. The return type is untype. So make sure to give the return type same as the _value's type. If NOT done so then this script will throw errors whenever this method is called.
This method returns the _value and emits it to the observers. The return type is untype. So make sure to give the return type same as the _value's type. If NOT done so then this script will throw errors whenever this method is called.
This method sets the _value without emitting to the observers. The parameter value is untype. So make sure the type of this parameter is same as the _value's type. If NOT then this method will throw errors whenever it is called.
This method sets the _value and emits it to the observers. The parameter value is untype. So make sure the type of this parameter is same as the _value's type. If NOT then this method will throw errors whenever it is called.
This method removes/disconnects all the connected callable objects from the Signal value_changed.
- 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