protected void OnEnable()
 {
     explosionObject = target as VoxelChunksObjectChunkExplosion;
     if (explosionObject == null)
     {
         return;
     }
     explosionObjectCore = new VoxelChunksObjectChunkExplosionCore(explosionObject);
     chunkObject         = explosionObject.GetComponent <VoxelChunksObjectChunk>();
     if (chunkObject == null)
     {
         return;
     }
     chunkCore = new VoxelChunksObjectChunkCore(chunkObject);
     if (explosionObject.transform.parent == null)
     {
         return;
     }
     voxelObject = explosionObject.transform.parent.GetComponent <VoxelChunksObject>();
     if (voxelObject == null)
     {
         return;
     }
     voxelExplosionObject = voxelObject.GetComponent <VoxelChunksObjectExplosion>();
     if (voxelExplosionObject == null)
     {
         return;
     }
     voxelExplosionCore = new VoxelChunksObjectExplosionCore(voxelExplosionObject);
 }
Ejemplo n.º 2
0
        void OnEnable()
        {
            chunkTarget = target as VoxelChunksObjectChunk;
            if (chunkTarget == null)
            {
                return;
            }
            chunkCore    = new VoxelChunksObjectChunkCore(chunkTarget);
            objectTarget = chunkTarget.transform.parent.GetComponent <VoxelChunksObject>();
            if (objectTarget == null)
            {
                return;
            }
            objectCore = new VoxelChunksObjectCore(objectTarget);

            chunkCore.Initialize();
        }