[Add] Dice & Refactor private names
This commit is contained in:
@@ -21,15 +21,15 @@ namespace YachtDice.UI
|
||||
[SerializeField] private Color previewPositiveColor = new Color(0.85f, 1f, 0.85f, 1f);
|
||||
[SerializeField] private Color previewZeroColor = new Color(1f, 0.88f, 0.88f, 1f);
|
||||
|
||||
private CategoryDefinition category;
|
||||
private bool isUsed;
|
||||
private CategoryDefinition _category;
|
||||
private bool _isUsed;
|
||||
|
||||
public event Action<CategoryDefinition> OnCategorySelected;
|
||||
|
||||
public void Initialize(CategoryDefinition categoryDef)
|
||||
{
|
||||
category = categoryDef;
|
||||
isUsed = false;
|
||||
_category = categoryDef;
|
||||
_isUsed = false;
|
||||
categoryNameText.text = categoryDef.DisplayName;
|
||||
previewText.text = "";
|
||||
recordedScoreText.text = "-";
|
||||
@@ -40,21 +40,21 @@ namespace YachtDice.UI
|
||||
|
||||
public void ShowPreview(int previewScore)
|
||||
{
|
||||
if (isUsed) return;
|
||||
if (_isUsed) return;
|
||||
previewText.text = previewScore.ToString();
|
||||
background.color = previewScore > 0 ? previewPositiveColor : previewZeroColor;
|
||||
}
|
||||
|
||||
public void HidePreview()
|
||||
{
|
||||
if (isUsed) return;
|
||||
if (_isUsed) return;
|
||||
previewText.text = "";
|
||||
background.color = normalColor;
|
||||
}
|
||||
|
||||
public void SetRecordedScore(int score)
|
||||
{
|
||||
isUsed = true;
|
||||
_isUsed = true;
|
||||
recordedScoreText.text = score.ToString();
|
||||
previewText.text = "";
|
||||
SetInteractable(false);
|
||||
@@ -63,7 +63,7 @@ namespace YachtDice.UI
|
||||
|
||||
public void SetInteractable(bool interactable)
|
||||
{
|
||||
if (isUsed)
|
||||
if (_isUsed)
|
||||
{
|
||||
selectButton.interactable = false;
|
||||
return;
|
||||
@@ -73,7 +73,7 @@ namespace YachtDice.UI
|
||||
|
||||
public void ResetRow()
|
||||
{
|
||||
isUsed = false;
|
||||
_isUsed = false;
|
||||
previewText.text = "";
|
||||
recordedScoreText.text = "-";
|
||||
SetInteractable(false);
|
||||
@@ -82,7 +82,7 @@ namespace YachtDice.UI
|
||||
|
||||
private void HandleClick()
|
||||
{
|
||||
OnCategorySelected?.Invoke(category);
|
||||
OnCategorySelected?.Invoke(_category);
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
|
||||
Reference in New Issue
Block a user