public void SpawnShape(int ID) { var shape = Shapes.Find((s) => s.ID == ID); var shapeData = ModelDataSerializer.DeSerializeDataModelfromDisc(Application.persistentDataPath, shape.Name + "Data.xml"); if (CurrentShape != null) { Destroy(CurrentShape.gameObject); } CurrentShape = Instantiate(shape); if (shapeData != null) { CurrentShape.SetShapeData(shapeData); } }
private void OnEnable() { shape = (Shape_3D)target; }