コード例 #1
0
    private void Start()
    {
        m_commsPanel       = GetComponentInChildren <CommsPanel>();
        m_securityPanel    = GetComponentInChildren <SecurityPanel>();
        m_engineeringPanel = GetComponentInChildren <EngineeringPanel>();
        m_flightPanel      = transform.GetChild(2).GetComponentInChildren <MapLogic>();
        m_startPanel       = transform.GetComponentInChildren <StartMenu>();


        comsObj         = transform.GetChild(1).gameObject;
        secObj          = transform.GetChild(3).gameObject;
        engObj          = transform.GetChild(0).gameObject;
        flightObj       = transform.GetChild(2).gameObject;
        startMenuObj    = transform.GetChild(4).gameObject;
        gameOverMenuObj = transform.GetChild(5).gameObject;
        gameWonObj      = transform.GetChild(6).gameObject;


        CloseComs();
        CloseSecurity();
        CloseEng();
        CloseFlight();
        CloseStart();
        CloseGameOver();
        CloseGameWon();
        OpenStart();
        //GameStateManager.Instance.TargetState = GAME_STATE.Flight;
    }
コード例 #2
0
        public static void Call()
        {
            SecurityPanel      securityPanel = new SecurityPanel();
            SecuritySystemPult systemPult    = new SecuritySystemPult();

            systemPult.AddCommand(Commands.SecurityOn, new SecurityPanelSwitcher(securityPanel));
            systemPult.AddCommand(Commands.ChangePinCode, new PinCodeChangeCommand(securityPanel.PinCode));

            systemPult.CallCommand(Commands.SecurityOn);
            systemPult.CallCommand(Commands.ChangePinCode);
            systemPult.CallCommand(Commands.Undo);
            systemPult.CallCommand(Commands.Undo);
        }
コード例 #3
0
        private Dictionary <int, SnapshotPlayerInfo> AddUnseenInformationToGameSnapshot(GameSnapshot gameSnapshot, int currentPlayerId)
        {
            // Everyone sees everyone in the lobby
            if (scenesManager.GetActiveScene() == Scene.Lobby)
            {
                return(gameSnapshot.playersInfo);
            }

            foreach (SnapshotPlayerInfo snapshotPlayerInfo in gameSnapshot.playersInfo.Values)
            {
                bool          isSelfInformation         = snapshotPlayerInfo.id == currentPlayerId;
                bool          isTooFarAway              = (gameSnapshot.playersInfo[currentPlayerId].position - snapshotPlayerInfo.position).magnitude > 8;
                SecurityPanel securityPanel             = playGamePhase.serverSkeld.securityPanel;
                bool          isSeenFromSecurityCameras = securityPanel.IsPlayerLooking(currentPlayerId) && securityPanel.IsSeenFromSecurityCameras(snapshotPlayerInfo.id);

                if (isTooFarAway && !isSelfInformation && !isSeenFromSecurityCameras)
                {
                    snapshotPlayerInfo.unseen = true;
                }
            }

            return(gameSnapshot.playersInfo);
        }
コード例 #4
0
        private void ProcessPlayGamePhaseData(ClientGameSnapshot gameSnapshot)
        {
            if (playGamePhase.clientSkeld == null)
            {
                return;
            }

            if (gameSnapshot.adminPanelPositions.Count != 0)
            {
                playGamePhase.UpdateAdminPanelMinimap(gameSnapshot.adminPanelPositions);
            }

            SecurityPanel securityPanel = playGamePhase.clientSkeld.securityPanel;

            if (gameSnapshot.securityCamerasEnabled && !securityPanel.CamerasEnabled)
            {
                securityPanel.EnableSecurityCameras();
            }
            else if (!gameSnapshot.securityCamerasEnabled && securityPanel.CamerasEnabled)
            {
                securityPanel.DisableSecurityCameras();
            }
        }
コード例 #5
0
 public SecurityPanelSwitcher(SecurityPanel sPanel)
 {
     SPanel = sPanel;
 }