Beispiel #1
0
    ////////////////////////////////////////////////
    ////////////////////////////////////////////////

    public static CubeLocationScript CreateCubeObject(Vector3Int localGridLoc, int[] cubeData, Transform parent)
    {
        GameObject         cubeObject = WorldBuilder._nodeBuilder.CreateDefaultCube(localGridLoc, parent);
        CubeLocationScript cubeScript = cubeObject.GetComponent <CubeLocationScript>();

        if (cubeData[2] != 00)
        {
            PanelBuilder.CreatePanelForCube(cubeData, cubeScript);
        }

        SortOutCubeScriptShit(cubeScript);

        return(cubeScript);
    }
    ////////////////////////////////////////////////
    ////////////////////////////////////////////////

    public static CubeLocationScript CreateCubeObject(Vector3Int localGridLoc, int[] cubeData, Transform parent)
    {
        GameObject         cubeObject = WorldBuilder._nodeBuilder.CreateDefaultCube(localGridLoc, parent);
        CubeLocationScript cubeScript = cubeObject.GetComponent <CubeLocationScript>();

        if (cubeData[0] != (int)CubeObjectTypes.Empty)
        {
            // Panels
            if (cubeData[0] == (int)CubeObjectTypes.Panel_Floor ||
                cubeData[0] == (int)CubeObjectTypes.Panel_Wall ||
                cubeData[0] == (int)CubeObjectTypes.Panel_Angle)
            {
                PanelBuilder.CreatePanelForCube(cubeData, cubeScript);
            }

            // Other Objects
        }

        SortOutCubeScriptShit(cubeScript);

        return(cubeScript);
    }
Beispiel #3
0
    public CubeLocationScript CreateCubeObject(Vector3 gridLoc, int cubeType, int rotations, int layerCount, Transform parent)
    {
        rotationY = (rotations * -90) % 360;

        GameObject cubeObject = Instantiate(_defaultCubePrefab, transform, false); // empty cube

        cubeObject.transform.SetParent(parent);
        cubeObject.transform.position = gridLoc;
        CubeLocationScript cubeScript = cubeObject.GetComponent <CubeLocationScript>();

        _gameManager._worldManager._gridBuilder.SetCubeScriptToGridLocation(gridLoc, cubeScript);
        cubeScript._locationManager = _gameManager._locationManager;

        cubeScript.CubeLocVector         = gridLoc;
        cubeObject.transform.eulerAngles = new Vector3(0, rotationY, 0);
        //cubeObject.gameObject.layer = LayerMask.NameToLayer ("Floor" + layerCount.ToString ());

        cubeScript.CubeAngle = (int)rotationY;

        switch (cubeType)
        {
        case 00:
            return(null);

        case 01:
            _panelBuilder.CreatePanelForCube("Floor", cubeObject.transform, layerCount, 0, rotations);
            break;

        case 02:
            _panelBuilder.CreatePanelForCube("Wall", cubeObject.transform, layerCount, 90, rotations);     // Down
            break;

        case 03:
            _panelBuilder.CreatePanelForCube("Wall", cubeObject.transform, layerCount, 0, rotations);     // across
            break;

        case 04:
            _panelBuilder.CreatePanelForCube("FloorAngle", cubeObject.transform, layerCount, 90, rotations);
            break;

        case 05:
            _panelBuilder.CreatePanelForCube("FloorAngle", cubeObject.transform, layerCount, 270, rotations);
            break;

        case 06:
            _panelBuilder.CreatePanelForCube("FloorAngle", cubeObject.transform, layerCount, 180, rotations);
            break;

        case 07:
            _panelBuilder.CreatePanelForCube("FloorAngle", cubeObject.transform, layerCount, 0, rotations);
            break;

        case 08:
            _panelBuilder.CreatePanelForCube("CeilingAngle", cubeObject.transform, layerCount, 90, rotations);
            break;

        case 09:
            _panelBuilder.CreatePanelForCube("CeilingAngle", cubeObject.transform, layerCount, 270, rotations);
            break;

        case 10:
            _panelBuilder.CreatePanelForCube("CeilingAngle", cubeObject.transform, layerCount, 180, rotations);
            break;

        case 11:
            _panelBuilder.CreatePanelForCube("CeilingAngle", cubeObject.transform, layerCount, 0, rotations);
            break;
        }
        return(cubeScript);
    }
