private void Awake() { if (_instance != null && _instance != this) { Destroy(this.gameObject); } else { _instance = this; } }
void Start() { sensorManager = GetComponentInParent <SensorManager>(); UpdateValues(); for (int i = 0; i < 8; i++) { GameObject sensorLine = Instantiate(sensorManager.linePrefab, transform); sensorLines.Add(sensorLine.GetComponent <SensorLine>()); } RearrangeLinesCurved(); }