Beispiel #1
0
    // Use this for initialization
    void Start()
    {
        //pass and set variables
        stdmath = GameObject.Find("Scripter").GetComponent(typeof(STDMathX)) as STDMathX;
        mapGen  = GameObject.Find("Scripter").GetComponent(typeof(MapGeneratorX)) as MapGeneratorX;
        Random.InitState(stdmath.seed);


        //set camera positions
        mapSize   = mapGen.mapSize;
        mapBounds = mapGen.GetMapBounds();
        centerPos = new Vector2(mapBounds.center.x, mapBounds.center.y);
        bottomPos = new Vector2();
        rightPos  = new Vector2((mapBounds.size.x / 2), mapBounds.center.y);
        leftPos   = new Vector2((mapBounds.size.x / -(2)), mapBounds.center.y);
        topPos    = new Vector2(mapBounds.center.x, mapBounds.size.y);

        Debug.Log("center: " + centerPos);
        Debug.Log("Bottom: " + bottomPos);
        Debug.Log("right: " + rightPos);
        Debug.Log("Left: " + leftPos);
        Debug.Log("Top: " + topPos);
        //set camera to initial position
        SetCameraPosition(centerPos);
        SetCameraZoom(zoom);
    }