Ejemplo n.º 1
0
 public void AddLayer(int addPos)
 {
     ArrayTools.Insert(ref array, addPos, new GrassType()
     {
         name = "Grass Block"
     });
     if (mainTexArray != null)
     {
         TextureArrayTools.Insert(ref mainTexArray, addPos, null);
     }
     if (bumpMapArray != null)
     {
         TextureArrayTools.Insert(ref bumpMapArray, addPos, null);
     }
     if (specSmoothMapArray != null)
     {
         TextureArrayTools.Insert(ref specSmoothMapArray, addPos, null);
     }
     if (sssVanishMapArray != null)
     {
         TextureArrayTools.Insert(ref sssVanishMapArray, addPos, null);
     }
     if (changeBlockData)
     {
         Voxeland.current.data.InsertType((byte)addPos);
     }
 }
        public void RemoveAt(int index)
        {
                        #if UNITY_EDITOR
            ArrayTools.RemoveAt(ref srcArr, index);
            TextureArrayTools.RemoveAt(ref texArr, index);

            SaveSources();
                        #endif
        }
        public void Switch(int ch1, int ch2)
        {
                        #if UNITY_EDITOR
            ArrayTools.Switch(srcArr, ch1, ch2);
            TextureArrayTools.Switch(ref texArr, ch1, ch2);

            SaveSources();
                        #endif
        }
Ejemplo n.º 4
0
 public void SwitchLayers(int num1, int num2)
 {
     ArrayTools.Switch(array, num1, num2);
     TextureArrayTools.Switch(mainTexArray, num1, num2);
     TextureArrayTools.Switch(bumpMapArray, num1, num2);
     TextureArrayTools.Switch(specSmoothMapArray, num1, num2);
     TextureArrayTools.Switch(sssVanishMapArray, num1, num2);
     if (changeBlockData)
     {
         Voxeland.current.data.SwitchType((byte)num1, (byte)num2);
     }
 }
Ejemplo n.º 5
0
 public void RemoveLayer(int num)
 {
     ArrayTools.RemoveAt(ref array, num);
     TextureArrayTools.RemoveAt(ref mainTexArray, num);
     TextureArrayTools.RemoveAt(ref bumpMapArray, num);
     TextureArrayTools.RemoveAt(ref specSmoothMapArray, num);
     TextureArrayTools.RemoveAt(ref sssVanishMapArray, num);
     if (changeBlockData)
     {
         Voxeland.current.data.RemoveType((byte)num);
     }
 }
        public void Insert(Texture2D tex, Texture2D al, int index)
        {
                        #if UNITY_EDITOR
            ArrayTools.Insert(ref srcArr, index, new SrcLayer());
            TextureArrayTools.Insert(ref texArr, index, new Texture2D(texArr.width, texArr.height));

            if (tex != null)
            {
                SetSource(tex, index, isAlpha: false, saveSources: false);
            }
            if (al != null)
            {
                SetSource(al, index, isAlpha: true, saveSources: false);
            }

            SaveSources();
                        #endif
        }
        public void Add(Texture2D tex, Texture2D al)
        {
                        #if UNITY_EDITOR
            ArrayTools.Add(ref srcArr, new SrcLayer());
            TextureArrayTools.Add(ref texArr, new Texture2D(texArr.width, texArr.height));

            if (tex != null)
            {
                SetSource(tex, srcArr.Length - 1, isAlpha: false, saveSources: false);
            }
            if (al != null)
            {
                SetSource(al, srcArr.Length - 1, isAlpha: true, saveSources: false);
            }

            SaveSources();
                        #endif
        }