Пример #1
0
    void Start()
    {
        mapGenerator = FindObjectOfType <GeneradorMapa>();

        maxViewDistance = detailLevels[detailLevels.Length - 1].visibleDistanceThreshold;
        chunkSize       = GeneradorMapa.tamañoMapaChunk - 1;
        chunksVisibles  = Mathf.RoundToInt(maxViewDistance / chunkSize);

        UpdateVisibleChunks();
    }
    public override void OnInspectorGUI()
    {
        GeneradorMapa mapGen = (GeneradorMapa)target;

        if (DrawDefaultInspector())
        {
            if (mapGen.autoUpdate)
            {
                mapGen.DrawMapInEditor();
            }
        }

        if (GUILayout.Button("Generate"))
        {
            mapGen.DrawMapInEditor();
        }
    }