using System.Collections; using System.Collections.Generic; using UnityEditor; using UnityEngine; public class GrasFieldManager : MonoBehaviour { public List alleFelder; // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { } public void UpdateChunks() { transform.GetChild(0).GetComponent().MakeChunks(); } public void BrushGras(Terrain terrain, GrassortenScriptableObject grassorte, Vector2 pos, float radius, bool shift) { if (alleFelder.Count > 0) alleFelder[0].GrasZeichnen(grassorte, pos * new Vector2(terrain.terrainData.size.x, terrain.terrainData.size.z), radius, shift); } #if UNITY_EDITOR public void ClearChunks() { while (transform.GetChild(0).childCount > 0) { transform.GetChild(0).GetComponent().ClearAllChunkData(); transform.GetChild(0).GetComponent().AlleChunkObjekte.Clear(); DestroyImmediate(transform.GetChild(0).GetChild(0).gameObject); } } #endif }