Esempio n. 1
0
    void Start()
    {
        // Buffer allocation
        _audioData = new NativeArray <float>(4096, Allocator.Persistent);

        // Clear the UI contents.
        _deviceList.ClearOptions();
        _channelList.ClearOptions();
        _statusText.text = "";

        // Null device option
        _deviceList.options.Add(new Dropdown.OptionData()
        {
            text = "--"
        });

        // Device list initialization
        _deviceList.options.AddRange(
            Enumerable.Range(0, DeviceDriver.DeviceCount).
            Select(i => DeviceDriver.GetDeviceName(i)).
            Select(name => new Dropdown.OptionData()
        {
            text = name
        }));

        _deviceList.RefreshShownValue();
    }