void OnEnable() { objDBTarget = target as ObjectDatabaseManager; serializedTarget = new SerializedObject(objDBTarget); shouldRegisterProp = serializedTarget.FindProperty("shouldRegister"); databaseProp = serializedTarget.FindProperty("database"); }
void Start() { foreach (GameObject obj in objects) { ObjectDatabaseManager.addObject(obj.name, obj); } }
public static void DeserializeSceneObjects(JSON objects) { foreach (JSON j in objects) { string name = j["name"].str(); Vector3 pos = j["position"].vec3(); GameObject go = (GameObject)GameObject.Instantiate(ObjectDatabaseManager.getObject(name), pos, Quaternion.identity); go.name = name; } }