Неожиданный символ 'void' для c#в unity
using System.Collections; using System.Collections.Generic; using UnityEngine; public class Apple : MonoBehaviour { [Header("Set in Inspector")] public static float bottomY = -20f; // Use this for initialization void Start () { } public void AppleDestroyed(){ GameObject[] tAppleArray = GameObject.FindGameObjectsWithTag ("Apple"); foreach (GameObject tGO in tAppleArray) { Destroy (tGO); } } // Update is called once per frame void Update() { if ( transform.position.y < bottomY ) { Destroy( this.gameObject ); ApplePicker apScript = Camera.main.GetComponent<ApplePicker>(); apScript.AppleDestroyed(); } } }
Что я уже пробовал:
Я выделил курсивом строку 20, так как именно с ней у него возникли проблемы. Проблемная линия по-прежнему включает в себя " обновление пустоты"