public VoxelMaterial CreateMaterial(string name, VoxelMaterialModels models)
        {
            UnityEngine.Debug.Assert(!System.String.IsNullOrEmpty(name));

            if (_liveIndex.ContainsKey(name))
            {
                throw new System.Exception(string.Format("Material has been created ({0})", name));
            }

            var newMaterial = new VoxelMaterial(name, models, _lives.Count + 1)
            {
                canMerge       = models.merge,
                is_transparent = models.transparent
            };

            _liveIndex.Add(name, _lives.Count + 1);
            _lives.Add(newMaterial);

            return(newMaterial);
        }
Beispiel #2
0
 public VoxelMaterial(string name, VoxelMaterialModels models, int instanceID)
 {
     _name       = name;
     _model      = models;
     _instanceID = instanceID;
 }