forked from MinaPecheux/UnityTutorials-RTS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCoreDataHandler.cs
More file actions
35 lines (29 loc) · 761 Bytes
/
Copy pathCoreDataHandler.cs
File metadata and controls
35 lines (29 loc) · 761 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CoreDataHandler : MonoBehaviour
{
public static CoreDataHandler instance;
private string _gameUID;
private MapData _mapData;
public string GameUID => _gameUID;
public string Scene => _mapData != null ? _mapData.sceneName : null;
public float MapSize => _mapData.mapSize;
private void Awake()
{
if (instance == null)
instance = this;
}
public void SetGameUID(MapData d)
{
_gameUID = $"{d.sceneName}__{System.Guid.NewGuid().ToString()}";
}
public void SetGameUID(string uid)
{
_gameUID = uid;
}
public void SetMapData(MapData d)
{
_mapData = d;
}
}