nirasan's tech blog

趣味や仕事の覚え書きです。Linux, Perl, PHP, Ruby, Javascript, Android, Cocos2d-x, Unity などに興味があります。

2014-08-30から1日間の記事一覧

Unity で二つの値の間を行き来する値の取得方法2種類

Mathf.PingPong t を基準にして 0 から length までの値を返す 返り値の例 Debug.Log (Mathf.PingPong(0f, 3f)); //=> 0 Debug.Log (Mathf.PingPong(0.5f, 3f)); //=> 0.5 Debug.Log (Mathf.PingPong(1f, 3f)); //=> 1 Debug.Log (Mathf.PingPong(2f, 3f)); …