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

        UpdateVisibleChunks();
    }
コード例 #2
0
    public override void OnInspectorGUI()
    {
        plgMapGenerator mapGen = (plgMapGenerator)target;

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

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