modify scripts
This commit is contained in:
@ -28,6 +28,7 @@ namespace WordsToolkit.Scripts.Gameplay
|
||||
private WordSelectionManager wordSelectionManager;
|
||||
private bool isSelected = false;
|
||||
private Color color;
|
||||
private string originalLetter; // Store the original letter for validation
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
@ -74,12 +75,13 @@ namespace WordsToolkit.Scripts.Gameplay
|
||||
|
||||
public string GetLetter()
|
||||
{
|
||||
return letterText.text;
|
||||
return originalLetter ?? letterText.text;
|
||||
}
|
||||
|
||||
public void SetText(string toString)
|
||||
{
|
||||
letterText.text = toString.ToUpper();
|
||||
originalLetter = toString; // Store the original letter
|
||||
letterText.text = toString.ToUpper(); // Display in uppercase
|
||||
}
|
||||
|
||||
public void SetColor(Color color)
|
||||
|
||||
@ -523,7 +523,7 @@ namespace WordsToolkit.Scripts.Gameplay.Managers
|
||||
if (string.IsNullOrEmpty(word))
|
||||
return false;
|
||||
|
||||
if (!wordValidator.IsWordKnown(word.ToLower(), gameStateManager.CurrentLanguage))
|
||||
if (!wordValidator.IsWordKnown(word, gameStateManager.CurrentLanguage))
|
||||
return false;
|
||||
|
||||
bool wasOpened = false;
|
||||
|
||||
@ -37,7 +37,6 @@ namespace WordsToolkit.Scripts.Gameplay
|
||||
private Color[] openColors = new Color[3];
|
||||
|
||||
private bool isSelected = false;
|
||||
private int wordNumber = -1;
|
||||
private bool isOpen = false;
|
||||
|
||||
[Header("Special Item")]
|
||||
@ -321,6 +320,8 @@ namespace WordsToolkit.Scripts.Gameplay
|
||||
// Only respond if the tile is selectable and closed
|
||||
if (!isOpen && levelManager != null && levelManager.hammerMode)
|
||||
{
|
||||
// Immediately disable hammer mode to prevent multiple uses
|
||||
levelManager.hammerMode = false;
|
||||
// Instead of opening immediately, play hammer animation first
|
||||
PlayHammerAnimationAndOpen();
|
||||
}
|
||||
|
||||
@ -42,7 +42,6 @@ namespace WordsToolkit.Scripts.Gameplay
|
||||
private float idleTimer = 0f;
|
||||
private Vector2 lastPosition;
|
||||
public Image cursorImage; // Reference to cursor image
|
||||
private bool isCursorVisible = true;
|
||||
private float targetAlpha;
|
||||
private float currentAlpha;
|
||||
|
||||
|
||||
@ -66,7 +66,6 @@ namespace WordsToolkit.Scripts.Gameplay
|
||||
private CanvasGroup panelCanvasGroup;
|
||||
|
||||
[Header("UI References")]
|
||||
[SerializeField] private float characterSpacing = 30f; // Spacing between characters
|
||||
public Image backgroundSelectedWord; // Reference to the background image
|
||||
[SerializeField]
|
||||
private TextMeshProUGUI selectedWordText;
|
||||
@ -463,7 +462,7 @@ namespace WordsToolkit.Scripts.Gameplay
|
||||
if (selectedWordText != null)
|
||||
{
|
||||
selectedWordText.color = new Color(selectedWordText.color.r, selectedWordText.color.g, selectedWordText.color.b, 1f);
|
||||
selectedWordText.text = GetSelectedWord();
|
||||
selectedWordText.text = GetSelectedWord().ToUpper();
|
||||
UpdateHorizontalLayout(layout);
|
||||
}
|
||||
}
|
||||
|
||||
@ -33,7 +33,6 @@ namespace WordsToolkit.Scripts.Gameplay.WordValidator
|
||||
if (string.IsNullOrEmpty(word))
|
||||
return false;
|
||||
|
||||
word = word.ToLower();
|
||||
return (modelController != null && modelController.IsWordKnown(word, currentLanguage)) ||
|
||||
(customWordRepository != null && customWordRepository.ContainsWord(word));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user