public void ToggleCapturePointAccesibility(MarkCapturePoint newPoint) { isActive = newPoint == this; effects.SetActive(isActive); captureIndicatorCanvas.enabled = isActive && indicatorActive; shield.SetActive(isActive); }
private void ShuffleCapturePoint() { if (PhotonNetwork.IsMasterClient) { int newActivePointID = activePointID; if (capturePoints.Length > 1) { while (newActivePointID == activePointID) { MarkCapturePoint point = capturePoints[UnityEngine.Random.Range(0, capturePoints.Length)]; newActivePointID = point.CapturePointID; } } activePointID = newActivePointID; OnCapturePointChanged(GetCapturePointFromID(activePointID)); } }
private void SetupStartingCapturePoint() { capturePoints = FindObjectsOfType <MarkCapturePoint>(); Array.Sort(capturePoints, (x, y) => string.Compare(x.name, y.name)); for (int i = 0; i < capturePoints.Length; i++) { capturePoints[i].Init(); } readyToReceiveUpdates = true; if (PhotonNetwork.IsMasterClient) { MarkCapturePoint point = capturePoints[UnityEngine.Random.Range(0, capturePoints.Length)]; activePointID = point.CapturePointID; OnCapturePointChanged(GetCapturePointFromID(activePointID)); } }