void Awake() { volume.category = this; AudioElementManager.instance.categories.AddChild(GetComponent <Category>()); elements = GetComponentsInChildren <AudioElement>(); subcategories = ArrayExtended.GetComponentsInFirstChildren <Category>(gameObject); }
public Matrix2d(Index2d counts, IEnumerable <T> items) { if (items == null) { throw new ArgumentNullException(nameof(items)); } if (counts.X < 0 || counts.Y < 0) { throw new ArgumentOutOfRangeException(); } var array = InputAsArray(items); if (array.Length == 0) { _items = _emptyArray; return; } if (array.Length > counts.X * counts.Y) { throw new ArgumentException(); } _items = new T[counts.X, counts.Y]; _countX = _capacityX = counts.X; _countY = _capacityY = counts.Y; ArrayExtended.CopySingleToTwoDimensionArray(array, _items); }
private static Material AddNewMaterial(Color color) { materials = ArrayExtended.AppendArray( materials, CreateMaterial(color) ); return(materials [materials.Length - 1]); }
private AudioSource AddSource() { sources = ArrayExtended.AppendArray <AudioSource>(sources, CreateAudioSource()); return(sources[sources.Length - 1]); }