コード例 #1
0
ファイル: InPlayer.cs プロジェクト: mhfirdausi/VGDSix
 public void _internalPlayFollowing(InAudioNode node, GameObject controllingObject, RuntimeInfo playingInfo, float fade, LeanTweenType fadeType, AudioParameters parameters)
 {
     this.toFollow = controllingObject.transform;
     internalUpdate();
     _internalPlay(node, controllingObject, playingInfo, fade, fadeType, parameters);
 }
コード例 #2
0
        private RuntimeInfo PreparePlay(GameObject controllingObject, InAudioNode audioNode, InPlayer player)
        {
            ObjectAudioList tupleList = GetValue(GOAudioNodes, controllingObject);

            RuntimeInfo runtimeInfo = new RuntimeInfo();
            tupleList.InfoList.Add(runtimeInfo);
            runtimeInfo.Node = audioNode;
            runtimeInfo.Player = player;
            runtimeInfo.PlacedIn = tupleList;
            return runtimeInfo;
        }
コード例 #3
0
ファイル: InPlayer.cs プロジェクト: mhfirdausi/VGDSix
    /// <summary>
    /// Internal InAudio play method. Please use InAudio.Play(...) to play audio
    /// </summary>
    public void _internalPlay(InAudioNode node, GameObject controllingObject, RuntimeInfo playingInfo, float fade, LeanTweenType fadeType, AudioParameters parameters)
    {
        if (node.IsRootOrFolder)
        {
            Debug.LogWarning("InAudio: Cannot play Folder node \"" + node.Name + "\"");
            return;
        }

        if (audioParameters == null)
        {
            audioParameters = new AudioParameters();
        }

        if (parameters != null)
        {
            audioParameters.CopyFrom(parameters);
        }
        else
        {
            audioParameters.Reset();
        }


        dspPool = InAudioInstanceFinder.DSPTimePool;
        breakLoop = false;

        controlling = controllingObject;
        ParentBeforeFolder = TreeWalker.FindParentBeforeFolder(node);
        ParentFolder = ParentBeforeFolder._parent._nodeData as InFolderData;
        folderVolume = 1.0f;
        if (ParentFolder != null)
        {
            folderVolume = ParentFolder.runtimeVolume;
            ParentFolder.runtimePlayers.Add(this);
        }

        //This is to queue the next playing node, as the first clip will not yield a waitforseconds
        //firstClip = true;
        runtimeInfo = playingInfo;

        PlayingNode = node;
        DSPTime time = dspPool.GetObject();


        time.CurrentEndTime = AudioSettings.dspTime;
        isActive = true;
        fadeVolume = 1f;
        _spread = 0.0f;
        if (fade > 0)
        {
            LTDescr tweever = LeanTween.value(controllingObject, f =>
            {
                fadeVolume = f;
                SetFadeVolume(f);
            }, 0f, 1f, fade);
            tweever.tweenType = fadeType;
            fadeVolume = 0;
            SetFadeVolume(0);
        }

        StartCoroutine(StartPlay(node, time));
    }
コード例 #4
0
ファイル: InRuntimeHelper.cs プロジェクト: mhfirdausi/VGDSix
 public static void ReleaseRuntimeInfo(RuntimeInfo info)
 {
     //Swap remove and set the new position
     if (info != null)
     {
         info.PlacedIn.InfoList.FindSwapRemove(info);
         if (InAudioInstanceFinder.RuntimeInfoPool != null)
             InAudioInstanceFinder.RuntimeInfoPool.ReleaseObject(info);
     }
 }