Created
September 21, 2017 20:20
-
-
Save pollend/f232e6a52ac34e3ed2846df9dc742b6f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using UnityEngine; | |
using System.Collections.Generic; | |
[CreateAssetMenuAttribute] | |
public class AssetManager: ScriptableSingleton<AssetManager> | |
{ | |
[SerializeField] | |
public GameObjectContainer seralizableObjects; | |
//TODO: REDO all of this | |
public Dictionary<Type,Lab> Labs = new Dictionary<Type, Lab>(); | |
public Dictionary<Type,Tile> Tiles = new Dictionary<Type, Tile>(); | |
public Dictionary<Type,SerializableBehavior> Serializible = new Dictionary<Type, SerializableBehavior>(); | |
public void Initialize() | |
{ | |
foreach(GameObject gameObject in seralizableObjects.GameObjects) | |
{ | |
SerializableBehavior item = gameObject.GetComponent<SerializableBehavior> (); | |
//register object as being seralizible | |
GameController.Instance.seralizer.RegisterSeralizability (item); | |
if (item is Lab) | |
Labs.Add (item.GetType (), (Lab)item); | |
if (item is Tile) | |
Tiles.Add (item.GetType (), (Tile)item); | |
Serializible.Add (item.GetType (), item); | |
} | |
} | |
/* public T Create<T>() where T: SerializableBehavior,new() | |
{ | |
return new T(); | |
}*/ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment