示例#1
0
    private void Start()
    {
        mapGenerator                = FindObjectOfType <plgMapGenerator>();
        maxViewDistance             = detailLevels[detailLevels.Length - 1].visibleDistanceThreshold;
        chunkSize                   = plgMapGenerator.mapChunkSize - 1;
        chunksVisableInViewDistance = Mathf.RoundToInt(maxViewDistance / chunkSize);

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

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

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