Beispiel #4
0
    ////////////////////////////////////////////////
    ////////////////////////////////////////////////

    public static CubeLocationScript CreateCubeObject(Vector3 gridLoc, int cubeType, int rotations, int nodeLayerCount, Transform parent)
    {
        GameObject         cubeObject = WorldBuilder._nodeBuilder.CreateDefaultCube(gridLoc, rotations, nodeLayerCount, parent);
        CubeLocationScript cubeScript = cubeObject.GetComponent <CubeLocationScript>();

        //cubeScript.CubeAngle = cubeType;

        switch (cubeType)
        {
        case 00:
            break;

        case 01:
            PanelBuilder.CreatePanelForCube("Floor", cubeScript, 0, rotations);
            break;

        case 02:
            PanelBuilder.CreatePanelForCube("Wall", cubeScript, 90, rotations);     // Down
            break;

        case 03:
            PanelBuilder.CreatePanelForCube("Wall", cubeScript, 0, rotations);     // across
            break;

        case 04:
            PanelBuilder.CreatePanelForCube("FloorAngle", cubeScript, 90, rotations);
            break;

        case 05:
            PanelBuilder.CreatePanelForCube("FloorAngle", cubeScript, 270, rotations);
            break;

        case 06:
            PanelBuilder.CreatePanelForCube("FloorAngle", cubeScript, 180, rotations);
            break;

        case 07:
            PanelBuilder.CreatePanelForCube("FloorAngle", cubeScript, 0, rotations);
            break;

        case 08:
            PanelBuilder.CreatePanelForCube("CeilingAngle", cubeScript, 90, rotations);
            break;

        case 09:
            PanelBuilder.CreatePanelForCube("CeilingAngle", cubeScript, 270, rotations);
            break;

        case 10:
            PanelBuilder.CreatePanelForCube("CeilingAngle", cubeScript, 180, rotations);
            break;

        case 11:
            PanelBuilder.CreatePanelForCube("CeilingAngle", cubeScript, 0, rotations);
            break;
        }

        SortOutCubeScriptShit(gridLoc, cubeScript);

        return(cubeScript);
    }
Beispiel #5
0
    public void CreateCubeObject(Vector3 gridLoc, int cubeType, int rotations, int layerCount)
    {
        rotationY = (rotations * -90) % 360;

        GameObject cubeObject = Instantiate(_defaultCubePrefab, transform, false); // empty cube

        cubeObject.transform.SetParent(transform);
        cubeObject.transform.position = gridLoc;
        CubeLocationScript cubeScript = cubeObject.GetComponent <CubeLocationScript>();

        _gridBuilder._GridLocToScriptLookup[gridLoc] = cubeScript;

        cubeScript.cubeLoc = gridLoc;
        cubeObject.transform.eulerAngles = new Vector3(0, rotationY, 0);
        cubeObject.gameObject.layer      = LayerMask.NameToLayer("Floor" + layerCount.ToString());

        cubeScript.cubeAngle = (int)rotationY;

        switch (cubeType)
        {
        case 00:
            break;

        case 01:
            _panelBuilder.CreatePanelForCube("Floor", cubeObject.transform, layerCount, 0, rotations);
            break;

        case 02:
            _panelBuilder.CreatePanelForCube("Wall", cubeObject.transform, layerCount, 90, rotations);              // Down
            break;

        case 03:
            _panelBuilder.CreatePanelForCube("Wall", cubeObject.transform, layerCount, 0, rotations);              // across
            break;

        case 04:
            _panelBuilder.CreatePanelForCube("FloorAngle", cubeObject.transform, layerCount, 90, rotations);
            break;

        case 05:
            _panelBuilder.CreatePanelForCube("FloorAngle", cubeObject.transform, layerCount, 270, rotations);
            break;

        case 06:
            _panelBuilder.CreatePanelForCube("FloorAngle", cubeObject.transform, layerCount, 180, rotations);
            break;

        case 07:
            _panelBuilder.CreatePanelForCube("FloorAngle", cubeObject.transform, layerCount, 0, rotations);
            break;

        case 08:
            _panelBuilder.CreatePanelForCube("CeilingAngle", cubeObject.transform, layerCount, 90, rotations);
            break;

        case 09:
            _panelBuilder.CreatePanelForCube("CeilingAngle", cubeObject.transform, layerCount, 270, rotations);
            break;

        case 10:
            _panelBuilder.CreatePanelForCube("CeilingAngle", cubeObject.transform, layerCount, 180, rotations);
            break;

        case 11:
            _panelBuilder.CreatePanelForCube("CeilingAngle", cubeObject.transform, layerCount, 0, rotations);
            break;
        }
    }