// Speed will depend on distance and duration public void StartInterpolation(Vector2 target, float duration, InterpolationCompletedDelegate callback = null) { m_currentTime = 0; TimeToTarget = duration; Target = target; OriginPosition = gameObject.transform.position; TargetType = E_TargetType.Absolute; m_onCompleted = callback; Enabled = true; }
// Start is called before the first frame update void Start() { targetType = parent.GetTypeOfTarget(); }