public void RemovePrefab(VoxelBlockType type){ Transform[] newPrefabList = new Transform[type.prefabs.Length - 1]; for (int i = 0; i < newPrefabList.Length; i++) { newPrefabList [i] = type.prefabs [i]; } type.prefabs = newPrefabList; type.offset.RemoveAt(type.offset.Count - 1); type.alignToNormals.RemoveAt(type.alignToNormals.Count - 1); type.objectNormalArea.RemoveAt(type.objectNormalArea.Count - 1); type.randomRotation.RemoveAt(type.randomRotation.Count - 1); type.collidersActive.RemoveAt(type.collidersActive.Count - 1); }
public void AddPrefab(VoxelBlockType type){ Transform[] newPrefabList = new Transform[type.prefabs.Length + 1]; for (int i = 0; i < type.prefabs.Length; i++) { newPrefabList [i] = type.prefabs [i]; } type.prefabs = newPrefabList; type.offset.Add(0); type.alignToNormals.Add(false); type.objectNormalArea.Add(0); type.randomRotation.Add(true); type.scaleRamp.Add (0); type.collidersActive.Add (true); }