コード例 #1
0
    void Awake()
    {
        _gameManager = FindObjectOfType <GameManager>();
        if (_gameManager == null)
        {
            Debug.LogError("OOPSALA we have an ERROR!");
        }

        _locationManager = _gameManager._locationManager;
        if (_locationManager == null)
        {
            Debug.LogError("OOPSALA we have an ERROR!");
        }


        _worldBuilder = GetComponentInChildren <WorldBuilder>();
        if (_worldBuilder == null)
        {
            Debug.LogError("OOPSALA we have an ERROR!");
        }

        _gridBuilder = GetComponentInChildren <GridBuilder>();
        if (_gridBuilder == null)
        {
            Debug.LogError("OOPSALA we have an ERROR!");
        }

        _cubeBuilder = GetComponentInChildren <CubeBuilder>();
        if (_cubeBuilder == null)
        {
            Debug.LogError("OOPSALA we have an ERROR!");
        }

        _mapPieceBuilder = GetComponentInChildren <MapPieceBuilder>();
        if (_mapPieceBuilder == null)
        {
            Debug.LogError("OOPSALA we have an ERROR!");
        }

        _outerZoneBuilder = GetComponentInChildren <OuterZoneBuilder>();
        if (_outerZoneBuilder == null)
        {
            Debug.LogError("OOPSALA we have an ERROR!");
        }

        _nodeBuilder = GetComponentInChildren <NodeBuilder>();
        if (_nodeBuilder == null)
        {
            Debug.LogError("OOPSALA we have an ERROR!");
        }



        _mapSettings = GetComponent <MapSettings>();
        if (_mapSettings == null)
        {
            Debug.LogError("OOPSALA we have an ERROR!");
        }
    }
コード例 #2
0
    ////////////////////////////////////////////////
    ////////////////////////////////////////////////

    void Awake()
    {
        if (_instance != null && _instance != this)
        {
            Destroy(gameObject);
        }
        else
        {
            _instance = this;
        }
    }
コード例 #3
0
    void Awake()
    {
        _gameManager = FindObjectOfType <GameManager>();
        if (_gameManager == null)
        {
            Debug.LogError("OOPSALA we have an ERROR!");
        }


        _worldBuilder = GetComponentInChildren <WorldBuilder>();
        if (_worldBuilder == null)
        {
            Debug.LogError("OOPSALA we have an ERROR!");
        }

        _gridBuilder = GetComponentInChildren <GridBuilder> ();
        if (_gridBuilder == null)
        {
            Debug.LogError("OOPSALA we have an ERROR!");
        }

        _mapPieceBuilder = GetComponentInChildren <MapPieceBuilder> ();
        if (_mapPieceBuilder == null)
        {
            Debug.LogError("OOPSALA we have an ERROR!");
        }

        _outerZoneBuilder = GetComponentInChildren <OuterZoneBuilder>();
        if (_outerZoneBuilder == null)
        {
            Debug.LogError("OOPSALA we have an ERROR!");
        }

        _playerShipBuilder = GetComponentInChildren <PlayerShipBuilder>();
        if (_playerShipBuilder == null)
        {
            Debug.LogError("OOPSALA we have an ERROR!");
        }



        _cubeConnections = GetComponent <CubeConnections> ();
        if (_cubeConnections == null)
        {
            Debug.LogError("OOPSALA we have an ERROR!");
        }

        _mapSettings = GetComponent <MapSettings> ();
        if (_mapSettings == null)
        {
            Debug.LogError("OOPSALA we have an ERROR!");
        }
    }
コード例 #4
0
    ////////////////////////////////////////////////

    private static void AttachMapsToWorldNode(WorldNode worldNode)
    {
        Debug.Log("f**k wtf AttachMapsToWorldNode");
        int mapCount = 0;

        foreach (MapNode mapNode in worldNode.mapNodes)
        {
            mapNode.entrance = true;

            MapPieceBuilder.SetWorldNodeNeighboursForDock(worldNode.neighbourVects); // for the ship docks
            AttachMapToMapNode(mapNode);
            mapCount++;
        }
    }
