-
-
Save todorok1/7793fe1879bfd1eae60408ac29bb6af3 to your computer and use it in GitHub Desktop.
MathfのClampでintが返ってくる
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <Summary> | |
/// 引数で指定された値がClampメソッドを通してどの値になるかを確認します。 | |
/// </Summary> | |
void ClampTest(int value) | |
{ | |
int min = 0; | |
int max = 10; | |
int clamped = Mathf.Clamp(value, min, max); | |
Debug.Log($"{value} を入力した結果、Clampを通した値は {clamped} でした。"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment