using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using UnityEngine.SceneManagement; /* PK模式的角色选择界面 */ public class RoleSelectView : MonoBehaviour { bool[] inited = {false, false}; void Start() { HomeMgr.CacheView(this); GlobalData.localPK_playerRoleIDs[0] = LoginMgr.myUserInfo.avatarID; RenderPlayer(0); RenderPlayer(1); } void OnDestroy() { HomeMgr.RemoveCacheView(this); } void RenderPlayer(int playerIndex) { Transform root = this.transform.Find("Player" + (playerIndex + 1)); int roleID = GlobalData.localPK_playerRoleIDs[playerIndex]; if (!inited[playerIndex]) { inited[playerIndex] = true; Button left = root.Find("Left").GetComponent