// Start is called before the first frame update void Awake() { saveLoadService = new SaveLoadService(); playerDataController = FindObjectOfType <PlayerDataController>().GetComponent <PlayerDataController>(); uiController = FindObjectOfType <UIController>(); if (!PlayerPrefs.HasKey(Constants.NEWGAME) || PlayerPrefs.GetInt(Constants.NEWGAME) == 1) { seaWrapper = GameObject.FindGameObjectWithTag("SeaWrapper"); seaPrefab = Resources.Load("Prefabs/Procedural/OceanTile") as GameObject; borderPrefab1 = Resources.Load("Prefabs/Procedural/Border1") as GameObject; borderPrefab2 = Resources.Load("Prefabs/Procedural/Border2") as GameObject; borderPrefab3 = Resources.Load("Prefabs/Procedural/Border3") as GameObject; borderPrefab4 = Resources.Load("Prefabs/Procedural/Border4") as GameObject; loadWater(); bottomWrapper = GameObject.FindGameObjectWithTag("BottomWrapper"); sandPrefab = Resources.Load("Prefabs/Procedural/SandTile") as GameObject; decorationPrefab = Resources.Load("Prefabs/Procedural/BottomDecoration1") as GameObject; loadBottom(); mapWrapper = GameObject.FindGameObjectWithTag("MapWrapper"); islandArray = new List <Island>(); generateIslands(9, 1); generateIslands(6, 2); generateIslands(3, 3); loadIslands(); battleEventHolderPrefab = Resources.Load("Prefabs/Procedural/BattleEventHolder") as GameObject; wreckageEventHolderPrefab = Resources.Load("Prefabs/Procedural/WreckageEventHolder") as GameObject; loadEvents(15); playerShipPrefab = Resources.Load("Prefabs/Procedural/PlayerShip") as GameObject; eventsWrapper = GameObject.FindGameObjectWithTag("EventsWrapper"); //Default resources when creating a new game SetInitialPlayerData(); loadPlayerShipPrefab(); playerDataController.Save(); uiController.ResourcesChanged(playerDataController.PlayerData); } else { playerDataController.Load(); } }