private static void SetSplashPrototypeTexture(Terrain terrain, Texture2D tex, int index)
        {
            if (!terrain)
            {
                return;
            }

#if UNITY_2018_3_OR_NEWER
            var l = terrain.terrainData.terrainLayers;

            if (l.Length > index)
            {
                l[index].diffuseTexture = tex;
            }
#else
            SplatPrototype[] newProtos = terrain.GetCopyOfSplashPrototypes();

            if (newProtos.Length <= index)
            {
                QcSharp.AddAndInit(ref newProtos, index + 1 - newProtos.Length);
            }

            newProtos[index].texture = tex;


            terrain.terrainData.splatPrototypes = newProtos;
#endif
        }
예제 #2
0
            private void ClearRenderTexturesTill(int maxTextures)
            {
                var toClear = rTex.Count - maxTextures;

                for (var i = 0; i < toClear; i++)
                {
                    rTex[i].DestroyRtex();
                }

                QcSharp.SetMaximumLength(rTex, maxTextures);
            }
예제 #3
0
            public void BackupRenderTexture(int maxTextures, TextureMeta from)
            {
                ClearRenderTexturesTill(maxTextures);

                if (maxTextures <= 0)
                {
                    return;
                }

                if (rTex.Count < maxTextures)
                {
                    rTex.Add(new RenderTextureBackup(from, _order));
                }
                else
                {
                    QcSharp.MoveFirstToLast(rTex).Set(from, _order);
                }

                _order++;
            }
예제 #4
0
            public void BackupTexture2D(int maxTextures, TextureMeta id)
            {
                QcSharp.SetMaximumLength(tex2D, maxTextures);

                if (maxTextures <= 0)
                {
                    return;
                }

                var copyPix = (Color[])id.Pixels.Clone();

                if (tex2D.Count < maxTextures)
                {
                    tex2D.Add(new Texture2DBackup(copyPix, id, _order));
                }
                else
                {
                    QcSharp.MoveFirstToLast(tex2D).Set(copyPix, id, _order);
                }



                _order++;
            }
예제 #5
0
            public override string GetTextFor(Node node)
            {
                linkNo = GetLinkIndex();

                return(QcSharp.HtmlTagWrap("b", QcSharp.HtmlTagWrap("link", QcSharp.HtmlTagWrap(text, inspected.linksColor))));
            }