Esempio n. 1
0
    void OnDrawGizmos()
    {
        Gizmos.color = Color.white;
        Gizmos.DrawWireCube(transform.position, new Vector3(CELLS_X, CELLS_Y, 0) * CELL_SIZE);

        if (_instance == null)
        {
            _instance = FindObjectOfType <PanelGenerator>();
        }

        if (!Application.isPlaying)
        {
            Gizmos.color = Color.green;

            resetCells();

            for (int x = 0; x < CELLS_X; x++)
            {
                for (int y = 0; y < CELLS_Y; y++)
                {
                    if (!_isCellFilled[x, y])
                    {
                        Vector3    p;
                        Quaternion r;
                        getCellCenter(x, y, 1, 1, out p, out r);
                        Gizmos.DrawWireCube(p, r * new Vector3(1, 1, 0) * CELL_SIZE);
                    }
                }
            }
        }
    }
Esempio n. 2
0
 private void Awake()
 {
     fossilGenerator = GetComponent <FossilGenerator>();
     panelGenerator  = GetComponent <PanelGenerator>();
     photonView      = GetComponent <PhotonView>();
     _playerManager  = FindObjectOfType <PlayerManager>();
 }
Esempio n. 3
0
    private IEnumerator nextLevelCoroutine(float extraWait = 0.0f)
    {
        yield return(new WaitForSeconds(extraWait));

        _idToPanelActionSets.Clear();
        _connectionIdToPanelIds.Clear();
        _currentInstructions.Clear();

        int playerCount = CustomLobbyManager.allConnections.Count();

        List <List <CreatePanelMessage> > allPanels = PanelGenerator.generateAllPanelsForAllPlayers(playerCount);

        int index = 0;

        foreach (NetworkConnection connection in CustomLobbyManager.allConnections)
        {
            foreach (CreatePanelMessage createPanelMessage in allPanels[index])
            {
                PanelActionSetBase actionSet = createPanelMessage.actionSet;

                _idToPanelActionSets[actionSet.setId] = actionSet;
                List <PanelActionSetBase> idList;
                if (!_connectionIdToPanelIds.TryGetValue(connection.connectionId, out idList))
                {
                    idList = new List <PanelActionSetBase>();
                    _connectionIdToPanelIds[connection.connectionId] = idList;
                }
                idList.Add(actionSet);

                createPanelMessage.sendToClient(connection);
            }
            index++;
        }

        yield return(new WaitForSeconds(5.0f));

        _canInstruct = true;

        foreach (var connection in CustomLobbyManager.allConnections)
        {
            issueNewInstruction(connection.connectionId);
        }
    }
Esempio n. 4
0
 // Start is called before the first frame update
 void Start()
 {
     pg = GetComponent <PanelGenerator>();
 }
Esempio n. 5
0
 void Awake()
 {
     _instance = this;
     CustomMessage.registerClientHandler <CreatePanelMessage>(panelCreator);
 }
Esempio n. 6
0
    void OnDrawGizmos()
    {
        Gizmos.color = Color.white;
        Gizmos.DrawWireCube(transform.position, new Vector3(CELLS_X, CELLS_Y, 0) * CELL_SIZE);

        if (_instance == null) {
            _instance = FindObjectOfType<PanelGenerator>();
        }

        if (!Application.isPlaying) {
            Gizmos.color = Color.green;

            resetCells();

            for (int x = 0; x < CELLS_X; x++) {
                for (int y = 0; y < CELLS_Y; y++) {
                    if (!_isCellFilled[x, y]) {
                        Vector3 p;
                        Quaternion r;
                        getCellCenter(x, y, 1, 1, out p, out r);
                        Gizmos.DrawWireCube(p, r * new Vector3(1, 1, 0) * CELL_SIZE);
                    }
                }
            }
        }
    }
Esempio n. 7
0
 void Awake()
 {
     _instance = this;
     CustomMessage.registerClientHandler<CreatePanelMessage>(panelCreator);
 }