Backbone - Persistence
 
Loading...
Searching...
No Matches
Backbone::PersistentObjectState Class Reference

Saves and restores both the transform (position, rotation, scale) and the active state of the GameObject. Useful for collectible items, enemies, interactive world elements, etc. More...

Inheritance diagram for Backbone::PersistentObjectState:

Public Member Functions

void OnSave ()
 Called when the game is being saved. Stores the transform and active state according to the configured flags.
 
void OnLoad ()
 Called when the game is being loaded. Restores the transform and active state according to the stored values and flags.
 

Public Attributes

bool savePosition = true
 Whether to persist the object's world position.
 
bool saveRotation = true
 Whether to persist the object's world rotation.
 
bool saveScale = false
 Whether to persist the object's local scale.
 
bool saveActiveState = true
 Whether to persist the GameObject's active state (SetActive).
 

Private Attributes

Vector3 savedPosition
 The saved world position of the object.
 
Quaternion savedRotation
 The saved world rotation of the object.
 
Vector3 savedScale
 The saved local scale of the object.
 
bool isActive
 The saved active state of the GameObject.
 

Detailed Description

Saves and restores both the transform (position, rotation, scale) and the active state of the GameObject. Useful for collectible items, enemies, interactive world elements, etc.

Member Function Documentation

◆ OnLoad()

void Backbone::PersistentObjectState::OnLoad ( )

Called when the game is being loaded. Restores the transform and active state according to the stored values and flags.

◆ OnSave()

void Backbone::PersistentObjectState::OnSave ( )

Called when the game is being saved. Stores the transform and active state according to the configured flags.

Member Data Documentation

◆ isActive

bool Backbone::PersistentObjectState::isActive
private

The saved active state of the GameObject.

◆ saveActiveState

bool Backbone::PersistentObjectState::saveActiveState = true

Whether to persist the GameObject's active state (SetActive).

◆ savedPosition

Vector3 Backbone::PersistentObjectState::savedPosition
private

The saved world position of the object.

◆ savedRotation

Quaternion Backbone::PersistentObjectState::savedRotation
private

The saved world rotation of the object.

◆ savedScale

Vector3 Backbone::PersistentObjectState::savedScale
private

The saved local scale of the object.

◆ savePosition

bool Backbone::PersistentObjectState::savePosition = true

Whether to persist the object's world position.

◆ saveRotation

bool Backbone::PersistentObjectState::saveRotation = true

Whether to persist the object's world rotation.

◆ saveScale

bool Backbone::PersistentObjectState::saveScale = false

Whether to persist the object's local scale.


The documentation for this class was generated from the following file: