public void goToDeath() { if (isDead) { return; } isDead = true; playerScoreText.GetComponent <Text>().color = Color.red; playerScoreText.parent = transform.parent; BattlefieldUI.deadPlayerNo++; if (isLocalPlayer && NetworkUI.networkUI.transform_CoverController) { Destroy(NetworkUI.networkUI.transform_CoverController.gameObject); } int childCount = transform.childCount; for (int i = 0; i < childCount; i++) { Destroy(transform.GetChild(i).gameObject); } if (BattlefieldUI.deadPlayerNo == BattlefieldUI.playerNo) { cdTimer = null; cdTimer_been = null; Debug.Log("游戏结束"); AudioManager.Instance.PlaySound(1); NetworkUI.gameOver(); } }
void Awake() { if (networkUI != null) { Destroy(gameObject); return; } networkUI = this; manager = GameObject.Find("NetworkManager").GetComponent <NetworkManager>(); button_Connect = GameObject.Find("connectButton").transform; }