Skip to content

Instantly share code, notes, and snippets.

@lycoris102
Created November 10, 2017 12:57
Show Gist options
  • Save lycoris102/79d74e560e336f0dead80ddb103cf06a to your computer and use it in GitHub Desktop.
Save lycoris102/79d74e560e336f0dead80ddb103cf06a to your computer and use it in GitHub Desktop.
using DG.Tweening;
using UnityEngine;
[RequireComponent(typeof(ParticleSystem))]
public class ParticleStartSizeTween : MonoBehaviour
{
void Start()
{
ParticleSystem particle = this.GetComponent<ParticleSystem>();
float toSize = 1.0f;
float duration = 10.0f;
DOTween.To(
() => particle.startSize, // 対象の値を指定
it => particle.startSize = it, // 変化するitを代入
toSize, // 最終値
duration // 時間
).Play();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment