Esempio n. 1
0
 public void NextProjectCanvas(Vector3Int nextPosition)
 {
     //CheckProjectVAriable
     instantiatedProject        = Instantiate(projectPrefab, wallTiles.GetCellCenterWorld(nextPosition), Quaternion.identity);
     instantiatedCanvas         = instantiatedProject.GetComponent <CanvasCreator>();
     instantiatedCanvas.project = currentProjects[projectVariable];
     elementsExist      = instantiatedCanvas.EditCanvas();
     positionVar        = worldBuilder.CreateWalls(elementsExist, nextPosition, instantiatedProject, out projectInteractives);
     instantiatedFiller = instantiatedProject.GetComponent <ContentFiller>();
     instantiatedFiller.SetProject(currentProjects[projectVariable]);
     instantiatedFiller.FillContent(ref projectInteractives, ref elementsExist);
     projectInteractives.id              = currentProjects[projectVariable].id;
     projectInteractives.projectName     = currentProjects[projectVariable].projectName;
     projectInteractives.tags            = currentProjects[projectVariable].tags;
     projectInteractives.screenControls  = onScreenControls;
     projectInteractives.teleportHandler = onScreenTeleport;
     projectInteractives.imageViewer     = imageViewer;
     projectInteractives.linkVerifier    = linkVerifier;
     projectVariable += 1;
     interactivesBuilder.CreateInteractives(projectInteractives);
     TransferInteractivesToMinimap(projectInteractives);
     //interactivesBuilder.CreateInteractives(projectInteractives,instantiatedFiller);
     //^Create Interactives
     //NextProject;
 }
Esempio n. 2
0
    public Vector3Int CreateWalls(ElementsExist elements, Vector3Int startPosition, GameObject projectCanvas, out ProjectInteractivesPositions interPositions)
    {
        Vector3Int endPos;

        projectInteractives = new ProjectInteractivesPositions();
        endPos = CreateWallsStart(startPosition);
        MoveCanvas(projectCanvas, endPos);
        endPos = CreateWallsMiddle(elements, endPos);
        endPos = CreateWallsEnd(endPos);
        projectInteractives.elements = elements;
        interPositions = projectInteractives;
        return(endPos);
    }
Esempio n. 3
0
    private Vector3Int CreateWallsMiddle(ElementsExist elements, Vector3Int startPos)
    {
        Vector3Int endPos;
        Vector3Int step = startPos;
        int        interactiveBooking = 0;

        if (elements.isDescription)
        {
            projectInteractives.descriptionUpDwn = wallTiles.GetCellCenterWorld(startPos +
                                                                                new Vector3Int(interactiveBooking, 0, 0));
            interactiveBooking += 2;
        }
        if (elements.isImages)
        {
            projectInteractives.imageUpDwn = wallTiles.GetCellCenterWorld(startPos +
                                                                          new Vector3Int(interactiveBooking, 0, 0));
            projectInteractives.image1 = wallTiles.GetCellCenterWorld(startPos +
                                                                      new Vector3Int(interactiveBooking + 1, 0, 0));
            interactiveBooking += 3;
        }
        if (elements.isVideos)
        {
            projectInteractives.videoUpDwn = wallTiles.GetCellCenterWorld(startPos +
                                                                          new Vector3Int(interactiveBooking, 0, 0));
            projectInteractives.videoPlay = wallTiles.GetCellCenterWorld(startPos +
                                                                         new Vector3Int(interactiveBooking + 1, 0, 0));
            interactiveBooking += 4;
        }
        if (elements.isLinks)
        {
            projectInteractives.link1 = wallTiles.GetCellCenterWorld(startPos +
                                                                     new Vector3Int(interactiveBooking - 1, 0, 0));//Crutch
            interactiveBooking += 1;
        }
        projectInteractives.railStart = startPos;
        projectInteractives.railEnd   = startPos + new Vector3Int(elements.canvasLength, 0, 0);

        for (int i = 0; i < elements.canvasLength; i++)
        {
            step = startPos + new Vector3Int(i, 0, 0);
            groundTiles.SetTile(step, grounds[0]);
            wallTiles.SetTile(step + new Vector3Int(0, -2, 0), walls[1]);
            wallTiles.SetTile(step + new Vector3Int(0, -1, 0), walls[1]);
        }
        return(endPos = step);
    }
Esempio n. 4
0
 public void FillContent(ref ProjectInteractivesPositions projectInteractivesPositions, ref ElementsExist elements)
 {
     if (project == null)
     {
         Debug.Log("no project Set");
         return;
     }
     headerFiller.SetContent(project.projectName, project.tags, project.id);
     headerFiller.CheckContent();
     projectInteractivesPositions.descriptionFiller = descriptionFiller;
     if (elements.isDescription)
     {
         descriptionFiller.SetContent(project.descriptions);
         descriptionFiller.CheckContent(ref projectInteractivesPositions);
     }
     projectInteractivesPositions.imageFiller = imageFiller;
     if (elements.isImages)
     {
         imageFiller.SetContent(project.images);
         imageFiller.CheckContent(ref projectInteractivesPositions);
     }
     projectInteractivesPositions.videoFiller = videoFiller;
     if (elements.isVideos)
     {
         videoFiller.SetContent(project.videos);
         videoFiller.CheckContent(ref projectInteractivesPositions);
     }
     projectInteractivesPositions.linkFiller = linkFiller;
     if (elements.isLinks)
     {
         linkFiller.SetContent(project.links);
         linkFiller.CheckContent(ref projectInteractivesPositions);
     }
 }