public void Init(Vector3[] controlPoints, Team team, int instantiatorID) { this.team = team; GetComponent <Renderer>().material.color = team.Color(); if (controlPoints.Length == 1) { trajectory = new StraightTrajectoryStrategy(controlPoints[0], speed); } else { trajectory = new CurvedTrajectoryState(controlPoints, speed); } if (PhotonNetwork.player.ID != instantiatorID) { UpdatePositionAndRotation(PlayersLatency.OneWayTripOtherPlayer()); } }
public static float OneWayTripOtherPlayer() { return((PhotonNetwork.GetPing() / 2.0f + PlayersLatency.OtherPlayerPing() / 2.0f) / 1000); }