using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class GameController : MonoBehaviour {
public Text[] buttonList;
private string playerSide;
void Awake()
{
SetGameControllerReferenceOnButtons();
playerSide = "X";
}
void SetGameControllerReferenceOnButtons()
{
for (int i = 0; i < buttonList.Length; i++)
{
buttonList*.GetComponentInParent<Buttons>().SetGameControllerReference(this);*
-
}*
- }*
- public string GetPlayerSide()*
- {*
-
return playerSide;*
- }*
- public void EndTurn()*
- {*
-
if (buttonList[0].text == playerSide && buttonList[1] == playerSide && buttonList[2].text == playerSide)*
-
{*
-
GameOver();*
-
}*
- }*
- void GameOver()*
- {*
-
for (int i = 0; i < buttonList.Length; i++)*
-
{*
_ buttonList*.GetComponentInParent().interactable = false;_
_ }_
_ }_
_}*_
Error is Operator ‘==’ cannot be applied to operands of type ‘UnityEngine.UI.Text’ and ‘string’ , please help to fix this