Skip to content

Instantly share code, notes, and snippets.

@todorok1
Last active April 21, 2018 05:52
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/650f6ba6e531a625fd80db6ddb24bdbb to your computer and use it in GitHub Desktop.
Save todorok1/650f6ba6e531a625fd80db6ddb24bdbb to your computer and use it in GitHub Desktop.
Unityチュートリアル・打ち出す力のメーターを上下させるスクリプト。
public Vector3 GetBoostForce(){
// 力の大きさと方向をかけたベクトルを返す
CalcForceDirection();
// 外部のスクリプトから呼ばれた時に、スライダーの参照がなければセットする
if (powerMeterSlider == null){
powerMeterSlider = powerMeterObject.GetComponent<Slider>();
}
return powerMeterSlider.maxValue * forceDirection;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment