Example #1
0
    // Use this for initialization
    void Start()
    {
        tempObj   = null;
        tmpPrefab = null;

        //make the grid
        for (int i = 0; i < gridSize; i++)
        {
            for (int j = 0; j < gridSize; j++)
            {
                GameObject tempInst = (GameObject)Instantiate(gridTile, new Vector3(i * gridSpacing, 0, j * gridSpacing), Quaternion.identity);
                tempInst.name = "t" + i + ":" + j;
                MeshCollider b = tempInst.GetComponent <MeshCollider>();
                tempInst.transform.position = new Vector3(i * b.bounds.size.x, 0, j * b.bounds.size.z);
                Debug.Log(b.bounds.size);
            }
        }
    }
Example #2
0
 public void objSelect(int num)
 {
     tmpPrefab = spawnObj[num];
     tempObj   = (GameObject)Instantiate(spawnObj[num].objectPrefab, currentTileVector, Quaternion.identity);
     buildMenu.GetComponent <Animator>().Play("close_buildMenu");
 }