public void OnClickAI(bool target = false) { if (target) { OnAIselection?.Invoke(transform.position); } if (activeGamestate == GameState.PLAYERX && affiliation == Player.None) { affiliation = Player.X; //button.image.color = ColorPresets.X; OnPlayerAction?.Invoke(activeGamestate); AfterPlayerAction?.Invoke(activeGamestate); } else if (activeGamestate == GameState.PLAYERO && affiliation == Player.None) { affiliation = Player.O; //button.image.color = ColorPresets.O; OnPlayerAction?.Invoke(activeGamestate); AfterPlayerAction?.Invoke(activeGamestate); } else { return; } text.text = affiliation.ToString(); if (glitchFontOnHover != null) { StopCoroutine(glitchFontOnHover); isTextGlitching = false; } text.fontSize = 10; playAnimation = true; }
public void OnClick() { if (gameController.PlayerState != activeGamestate) { return; } if (activeGamestate == GameState.PLAYERX && affiliation == Player.None) { affiliation = Player.X; //button.image.color = ColorPresets.X; OnPlayerAction?.Invoke(activeGamestate); AfterPlayerAction?.Invoke(activeGamestate); } else if (activeGamestate == GameState.PLAYERO && affiliation == Player.None) { affiliation = Player.O; //button.image.color = ColorPresets.O; OnPlayerAction?.Invoke(activeGamestate); AfterPlayerAction?.Invoke(activeGamestate); } else { return; } text.text = affiliation.ToString(); if (glitchFontOnHover != null) { StopCoroutine(glitchFontOnHover); isTextGlitching = false; } text.fontSize = 10; playAnimation = true; }