void onGenerationEnd(GenerationFinishedEvent e)
    {
        m_angle.y = LevelMap.instance.startRotation;
        var map = GameObject.Find("GameMap");

        transform.position = new Vector3(LevelMap.instance.startPos.x * 2 * map.transform.localScale.x, transform.position.y, LevelMap.instance.startPos.y * 2 * map.transform.localScale.z);
    }
示例#2
0
    void onGenerationEnd(GenerationFinishedEvent e)
    {
        var map = LevelMap.instance.minimap;

        m_surface.sprite = Sprite.Create(map, new Rect(0, 0, map.width, map.height), new Vector2(map.width / 2, map.height / 2));

        Vector2 mapSize = new Vector2(900, 900);

        m_mapScale  = new Vector2(mapSize.x / map.width, mapSize.y / map.height);
        m_mapOffset = -mapSize / 2;

        foreach (var p in LevelMap.instance.importantPoints)
        {
            var cross = Instantiate(m_pointPrefab, transform);
            cross.transform.localPosition = new Vector3(p.x * m_mapScale.x + m_mapOffset.x, p.y * m_mapScale.y + m_mapOffset.y, 0);
            cross.transform.Find("Label").GetComponent <Text>().text = p.name;
        }

        var bdxP = LevelMap.instance.bordeaux;
        var bdx  = Instantiate(m_pointPrefab, transform);

        bdx.transform.localPosition = new Vector3(bdxP.x * m_mapScale.x + m_mapOffset.x, bdxP.y * m_mapScale.y + m_mapOffset.y, 0);
        var text = bdx.transform.Find("Label").GetComponent <Text>();

        text.text  = bdxP.name;
        text.color = Color.red;

        m_mapScale.x /= m_gameMap.transform.localScale.x * 2;
        m_mapScale.y /= m_gameMap.transform.localScale.z * 2;

        m_set = true;
    }