// Update is called once per frame void Update() { if (_hostserver == null && GameObject.Find("Host Server") != null) { _hostserver = GameObject.Find("Host Server").GetComponent <IVHostServer>(); } if (_game == null && GameObject.Find("Manager") != null) { _game = GameObject.Find("Manager").GetComponent <IVGameManager>(); } timer += Time.deltaTime; if (timer < updatespeed) { rect.position = Vector3.Lerp(rect.position, rect.position + dirs[index % 10] * movespeed, timer); } else { index++; timer -= updatespeed; } if (index == 100) { index = 0; } // Debug.Log(rect.position); }
// Update is called once per frame void Update() { timer += Time.deltaTime; if (_hostserver == null) { if (GameObject.Find("Host Server") != null) { _hostserver = GameObject.Find("Host Server").GetComponent <IVHostServer>(); } } else if (_hostserver.isLoading) { if (timer >= sendRPCrate) { if (_hostserver.playerLoading.Contains(false)) { if (isServer) { RpcClientLoading(); } return; } else { _hostserver.isLoading = false; } timer -= sendRPCrate; } } }
void RpcUpdateClientLoadingStatus(int i) { if (_hostserver == null) { _hostserver = GameObject.Find("Host Server").GetComponent <IVHostServer>(); } _hostserver.playerLoading[i] = true; GameObject.Find("Manager").GetComponent <IVUIManager>().UpdateLoadingStatus(i, "Ready"); }
// Use this for initialization void Start() { //initialization _hostserver = GameObject.Find("Host Server").GetComponent <IVHostServer>(); _lobby = GameObject.Find("LobbyManager").GetComponent <LobbyManager>(); _game = GameObject.Find("Manager").GetComponent <IVGameManager>(); _voice = GameObject.Find("Manager").GetComponent <IVVoiceManager>(); playerCount = _hostserver.playerNum; MonsterButton[] ms = GameObject.Find("Canvas").GetComponentsInChildren <MonsterButton>(); foreach (MonsterButton b in ms) { monsters.Add(b.GetComponent <Button>()); } UpdatePlayerUI(); }