Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as C# by bm ( 16 years ago )
GameObject.Destroy(WDecalSlots.curentProjector.material.GetTexture("_ShadowTex"));
                Texture2D inTex = (Texture2D)WDecalSlots.curentProjector.material.GetTexture("_MainTex");
                Texture2D origTex = new Texture2D(inTex.width, inTex.height);
                origTex.wrapMode = TextureWrapMode.Clamp;
                origTex.filterMode = FilterMode.Trilinear;
                origTex.mipMapBias = -100;

                float angle = percent;

                Color[] pix = inTex.GetPixels(0, 0, inTex.width, inTex.height);

                for (int i = 0; i < pix.Length; i++)
                {
                    HSBColor hsb = HSBColor.FromColor(pix[i]);
                    hsb.h = hsb.h + angle;
                    pix[i] = hsb.ToColor();
                }


                origTex.SetPixels(0, 0, inTex.width, inTex.height, pix);
                origTex.Apply();

                WDecalSlots.curentProjector.material.SetTexture("_ShadowTex", origTex);

 

Revise this Paste

Your Name: Code Language: