Example #1
0
    GameObject InstantiateGo(GameObject pf, bbLoc l, Color c)
    {
        Vector3    pos = new Vector3(l.x(), l.z(), l.y());
        GameObject go  = Instantiate(pf, pos, Quaternion.identity);

        go.GetComponentInChildren <Renderer>().material.color = c;
        return(go);
    }
Example #2
0
    public void InitCamera()
    {
        bbLoc   MidLoc = new bbLoc(game.currentIsland.dim / 2 - 1, game.currentIsland.dim / 2 - 1);
        Vector3 p      = goMap[game.currentIsland.pathMap[MidLoc.key()]].transform.position;

        if (game.tileShape == TileShape.SQUARE)
        {
            Camera.main.transform.position = new Vector3(p.x, 1, p.z);
            Camera.main.orthographicSize   = game.currentIsland.dim / 1.75f;
        }
        else
        {
            Camera.main.transform.position = new Vector3(p.x * 3 / 2, 1, p.z * 3 / 2);
            Camera.main.orthographicSize   = (3 / 2) * game.currentIsland.dim / 1.75f;
        }
    }