コード例 #1
0
    void Start()
    {
        _mrMapGenerator = FindObjectOfType <MRMapGenerator>();

        maxViewDist             = detailLevels[detailLevels.Length - 1].visibleDistThreshold;
        chunkSize               = MRMapGenerator.mapChunkSize - 1;
        chunksVisibleInViewDist = Mathf.RoundToInt(maxViewDist / chunkSize);

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

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

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