Пример #1
0
 public AudioEventPlayableBehaviour(Guid eventGuid, AudioEventPlayableAsset.StopMode stopMode, float volume, AudioEventParameterDictionary parameters, AudioContext audioContext, Transform ownerTransform)
     : this()
 {
     m_eventGuid      = eventGuid;
     m_stopMode       = stopMode;
     m_volume         = volume;
     m_parameters     = parameters;
     m_audioContext   = audioContext;
     m_ownerTransform = ownerTransform;
 }
        public override Playable CreatePlayable(PlayableGraph graph, GameObject owner)
        {
            //IL_000d: Unknown result type (might be due to invalid IL or missing references)
            //IL_0031: Unknown result type (might be due to invalid IL or missing references)
            //IL_0037: Unknown result type (might be due to invalid IL or missing references)
            //IL_005e: Unknown result type (might be due to invalid IL or missing references)
            //IL_0061: Unknown result type (might be due to invalid IL or missing references)
            //IL_0066: Unknown result type (might be due to invalid IL or missing references)
            if (string.IsNullOrEmpty(m_eventGuid))
            {
                return(Playable.get_Null());
            }
            Guid guid = Guid.ParseExact(m_eventGuid, "N");

            if (guid == Guid.Empty)
            {
                return(Playable.get_Null());
            }
            AudioContext context = TimelineContextUtility.GetContext <AudioContext>(graph);
            AudioEventPlayableBehaviour audioEventPlayableBehaviour = new AudioEventPlayableBehaviour(guid, m_stopMode, m_volume, m_parameters, context, owner.get_transform());

            return(ScriptPlayable <AudioEventPlayableBehaviour> .op_Implicit(ScriptPlayable <AudioEventPlayableBehaviour> .Create(graph, audioEventPlayableBehaviour, 0)));
        }
Пример #3
0
        internal AudioWorldMusicRequest(AudioReferenceWithParameters music, AudioReferenceWithParameters ambiance, [CanBeNull] AudioContext context, bool playAutomatically)
            : this()
        {
            //IL_0002: Unknown result type (might be due to invalid IL or missing references)
            //IL_0007: Unknown result type (might be due to invalid IL or missing references)
            //IL_0013: Unknown result type (might be due to invalid IL or missing references)
            //IL_0014: Unknown result type (might be due to invalid IL or missing references)
            //IL_001a: Unknown result type (might be due to invalid IL or missing references)
            //IL_001b: Unknown result type (might be due to invalid IL or missing references)
            //IL_0060: Unknown result type (might be due to invalid IL or missing references)
            //IL_00a1: Unknown result type (might be due to invalid IL or missing references)
            //IL_00e8: Unknown result type (might be due to invalid IL or missing references)
            this.music     = music;
            this.ambiance  = ambiance;
            this.context   = context;
            m_pendingState = (playAutomatically ? PendingStateChange.Play : PendingStateChange.None);
            Guid eventGuid  = music.get_eventGuid();
            Guid eventGuid2 = ambiance.get_eventGuid();

            if (!AssetManager.get_isReady())
            {
                Log.Error("Tried to load a world music but the AudioManager isn't ready.", 85, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Audio\\AudioWorldMusicRequest.cs");
                Fail(AssetManagerError.op_Implicit(60));
                return;
            }
            string bankName;

            if (eventGuid != Guid.Empty)
            {
                if (!AudioManager.TryGetDefaultBankName(eventGuid, out bankName))
                {
                    Log.Warning($"Could not get default bank name for requested world music with guid {eventGuid}.", 95, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Audio\\AudioWorldMusicRequest.cs");
                    Fail(AssetManagerError.op_Implicit(10));
                    return;
                }
            }
            else
            {
                bankName = string.Empty;
            }
            string bankName2;

            if (eventGuid2 != Guid.Empty)
            {
                if (!AudioManager.TryGetDefaultBankName(eventGuid2, out bankName2))
                {
                    Log.Warning($"Could not get default bank name for requested world ambiance with guid {eventGuid}.", 110, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Audio\\AudioWorldMusicRequest.cs");
                    Fail(AssetManagerError.op_Implicit(10));
                    return;
                }
            }
            else
            {
                bankName2 = string.Empty;
            }
            if (bankName.Length > 0)
            {
                m_musicBankLoadRequest = AudioManager.LoadBankAsync(bankName);
            }
            if (bankName2.Length > 0 && !bankName.Equals(bankName2))
            {
                m_ambianceBankLoadRequest = AudioManager.LoadBankAsync(bankName2);
            }
            state = State.Loading;
            s_instances.Add(this);
            UpdateInternal();
        }