Exemplo n.º 1
0
        private IEnumerator TextureLerp()
        {
            const int CALL_COUNT = 10;

            while (true)
            {
                if (@fixed)
                {
                    yield return(new WaitForSeconds(1f));
                }
                else
                {
                    for (int i = 0; i < CALL_COUNT; ++i)
                    {
                        yield return(new WaitForSeconds(callTimer / 10));

                        if (defaultMainTexture != null && paintMainTexture != null)
                        {
                            TextureMorphing.Lerp(defaultMainTexture, paintMainTexture, lerpCoefficient / CALL_COUNT);
                        }
                        if (defaultNormalMap != null && paintNormalMap != null)
                        {
                            TextureMorphing.Lerp(defaultNormalMap, paintNormalMap, lerpCoefficient / CALL_COUNT);
                        }
                        if (defaultHeightMap != null && paintHeightMap != null)
                        {
                            TextureMorphing.Lerp(defaultHeightMap, paintHeightMap, lerpCoefficient / CALL_COUNT);
                        }
                    }
                }
            }
        }
Exemplo n.º 2
0
        public void FixedUpdate()
        {
            if (!@fixed)
            {
                return;
            }

            if (defaultMainTexture != null && paintMainTexture != null)
            {
                TextureMorphing.Lerp(defaultMainTexture, paintMainTexture, lerpCoefficient);
            }
            if (defaultNormalMap != null && paintNormalMap != null)
            {
                TextureMorphing.Lerp(defaultNormalMap, paintNormalMap, lerpCoefficient);
            }
            if (defaultHeightMap != null && paintHeightMap != null)
            {
                TextureMorphing.Lerp(defaultHeightMap, paintHeightMap, lerpCoefficient);
            }
        }
Exemplo n.º 3
0
 public void Update()
 {
     TextureMorphing.Lerp(tex, rtex, lerpCoef);
 }