/// <summary> /// We might do something intersting here for example we could give them some experience everytime they win, less if they tie, and less if they win. Then you could a simple leveling system, /// its quite easy to add that to photon networking. /// </summary> public static string setResults(int totalScore) { string resultString = ""; int otherID = Misc.getOtherPlayer(); //lets get the other score. int otherScore = GolfManager.getOtherScore(otherID); //now you might want to do something here where you are going to save how many wins, how many loses, how many ties -- then have some sort of leveling system. if (totalScore < otherScore) { resultString = "You Won!"; increaseGamesPlayed(LevelingStats.Stats.TOTAL_WINS.ToString()); } if (totalScore == otherScore) { resultString = "You Tied!"; increaseGamesPlayed(LevelingStats.Stats.TOTAL_TIES.ToString()); } if (totalScore > otherScore) { resultString = "You Lost!"; increaseGamesPlayed(LevelingStats.Stats.TOTAL_LOSES.ToString()); } return(resultString); }
public void Update() { GameObject go; m_tick -= Time.deltaTime; for (int i = 0; i < 18; i++) { string postfix = (i + 1).ToString("00"); go = GameObject.Find("Hole" + postfix + "gt"); if (go) { scoreGTs[i] = go.GetComponent <Text>(); scoreGTs[i].text = ""; } go = GameObject.Find("Par" + postfix); if (go) { parGTs[i] = go.GetComponent <Text>(); parGTs[i].text = ""; } } int nomStrokes = m_gameScript.getNomStrokes(); int totalScore = m_gameScript.getTotalScore(); int par = m_gameScript.getPar(); int courseIndex = m_gameScript.getCourseIndex(); //we want to get the other players id. int otherID = Misc.getOtherPlayer(); m_otherID = otherID; //the other score. if (total2GT) { total2GT.text = GolfManager.getOtherScore(otherID).ToString(); } // Debug.Log ("otherID" + GolfManager.getOtherScore(otherID).ToString()); totalGT.text = totalScore.ToString(); int handicap = nomStrokes - par; string term = getTerm(nomStrokes, handicap); resultGT.text = term; showScore(); }