// Advanced getters/setters // Ensure object exists. public void ensureObjectExists(string ID, GameObject template) { if (!objects.ContainsKey(ID)) { // Create and save object from template objects[ID] = new ObjectState_t(template); } }
// Advanced getters/setters // Get Wrapper object, defaulting to a passed in template if it does not exist. public ObjectState_t getWrapperObject(string ID, GameObject template) { if (!objects.ContainsKey(ID)) { // Create and save object from template objects[ID] = new ObjectState_t(template); } return(objects[ID]); }
// Get Wrapper object, defaulting to a passed in template if it does not exist. public ObjectState_t getWrapperObject(string ID, string prefab_ID) { if (!objects.ContainsKey(ID)) { // Create and save object from template GameObject template = Resources.Load(prefab_ID) as GameObject; objects[ID] = new ObjectState_t(template); } return(objects[ID]); }