Skip to content

Instantly share code, notes, and snippets.

@todorok1
Created April 21, 2018 05:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save todorok1/80d3d49b336c2d28967b0c022b008c72 to your computer and use it in GitHub Desktop.
Save todorok1/80d3d49b336c2d28967b0c022b008c72 to your computer and use it in GitHub Desktop.
Unityチュートリアル・打ち出す力のメーターを上下させるスクリプト。
// PowerMeterオブジェクトへの参照
[SerializeField]
GameObject powerMeterObject;
// 加える力の大きさ
float forceMagnitude = 0f;
// イカ、中略
// Sliderコンポーネントへの参照
Slider powerMeterSlider;
// メーターの速さ
[SerializeField]
float meterSpeed = 0.2f;
// メーターが最大値になった時のディレイ
[SerializeField]
float delayTime = 0.08f;
float waitTime = 0f;
// メーターが増加中か減少中か(trueで増加中)
bool isMeterIncreasing = true;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment