using System.Collections; using System.Collections.Generic; using UnityEditor; using UnityEngine; public class GrasFieldManager : MonoBehaviour { public List alleJobs = new List(); public GrasJob currentJob; // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { } void GetAllJobs() { alleJobs.Clear(); for(int i=0; i < transform.childCount; i++) { alleJobs.Add(transform.GetChild(i).GetComponent()); } } public void BrushGras(Terrain terrain, GrassortenScriptableObject grassorte, Vector2 pos, float radius, bool shift) { if(currentJob == null) { GetAllJobs(); if(alleJobs.Count > 0) currentJob = alleJobs[0]; } if (currentJob == null) return; Debug.Log(pos); } public void ClearChunks() { while (transform.childCount > 0) { DestroyImmediate(transform.GetChild(0).gameObject); } } }