2
2

More than 1 year has passed since last update.

Unity/C#のための「多分最速」のスクリプト言語作った。#2【Tween編?】

Last updated at Posted at 2023-02-13

https://qiita.com/aakei/items/eb279ce7212b0dd6ac2e
これの続きというか更新記録というか。レポジトリはこれ
https://github.com/Akeit0/YukataScript
devのブランチを現在更新してます。(2/13)

新しいこと

エディタモードでイージング関数とアニメーションカーブでTweenできます。
Async.gif

スクリーンショット 2023-02-13 182646.png

var timer=new YS.Timer(duration)
while not timer.IsExpired {
	await 16.ms()
	var current=timer.GetEasedElapsedRatio(easingType)
	transform.localScale=v3 * current
}
timer=new YS.Timer(duration)
while not timer.IsExpired {
	await 16.ms()
	var current=1f-timer.GetCurvedElapsedRatio(curve)
	transform.localScale=v3 * current
}
transform.localScale=default

経過時間を扱うTimerクラスとイージングを扱うEnumとクラスを作りました。
System.Timers.TimerではなくVisualScriptingのTimerを参考にしたものです。
エディタモードでもなめらかに動くようにしています。
まあそれは言語には関係ないんですけど、新たに実装したwhile文 と相性がとてもいいですよね。
while not timer.IsExpired{ }
書きやすいですね。
ここでの更新が必ずしも反映させてるとは限りませんが、遊んでみてほしいです。
時間を扱いましたが、細かい実装はほんとに時間が必要です。Document作りでもなんでも手伝ってほしいですね。
https://github.com/Akeit0/YukataScript

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2