1using System.Collections.Generic;
70 Dictionary<string, GridPropertyDetails> gridPropertyDictionary =
new Dictionary<string, GridPropertyDetails>();
78 if( gridPropertyDetails ==
null )
118 sceneSave.m_GridPropertyDetailsDictionary = gridPropertyDictionary;
123 this.m_GridPropertyDictionary = gridPropertyDictionary;
136 m_Grid = GameObject.FindObjectOfType<Grid>();
149 string key =
"x" + gridX +
"y" + gridY;
154 if( !gridPropertyDictionary.TryGetValue( key, out gridPropertyDetails ) )
161 return gridPropertyDetails;
189 SaveLoadManager.Instance.iSaveableObjectList.Add (this );
203 if( sceneSave.m_GridPropertyDetailsDictionary !=
null )
249 string key =
"x" + gridX +
"y" + gridY;
251 gridPropertyDetails.m_gridX = gridX;
252 gridPropertyDetails.m_gridY = gridY;
255 gridPropertyDictionary[key] = gridPropertyDetails;
GridBoolProperty
Describes the Grid bool property. Each grid holds following information.
Store all scenes in here. If we have 3 scenes, we have 3 entries.
Dictionary< string, SceneSave > m_SceneData
Assign a unique GUID for the objects. These ids are used to retrive the gameobjects when restoring sc...
This will get the information from serialiable object and populate these class Basically this will st...
void Start()
Call InitialiseGridProperties()
SO_GridProperties[] m_SOGridPropertiesArray
void SetGridPropertyDetails(int gridX, int gridY, GridPropertyDetails gridPropertyDetails)
Set the grid property details to gridPropertyDetails for the tile at (gridX, gridY) for current scene...
GameObjectSave GameObjectSave
void ISaveableRestoreScene(string sceneName)
Restore the previous scene when we revist to that scene. Scenario: We moved scene A to scene B....
void ISaveableRegister()
Add the iSaveableObjectList
Dictionary< string, GridPropertyDetails > m_GridPropertyDictionary
string m_ISaveableUniqueID
void OnDisable()
Call ISaveableDeregister to remove the iSaveableObjectList Unsubscribe from after scene loaded event.
GridPropertyDetails GetGridPropertyDetails(int gridX, int gridY)
Get the grid property details for the tile at (gridX, gridY). If no grid property details exist null ...
GameObjectSave m_GameObjectSave
void InitialiseGridProperties()
This initialises the grid property dictionary with the values from the SO_GridProperties assets and s...
void SetGridPropertyDetails(int gridX, int gridY, GridPropertyDetails gridPropertyDetails, Dictionary< string, GridPropertyDetails > gridPropertyDictionary)
Set the grid property details to gridPropertyDetails for the tile at (gridX, gridY) for the gridPrope...
void AfterSceneLoaded()
Get the Grid.
void ISaveableDeregister()
Remove the iSaveableObjectList
GridPropertyDetails GetGridPropertyDetails(int gridX, int gridY, Dictionary< string, GridPropertyDetails > gridPropertyDictionary)
Return thr grid property details at the gridLocation for the supplied dictionary, or null if not foun...
void OnEnable()
Call ISaveableRegister to add the iSaveableObjectList Subscribe to after scene loaded event.
void ISaveableStoreScene(string sceneName)
Saves the grid property dictionary for the current scene. This gets called when we moving scene A to ...
This will get the information from serialiable object and populate these class Basically this will st...
Holds information about grid of every scene.
GridBoolProperty m_GridBoolProperty
For example, is this grid diaggable? Is this grid an obstacle? etc...
GridCoordinate m_GridCoordinate
X and Y Axis information.
This ScriptableObject object asset will contain all the information of each scene.
List< GridProperty > m_GridPropertyList
For every grid, we read our tilemap and add to this list.
SceneName m_SceneName
Scene name.
Manage saving and loading scenes. This class is a singleton instance.
Manage the transition between scenes
Store all of the scene items in this list.
Abstract class that inherited by all the game managers. All the game managers use singleton since gam...
Interface for unity ISaveable