Arda-Computer/Arda

saving state across rooms (scenes)

Closed this issue · 5 comments

Each room should hold the state of window position, size and url upto closing the app and changing rooms

  1. Using save system to save position of scene at every OnFocus(false)
  2. Load when scene starts up
  3. Save system to hold x,y,z position of WindowGroupCanvas(s) & URL of focusedWindow within

Implementation

  1. add closing windows via ctrl+w & click
  2. Add GroupState script with position & focusedWindow URL - awaitload
  3. Add savable entity
  4. Do SaveLoadSystemClass.SaveNew(); on LostFocus
  5. Load on every scene startup

Scene management implementation

Option 1: Have seperate save folders / saves for each scene
Option 2: Have uniSave but an identifier within SavableEntity to determine if the spawn is inappropriate scene (therefore does not spawn)

do option 2

As for creating / saving scenes:

  1. Have default scene in bridge
  2. to add new scene, press +
  3. input name of scene and press enter, spawns new scene in scene folder
  4. load scene image & scene name from scenes in scenes folder
  5. clicking a scene takes you to that scene

So:

  • add RoomState script & saveable entinity to roomPrefab
  • load senes as per scenes from senes folder with the names as RoomText
  • then focus on creating senes

Obstacle

Turns out you can't add a new scene to unity at runtime (need to add to buildSettings in editor)

Option 1: https://docs.unity3d.com/ScriptReference/EditorBuildSettings.html

Option 2: Create parentGO for each scene and activate/deactivate as scenes respectively

Option 2: Create parentGO for each scene and activate/deactivate as scenes respectively

  1. Create RoomPrefab that (for now) just has windowGroups in it
  2. By default has Home & is active
  3. roomButtons spawn in for loop of actual rooms that have been saved
  4. clicking a room, activates it and deactivates everything else

Option 1: Button leading (rooms read from it), if selected, then activate room, state is managed on the buttons themselves
Option 2: Room leading (buttons just spawn from for loop) this one sounds right

Have the save system within each RoomPrefab (as source of truth) as opposed to in the Rooms (easier implementation for now)

comment!