public override void Update() { base.Update(); if (CachedValue == null) { return; } var array = (Array)CachedValue; _arrayLength = array.Length; if (_newLength >= 0 && _newLength != _arrayLength) { var newArray = Array.CreateInstance(_elementType, _newLength); Array.Copy(array, newArray, Mathf.Min(_arrayLength, _newLength)); _arrayLength = _newLength; CachedValue = array = newArray; Accessor.SetValue(array); } }