using UnityEngine;
using System;

public class LocalScaleTo : SomethingTo {

    private Vector3 fromLocalScale;
    private Vector3 targetLocalScale;
    private void Lerp(float lerp){
        transform.localScale = Vector3.Lerp(fromLocalScale, targetLocalScale, lerp);
    }

    public void ChangeLocalScale(Vector3 targetLocalScale, float interval, EasingType easingType = EasingType.Linear){
        ChangeLocalScale(targetLocalScale, interval, ActionExtensions.EmptyAction, easingType);
    }
    public void ChangeLocalScale(Vector3 targetLocalScale, float interval, Action callback, EasingType easingType = EasingType.Linear){
        ChangeLocalScale(transform.localScale, targetLocalScale, interval, callback, easingType);
    }
    public void ChangeLocalScale(Vector3 fromLocalScale, Vector3 targetLocalScale, float interval, EasingType easingType = EasingType.Linear){
        ChangeLocalScale(fromLocalScale, targetLocalScale, interval, ActionExtensions.EmptyAction, easingType);
    }
    public void ChangeLocalScale(Vector3 fromLocalScale, Vector3 targetLocalScale, float interval, Action callback, EasingType easingType = EasingType.Linear){
        this.targetLocalScale = targetLocalScale;
        this.fromLocalScale = fromLocalScale;
        Begin(Lerp, interval, callback, easingType);
    }
}