コード例 #5
0
    private static void AttachMapPieceToConnectorNode(ConnectorNode connectNode)
    {
        Vector3 nodeVect = connectNode.NodeStaticLocation;
        int     mapSize  = connectNode.NodeSize;
        int     rotation = connectNode.NodeStaticRotation;
        int     mapType  = connectNode.NodeMapType;
        int     mapPiece = connectNode.NodeMapPiece;

        GridBuilder.BuildLocationGrid(connectNode, mapSize);
        List <Vector3> mapPieceNodes = GridBuilder.GetGridNodeStartPositions();

        MapPieceBuilder.AttachMapPieceToMapNode(connectNode, mapPieceNodes, mapSize, mapType, mapPiece, rotation);
        MapPieceBuilder.SetPanelsNeighbours();
        //connectNode.mapFloorData = _mapPieceBuilder.GetMapFloorData();
        //connectNode.mapVentData = _mapPieceBuilder.GetMapVentData();
    }
コード例 #6
0
    private static void AttachMapPieceToMapNode(MapNode mapNode)
    {
        Vector3 nodeVect = mapNode.NodeStaticLocation;
        int     mapSize  = mapNode.NodeSize;
        int     rotation = mapNode.NodeStaticRotation;
        int     mapType  = mapNode.NodeMapType;
        int     mapPiece = mapNode.NodeMapPiece;

        GridBuilder.BuildLocationGrid(mapNode, mapSize);
        List <Vector3> mapPieceNodes = GridBuilder.GetGridNodeStartPositions();

        MapPieceBuilder.AttachMapPieceToMapNode(mapNode, mapPieceNodes, mapSize, mapType, mapPiece, rotation);
        MapPieceBuilder.SetPanelsNeighbours();
        //mapNode.RemoveDoorPanels();
        //mapNode.mapFloorData = MapPieceBuilder.MapFloorData;
        //mapNode.mapVentData = MapPieceBuilder.MapVentData;
    }
コード例 #7
0
    ////////////////////////////////////////////////

    private static void AttachMapPiecesToWorldNode(WorldNode worldNode)
    {
        int mapCount = 0;

        foreach (MapNode mapNode in worldNode.mapNodes)
        {
            mapNode.entrance = true;
            Vector3 nodeVect = mapNode.NodeStaticLocation;
            int     mapSize  = mapNode.NodeSize;
            int     rotation = mapNode.NodeStaticRotation;
            int     mapType  = mapNode.NodeMapType;
            int     mapPiece = mapCount;
            // for the players small ship
            if (mapCount == 4)
            {
                mapNode.playerShipMapPART1 = true;
            }
            if (mapCount == 13)
            {
                mapNode.playerShipMapPART2 = true;
            }
            GridBuilder.BuildLocationGrid(mapNode, mapSize);
            List <Vector3> mapPieceNodes = GridBuilder.GetGridNodeStartPositions();
            MapPieceBuilder.SetWorldNodeNeighboursForDock(worldNode.neighbours); // for the ship docks
            MapPieceBuilder.AttachMapPieceToMapNode(mapNode, mapPieceNodes, mapSize, mapType, mapPiece, rotation);
            MapPieceBuilder.SetPanelsNeighbours();
            //mapNode.mapFloorData = MapPieceBuilder.MapFloorData;
            //mapNode.mapVentData = MapPieceBuilder.MapVentData;
            mapCount++;
        }


        //NetWorkManager.NetworkAgent.CmdTellServerToSpawnNetworkNodeContainer(PlayerManager.PlayerAgent.NetID, worldNode.NodeStaticLocation);// <<<< Dont think this should be here

        GameManager.StartGame(worldNode.NodeStaticLocation); // <<<<<< start the f*****g game bitch
    }
コード例 #8
0
 private static void AttachMapToMapNode(MapNode mapNode)
 {
     MapPieceBuilder.BuildMap(mapNode);
     MapPieceBuilder.SetPanelsNeighbours();
 }