|
Unravel Engine C# Reference
|
Public Member Functions | |
| override void | OnCreate () |
| Called when the script is created. Override this method to initialize resources or data. OnCreate is called when the script is first loaded, or when an object it is attached to is instantiated It only gets called once on each script, and only after other objects are initialised. This means that it is safe to create references to other game objects and components in OnCreate. | |
| override void | OnStart () |
| Called when the script starts execution. Override this method to set up logic at the start. Start is called once, before any Update methods and after OnCreate. It works in much the same way as OnCreate, with a few key differences. Unlike OnCreate, Start will not be called if the script is disabled. | |
| override void | OnUpdate () |
| Called on every frame update. Override this method to implement frame-based logic. | |
Public Member Functions inherited from Unravel.Core.ScriptComponent | |
| virtual void | OnEnable () |
| Called when the script or entity is enabled. Override this method to initialize resources or data. | |
| virtual void | OnDisable () |
| Called when the script or entity is disabled. Override this method to clean up resources or data. | |
| virtual void | OnDestroy () |
| Called when the script is destroyed. Override this method to clean up resources or data. | |
| virtual void | OnSensorEnter (Entity e) |
| Called when another entity enters a sensor attached to this entity. | |
| virtual void | OnSensorExit (Entity e) |
| Called when another entity exits a sensor attached to this entity. | |
| virtual void | OnCollisionEnter (Collision collision) |
| Called when this entity begins a collision with another entity. | |
| virtual void | OnCollisionExit (Collision collision) |
| Called when this entity ends a collision with another entity. | |
| virtual void | OnFixedUpdate () |
| A framerate-idependent interval update when physics calculations are performed. Override this method to implement frame-based logic. | |
| virtual void | OnLateUpdate () |
| Called on every frame update after other updates are finished. Override this method to implement frame-based logic. | |
Public Member Functions inherited from Unravel.Core.Component | |
| override bool | IsValid () |
| Determines whether this component is valid. | |
Public Member Functions inherited from Unravel.Core.NativeObject | |
| bool | IsValid () |
| bool | Equals (NativeObject other) |
| override bool | Equals (object obj) |
| override int | GetHashCode () |
Public Attributes | |
| Vector2 | mouseAbsolute |
| Vector2 | mouseSensitivity = new Vector2(10, 10) |
| float | moveSpeed = 20.0f |
Additional Inherited Members | |
Static Public Member Functions inherited from Unravel.Core.NativeObject | |
| static bool | operator== (NativeObject left, NativeObject right) |
| static bool | operator!= (NativeObject left, NativeObject right) |
Protected Member Functions inherited from Unravel.Core.ScriptComponent | |
| ScriptComponent ([CallerFilePath] string file="") | |
Properties inherited from Unravel.Core.ScriptComponent | |
| string | SourceFilePath [get, set] |
Properties inherited from Unravel.Core.Component | |
| Entity | owner [get, set] |
| Gets the entity that owns this component. | |
| TransformComponent | transform [get] |
| Gets the TransformComponent associated with this component's owner. | |
Definition at line 5 of file SampleMouseLookComponent.cs.
|
virtual |
Called when the script is created. Override this method to initialize resources or data. OnCreate is called when the script is first loaded, or when an object it is attached to is instantiated It only gets called once on each script, and only after other objects are initialised. This means that it is safe to create references to other game objects and components in OnCreate.
Reimplemented from Unravel.Core.ScriptComponent.
Definition at line 11 of file SampleMouseLookComponent.cs.
|
virtual |
Called when the script starts execution. Override this method to set up logic at the start. Start is called once, before any Update methods and after OnCreate. It works in much the same way as OnCreate, with a few key differences. Unlike OnCreate, Start will not be called if the script is disabled.
Reimplemented from Unravel.Core.ScriptComponent.
Definition at line 15 of file SampleMouseLookComponent.cs.
|
virtual |
Called on every frame update. Override this method to implement frame-based logic.
Reimplemented from Unravel.Core.ScriptComponent.
Definition at line 19 of file SampleMouseLookComponent.cs.
| Vector2 SampleMouseLookComponent.mouseAbsolute |
Definition at line 7 of file SampleMouseLookComponent.cs.
Definition at line 8 of file SampleMouseLookComponent.cs.
| float SampleMouseLookComponent.moveSpeed = 20.0f |
Definition at line 9 of file SampleMouseLookComponent.cs.