public override void OnStartClient() { base.OnStartClient(); _lobby = GameObject.Find("LobbyManager").GetComponent <Prototype.NetworkLobby.LobbyManager>(); _game = GameObject.Find("Manager").GetComponent <IVGameManager>(); _ui = GameObject.Find("Manager").GetComponent <IVUIManager>(); for (int i = 0; i < _lobby.lobbySlots.Length; i++) { if (_lobby.lobbySlots[i] == null) { break; } else { playerNum++; playerName.Add(_lobby.lobbySlots[i].GetComponent <LobbyPlayer>().playerName); playerLoading.Add(false); } } GameObject[] Players = GameObject.FindGameObjectsWithTag("Player"); foreach (GameObject p in Players) { p.GetComponent <IVPlayer>().id = playerName.IndexOf(p.GetComponent <IVPlayer>().playerName); players.Add(p.GetComponent <IVPlayer>().id, p.GetComponent <NetworkIdentity>()); Debug.Log(p.GetComponent <IVPlayer>().id + " / " + players[p.GetComponent <IVPlayer>().id]); } _ui.InitLoadingCanvas(playerName); }
// Use this for initialization void Start() { Base = Resources.Load("Prefabs/Monster") as GameObject; // transform.Find("Monster").GetComponent<IVMonster>(); // Base.gameObject.SetActive(false); _ui = GameObject.Find("Manager").GetComponent <IVUIManager>(); }
// Use this for initialization public override void OnStartServer() { Debug.Log("enter? " + gameObject.name); if (!isServer) { Destroy(gameObject); return; } _lobby = GameObject.Find("LobbyManager").GetComponent <Prototype.NetworkLobby.LobbyManager>(); _game = GameObject.Find("Manager").GetComponent <IVGameManager>(); _ui = GameObject.Find("Manager").GetComponent <IVUIManager>(); }