Search Unity

How to make a grid with sectors that represent scenes and space within scenes?

Discussion in 'Scripting' started by DeadKenny, Aug 23, 2014.

  1. DeadKenny

    DeadKenny

    Joined:
    Apr 14, 2013
    Posts:
    195
    I want to make a grid with sectors, each of which is a scene(empty scene) and in this grid I want it to represent the XYZ distance as something like say 1 decimal in the grid = 1000 in the scene .

    First lets start with one scene: How would I link or represent a given distance(bounds that I will set)in code, in a square XYZ?

    Pseudo code:

    public float sectorSizeX = 1000;
    public float sectorSizeY = 1000;
    public float sectorSizeZ = 1000;

    Now how could I implement that as the bounds of a scene and also represent it as a square in a code?

    Can anyone help me out just to get the start here? Thanks.
     
  2. Lars-Kristian

    Lars-Kristian

    Joined:
    Jun 26, 2013
    Posts:
    64
    How are you going to use this? Like a level selection screen?

    You could add a root object to every sceen and add every other object as a child. Get the render bounds of the root object and scale it to fit inside the square.
     
  3. DeadKenny

    DeadKenny

    Joined:
    Apr 14, 2013
    Posts:
    195
    Yeah kinda... but the level selection will also needed to be done at the edge or the bounds that I mentioned.

    Is there any other way other than than root and child objects? Can I use just one root object and project out to a specific distance as the limit? That can work but then I still don't know how I could represent that in a grid.
     
  4. Lars-Kristian

    Lars-Kristian

    Joined:
    Jun 26, 2013
    Posts:
    64
    Maybe uploading a image of the problem will help understanding it?

    Does every sector have the same size? Is it important to scale down the sector/sceen? Could you just make a bigger grid that represents the sector's on a one to one scale? And then use the camera to zoom in on one scene?
     
  5. DeadKenny

    DeadKenny

    Joined:
    Apr 14, 2013
    Posts:
    195
    Yeah every sector has to be the same size and the reason I am trying to do this is in order to avoid needing to scale anything and also floating point precision.

    Ok I think I kinda have an idea how to achieve part of this after you mentioned the root object.