/// <summary> /// Initializes a new instance of the <see cref="UGB.audio.Channel"/> class linked to the given controller. /// It automatically creates an AudioSource instance and controls it. /// </summary> /// <param name="multiChannelController">Multi channel controller.</param> public Channel(MultiChannelController multiChannelController) { controller = multiChannelController; Volume = 1; FadeDuration = 0.5f; Source = controller.gameObject.AddComponent<AudioSource>(); Source.loop = false; State = ChannelState.stopped; }
/// <summary> /// Initializes a new instance of the <see cref="UGB.audio.Channel"/> class linked to the given controller. /// It automatically creates an AudioSource instance and controls it. /// </summary> /// <param name="multiChannelController">Multi channel controller.</param> public Channel(MultiChannelController multiChannelController) { controller = multiChannelController; Volume = 1; FadeDuration = 0.5f; Source = controller.gameObject.AddComponent <AudioSource>(); Source.loop = false; State = ChannelState.stopped; }