public VoxelChunksObjectExplosionCore(VoxelBaseExplosion target) : base(target) { explosionObject = target as VoxelChunksObjectExplosion; voxelBase = voxelObject = target.GetComponent <VoxelChunksObject>(); voxelBaseCore = voxelObjectCore = new VoxelChunksObjectCore(voxelObject); voxelBaseCore.Initialize(); if (voxelObject != null) { var chunkObjects = voxelObject.chunks; explosionObject.chunksExplosion = new VoxelChunksObjectChunkExplosion[chunkObjects.Length]; for (int i = 0; i < chunkObjects.Length; i++) { if (chunkObjects[i] == null) { explosionObject.chunksExplosion[i] = null; continue; } explosionObject.chunksExplosion[i] = chunkObjects[i].gameObject.GetComponent <VoxelChunksObjectChunkExplosion>(); if (explosionObject.chunksExplosion[i] == null) { explosionObject.chunksExplosion[i] = Undo.AddComponent <VoxelChunksObjectChunkExplosion>(chunkObjects[i].gameObject); } } } }
public VoxelObjectExplosionCore(VoxelBaseExplosion target) : base(target) { explosionObject = target as VoxelObjectExplosion; voxelBase = voxelObject = target.GetComponent <VoxelObject>(); voxelBaseCore = voxelObjectCore = new VoxelObjectCore(voxelObject); voxelBaseCore.Initialize(); }
public VoxelBaseExplosionCore(VoxelBaseExplosion target) { explosionBase = target; voxelBase = target.GetComponent <VoxelBase>(); }