private void Start() { startsurface = 0; if (PhotonNetwork.IsMasterClient) { hole = BLOCKLavaSpawner.Register_Hole(gameObject); GlobalPosition = BLOCKLavaSpawner.Get_Position(hole); photonView.RPC("SyncHole", RpcTarget.All, hole); } mesh = new Mesh(); //StartCoroutine("WaitforRadia"); Createmesh(); InvokeRepeating("MeshGrowing", 1f, 0.2f); InvokeRepeating("surface_calculator", 1f, 0.2f); if (StaticVariables.IsSpectator) { this.gameObject.transform.GetChild(1).gameObject.SetActive(true); this.gameObject.transform.GetChild(1).GetComponent <TextMesh>().text = hole.ToString(); } if (ScoreMenu.Gamecounter == 3) { Players = (PhotonNetwork.CountOfPlayers - 1) / 2; } else { Players = (PhotonNetwork.CountOfPlayers - 1); } }
//public void UpdateMesh(float Track_Surface_old, float Track_Surface) public void UpdateMesh(bool create) { this_object = gameObject; //if (isServer) //MeshChange(vertices, triangles); if (PhotonNetwork.IsMasterClient) { float MaxScore = Track_null_Surface - startsurface; //pass through what they managed to stop BLOCKLavaSpawner.Update_Score(Track_null_Surface - Track_Surface, Track_Surface, MaxScore, BlockerString, hole); PhotonView photonView = PhotonView.Get(this); photonView.RPC("MeshChange", RpcTarget.All, vertices, triangles, create, startradius); } }