Пример #1
0
 public void ToggleCapturePointAccesibility(MarkCapturePoint newPoint)
 {
     isActive = newPoint == this;
     effects.SetActive(isActive);
     captureIndicatorCanvas.enabled = isActive && indicatorActive;
     shield.SetActive(isActive);
 }
Пример #2
0
    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));
        }
    }
Пример #3
0
    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));
        }
    }