GameObject GetObjectLayer(DMapLayerObjects l, float z) { if (this.transform == null) { return(null); } GameObject olayer = new GameObject(l.name); olayer.hideFlags = HideFlags.DontSave; olayer.transform.parent = this.transform; olayer.transform.position = olayer.transform.position + new Vector3(0, 0, z); return(olayer); }
void LoadObjectLayer(DMapLayerObjects ol, float z) { GameObject layerobject = GetObjectLayer(ol, z); foreach (DObject obj in ol.objectsById.Values) { if (obj.name == "Player") { LoadMapPlayerData(obj, z); } else { LoadObject(obj, layerobject); } } }