Exemplo n.º 1
0
    void SpawnItem()
    {
        mapGeneration generator = mapGenerator.GetComponent <mapGeneration>();

        generator.GuaranteeOne(itemsToFind);
        itemToFind = GameObject.FindGameObjectWithTag("npcItem");
    }
 void Start()
 {
     maxViewDst             = detailLevels[detailLevels.Length - 1].visibleDistanceThreshold;
     mapGeneration          = FindObjectOfType <mapGeneration>();
     chunkSize              = mapGeneration.mapChunkSize - 1;
     chunksVisibleInViewDst = Mathf.RoundToInt(maxViewDst / chunkSize);
     UpdateVisableCunks();
 }
    public override void OnInspectorGUI()
    {
        mapGeneration mapGen = (mapGeneration)target;

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

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