Beispiel #1
0
    public void SetBound(GameObject map)
    {
        SuperTiled2Unity.SuperMap config = map.GetComponent <SuperTiled2Unity.SuperMap>();
        float cameraSize = Camera.main.orthographicSize;

        tLX = map.transform.position.x + cameraSize;
        tLY = map.transform.position.y - cameraSize;
        bRX = map.transform.position.x + config.m_Width - cameraSize;
        bRY = map.transform.position.y - config.m_Height + cameraSize;

        /*FastMove();*/
    }
Beispiel #2
0
    void Start()
    {
        string locationName = PlayerPrefs.GetString("locationName", "Castle1");

        foreach (SuperTiled2Unity.SuperMap prefab in locationPrefabs)
        {
            if (prefab.name.Equals(locationName))
            {
                map = Instantiate <SuperTiled2Unity.SuperMap>(prefab, Vector3.zero, Quaternion.identity);
                movementHandler.grid = map.GetComponentInChildren <Grid>();
                break;
            }
        }
        saveLoadHandler.Load();
    }