ソースコード
使用例
using UnityEngine; public class Example : MonoBehaviour { public Gradient m_gradient1; public Gradient m_gradient2; [Range( 0, 1 )] public float m_time; public Gradient m_gradient3; private void OnValidate() { m_gradient3 = Util.Gradient.Lerp ( m_gradient1, m_gradient2, m_time ); } }
参考ツイート
Unity doesn't have a Lerp function for gradients. Here's a helper script in case you need it sometime! #unitytips #unity3d #gamedev
— Rich Sanders (@RKSanders) 2018年9月25日
https://t.co/SiU1sgiQKd pic.twitter.com/HYnFiyURu5