Exemplo n.º 1
0
    void AddAreaByName(string areaName)
    {
        TextAsset asset = Resources.Load("areas/" + areaName) as TextAsset;

        if (asset != null)
        {
            AreaData areaDataActive = JsonUtility.FromJson <AreaData> (asset.text);
            totalDistance += areaDataActive.z_length / 2;
            areaCreator.AddSceneObjectsToNewArea(areaName, areaDataActive, totalDistance);
            totalDistance += areaDataActive.z_length / 2;
        }
        else
        {
            Debug.LogError("Loco, no existe esta area: " + areaName + " en Respurces/areas/");
        }
    }