Exemplo 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 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
        }