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); } } } } }
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); } }
public void Update() { TextureMorphing.Lerp(tex, rtex, lerpCoef); }