private void OnEnable() { if (this.componentTarget == null) { this.componentTarget = (BimData)target; EditorUtility.SetDirty(this.componentTarget); } }
// Load data in the shape of an array with two elements: geometry, and bim information. public void CreateGeometryAndBimInfo(string json) { GameObject gameObj = getGameObjectFromId(json.Substring(0, 32)); JSONObject geometryAndBim = new JSONObject(json.Substring(32)); AddGeometryToObject(gameObj, geometryAndBim.list[0]); BimData b = gameObj.GetComponent <BimData> (); b.SetBimData(geometryAndBim.list[1]); }