private void Update() { if (Instance == null) { Instance = this; } if (trackObjects.Count <= 0) { return; } if (trackObjects.Count > MAX_OBJECTS) { CheckClosestObjects(); } else { sortedList = trackObjects; } for (var i = 0; i < MAX_OBJECTS; i++) { if (sortedList.Count <= i || sortedList[i] == null) { m_values[i] = Vector4.zero; } else { m_values[i] = sortedList[i].GetVector() * sortedList[i].gameObject.activeSelf.ToInt() * sortedList[i].enabled.ToInt(); } } }
private void OnAwake() { Instance = this; }
private void OnEnable() { Instance = this; }