コード例 #1
0
        private void Start()
        {
            if (duckTransform == null)
            {
                duckTransform = transform;
            }

            switch (curve)
            {
            case Curve.Default:
                duckSetting = LerpSettings.Default;
                break;

            case Curve.Sine:
                duckSetting = LerpSettings.Sine;
                break;

            case Curve.Cosine:
                duckSetting = LerpSettings.Cosine;
                break;
            }

            duckOffsetVector   = duckTransform.localPosition + Vector3.down * duckOffset;
            startLocalPosition = duckTransform.localPosition;
        }
コード例 #2
0
        public LerpValue(T start, T end, float time, LerpSetting setting, float startPerc, bool fixedDelta)
        {
            this.start      = start;
            this.end        = end;
            this.time       = time;
            this.setting    = setting;
            this.fixedDelta = fixedDelta;

            currentTime = time * Mathf.Clamp01(startPerc);
        }
コード例 #3
0
 public LerpValue(T start, T end, float time, LerpSetting setting) : this(start, end, time, setting, 0.0f, false)
 {
 }