예제 #1
0
 void Awake()
 {
     volume.category = this;
     AudioElementManager.instance.categories.AddChild(GetComponent <Category>());
     elements      = GetComponentsInChildren <AudioElement>();
     subcategories = ArrayExtended.GetComponentsInFirstChildren <Category>(gameObject);
 }
예제 #2
0
        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);
        }
예제 #3
0
 private static Material AddNewMaterial(Color color)
 {
     materials = ArrayExtended.AppendArray(
         materials,
         CreateMaterial(color)
         );
     return(materials [materials.Length - 1]);
 }
예제 #4
0
 private AudioSource AddSource()
 {
     sources = ArrayExtended.AppendArray <AudioSource>(sources, CreateAudioSource());
     return(sources[sources.Length - 1]);
 }