示例#1
0
 public override void OnInspectorGUI()
 {
     EditorGUILayout.Space();
     explosionRadius = EditorGUILayout.FloatField("Explosion Radius:", explosionRadius);
     if (explosionRadius != voxelExploder.ExplosionRadius) voxelExploder.ExplosionRadius = explosionRadius;
     particleVelocity = EditorGUILayout.FloatField("Particle Velocity:", particleVelocity);
     if (particleVelocity != voxelExploder.ParticleVelocity) voxelExploder.ParticleVelocity = particleVelocity;
     explodeTarget = (Exploder.ExplodeTargets) EditorGUILayout.EnumPopup("Targets:", explodeTarget);
     if (explodeTarget != voxelExploder.ExplodeTarget) voxelExploder.ExplodeTarget = explodeTarget;
     EditorGUILayout.LabelField("Explode when voxel Value is");
     EditorGUILayout.BeginHorizontal();
     valueFilterOperation = (Exploder.ExplodeValueFilterOperation)EditorGUILayout.EnumPopup(valueFilterOperation);
     if (valueFilterOperation != voxelExploder.ValueFilterOperation) voxelExploder.ValueFilterOperation = valueFilterOperation;
     valueFilter = EditorGUILayout.IntField(valueFilter);
     if (valueFilter != voxelExploder.ValueFilter)
     {
         if (valueFilter < 0) valueFilter = 0;
         if (valueFilter >255) valueFilter = 255;
         voxelExploder.ValueFilter = valueFilter;
     }
     EditorGUILayout.EndHorizontal();
     if (GUILayout.Button("Explode!"))
     {
         voxelExploder.Explode();
         foreach (GameObject o in GameObject.FindGameObjectsWithTag("PicaVoxelVolume"))
             o.GetComponent<Volume>().UpdateChunks(true);
     }
 }
示例#2
0
        private void OnEnable()
        {
            voxelExploder = (Exploder) target;

            explosionRadius = voxelExploder.ExplosionRadius;
            particleVelocity = voxelExploder.ParticleVelocity;
            explodeTarget = voxelExploder.ExplodeTarget;
            valueFilterOperation = voxelExploder.ValueFilterOperation;
            valueFilter = voxelExploder.ValueFilter;
        }