Skip to content

Instantly share code, notes, and snippets.

@todorok1
Last active August 22, 2025 11:51
Show Gist options
  • Select an option

  • Save todorok1/fe2d64584599e3ca4c885065f410c469 to your computer and use it in GitHub Desktop.

Select an option

Save todorok1/fe2d64584599e3ca4c885065f410c469 to your computer and use it in GitHub Desktop.
シンプルRPGチュートリアル第123回 セーブ枠を制御するクラス
/// <summary>
/// セーブ枠内の進行状況に関するテキストをクリアします。
/// </summary>
public void ClearSlotInfoText()
{
_characterNameText.text = string.Empty;
_levelTitleText.text = string.Empty;
_levelValueText.text = string.Empty;
_placeText.text = string.Empty;
}
/// <summary>
/// セーブ枠内のテキストの色をセットします。
/// </summary>
/// <param name="color">設定する色</param>
public void SetTextColor(Color color)
{
_fileNameText.color = color;
_characterNameText.color = color;
_levelTitleText.color = color;
_levelValueText.color = color;
_placeText.color = color;
}
/// <summary>
/// 項目が選択できる時のセーブ枠内のテキストの色をセットします。
/// </summary>
public void SetEnabledColor()
{
SetTextColor(_selectableColor);
}
/// <summary>
/// 項目が選択できない時のセーブ枠内のテキストの色をセットします。
/// </summary>
public void SetDisabledColor()
{
SetTextColor(_unselectableColor);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment