// Use this for initialization void Start() { blackWinLabelPos = new Vector3(0.39f, 0.5f, 0.0f); whiteWinLabelPos = new Vector3(0.38f, 0.5f, 0.0f); GameObject persistantCtrlr = GameObject.FindWithTag("PerstCtrlr"); if (persistantCtrlr) { PersistantCtrlr pCtrlr = persistantCtrlr.GetComponent <PersistantCtrlr>(); if (pCtrlr.lWhitePlayerWon) { Instantiate(whiteWinLabel, whiteWinLabelPos, Quaternion.identity); } else { Instantiate(blackWinLabel, blackWinLabelPos, Quaternion.identity); } } else { Debug.LogError("HandleGameOver: No Persistent Controller Found!"); } }
public void OnKill() { GameObject persistantCtrlr = GameObject.FindWithTag("PerstCtrlr"); PersistantCtrlr pCtrlr = persistantCtrlr.GetComponent <PersistantCtrlr>(); if (!pCtrlr) { Debug.LogWarning("ManagePlayerState: Persistant Controller Does Not Exist"); } if (labeledBlack) { pCtrlr.lWhitePlayerWon = true; } else { pCtrlr.lWhitePlayerWon = false; } Application.LoadLevel("scn_gameOver"); }