private void TriggerFadeIn(UnityEngine.Playables.Playable playable)
    {
        var currentClipTime = UnityEngine.Playables.PlayableExtensions.GetTime(playable);
        var fadeDuration    = UnityEngine.Mathf.Max(easeInDuration, blendInDuration) - currentClipTime;

        if (fadeDuration > 0)
        {
            fadeinTriggered = true;
            akEvent.ExecuteAction(eventObject, AkActionOnEventType.AkActionOnEventType_Pause, 0, blendOutCurve);
            akEvent.ExecuteAction(eventObject, AkActionOnEventType.AkActionOnEventType_Resume, (int)(fadeDuration * 1000), blendInCurve);
        }
    }
示例#2
0
 protected void triggerFadeIn(float currentClipTime)
 {
     if (eventObject != null && akEvent != null)
     {
         var fadeDuration = UnityEngine.Mathf.Max(easeInDuration - currentClipTime, blendInDuration - currentClipTime);
         if (fadeDuration > 0.0f)
         {
             akEvent.ExecuteAction(eventObject, AkActionOnEventType.AkActionOnEventType_Pause, 0,
                                   AkCurveInterpolation.AkCurveInterpolation_Linear);
             akEvent.ExecuteAction(eventObject, AkActionOnEventType.AkActionOnEventType_Resume, (int)(fadeDuration * 1000.0f),
                                   AkCurveInterpolation.AkCurveInterpolation_Linear);
         }
     }
 }
示例#3
0
    public override void HandleEvent(UnityEngine.GameObject in_gameObject)
    {
        var gameObj = useOtherObject && in_gameObject != null ? in_gameObject : gameObject;

        soundEmitterObject = gameObj;

        if (enableActionOnEvent)
        {
            data.ExecuteAction(gameObj, actionOnEventType, (int)transitionDuration * 1000, curveInterpolation);
            return;
        }

        if (useCallbacks)
        {
            uint flags = 0;
            for (var i = 0; i < Callbacks.Count; ++i)
            {
                if (Callbacks[i].GameObject && !string.IsNullOrEmpty(Callbacks[i].FunctionName))
                {
                    flags |= Callbacks[i].Flags.value;
                }
            }

            if (flags != 0)
            {
                playingId = data.Post(gameObj, flags, Callback);
                return;
            }
        }

        playingId = data.Post(gameObj);
    }
示例#4
0
    public override void HandleEvent(UnityEngine.GameObject in_gameObject)
    {
        var gameObj = useOtherObject && in_gameObject != null ? in_gameObject : gameObject;

        soundEmitterObject = gameObj;

        if (enableActionOnEvent)
        {
            data.ExecuteAction(gameObj, actionOnEventType, (int)transitionDuration * 1000,
                               curveInterpolation);
            return;
        }

        if (m_callbackData != null)
        {
            playingId = data.Post(gameObj, (uint)m_callbackData.uFlags, Callback);
        }
        else
        {
            playingId = data.Post(gameObj);
        }
    }