Skip to content

Commit

Permalink
very basic ActionTweenProperty added
Browse files Browse the repository at this point in the history
  • Loading branch information
prime31 committed Sep 10, 2018
1 parent cfa0ef8 commit a5fc8e0
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;


/// <summary>
/// simple class that takes in an Action and calls it each tick with the eased value from startValue to endValue
/// </summary>
public class ActionTweenProperty : AbstractTweenProperty
{
System.Action<float> _action;

float _startValue;
float _endValue;


public ActionTweenProperty( System.Action<float> action, float startValue = 0, float endValue = 1 )
{
_action = action;
_startValue = startValue;
_endValue = endValue;
}


public override void prepareForUse()
{}


public override void tick( float totalElapsedTime )
{
var easedValue = _easeFunction( totalElapsedTime, _startValue, _endValue, _ownerTween.duration );
_action( easedValue );
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a5fc8e0

Please sign in to comment.