using System.Collections; using System.Collections.Generic; using UnityEngine; public class Crystall : MonoBehaviour { public static DirectOwner _countOwners; public int _count = 0; [SerializeField] private List enemies ; private DirectOwner _cristallObject; private void Start() {/* if( _countOwners == null) { _countOwners = GameObject.FindObjectOfType().GetComponent(); } else { return; } _count = _countOwners.count; */ // if(_countOwners == null) // _countOwners = ; //_csore._countOwners = GameObject.FindObjectOfType(); //enemies; //enemies.Add(FindObjectOfType()); //_cristallObject = GetComponent(); } private void Update() { _count = FindObjectsOfType().Length; if(enemies.Count < _count) enemies.Add(FindObjectOfType()); // for(int i = _count; i < enemies.Count; i++) // { // enemies[i] = // } } }