public void ClickBall( ) { if (this.gameObject.GetComponentInChildren <Text>().text == sharedobj.getCurentNumber().ToString()) { if (!sharedobj.getHardLevel()) { this.gameObject.GetComponent <Image>().sprite = DisableBall; this.gameObject.GetComponent <Button>().interactable = false; } sharedobj.setCurentNumber(sharedobj.getCurentNumber() + 1); sharedobj.setPlayersScoreListIndex(sharedobj.getPlayersScoreListIndex(sharedobj.getPlayersTurn() - 1) + 1, sharedobj.getPlayersTurn() - 1); //Debug.Log("score player num" +sharedobj.getPlayersTurn() + " : " + sharedobj.getPlayersScoreListIndex(sharedobj.getPlayersTurn()-1)); } }
public void NextSene() { //sharedobj.setIsGameStarted(true); //Debug.Log(sharedobj.getIsGameStarted()); if (sharedobj.getPlayersTurn() == sharedobj.getPlayersCount()) { sharedobj.setPlayersTurn(1); } else { sharedobj.setPlayersTurn(sharedobj.getPlayersTurn() + 1); } Debug.Log("nobateeeeee: " + sharedobj.getPlayersTurn()); SceneManager.LoadScene(SceneName); }
// Use this for initialization void Start() { setshared(); //sharedobj.getPlayersTurn(); RawObj.texture = (Texture)BackGroundColor[sharedobj.getPlayersTurn() - 1]; //img = (RawImage) this.gameObject.GetComponent<RawImage>(); //img.texture = (Texture) BackGroundColor[sharedobj.getPlayersTurn()-1]; //this.gameObject.GetComponent<Image>().sprite = BackGroundColor[0]; // RawImage Raw_temp ; // Raw_temp = BackGroundImage.GetComponent<RawImage>(); // Raw_temp.texture = BackGroundColor[sharedobj.getPlayersTurn()-1]; //GameObject.Find("background").GetComponent<Image>().sprite = //BackGroundImage.GetComponent<Texture>().sprite = BackGroundColor[sharedobj.getPlayersTurn()-1]; }