示例#1
0
    void Update()
    {
        var finish_list = PlayingList.Where(a => a.isPlaying == false);

        if (finish_list.Count() > 0)
        {
            foreach (var source in finish_list)
            {
                source.Stop();
                source.time    = 0f;
                source.enabled = false;
                source.loop    = false;
                source.clip    = null;
                source.name    = "_pool";
                source.gameObject.SetActive(false);
                FreeList.Push(source);
            }
            PlayingList.RemoveAll(s => s.isPlaying == false && s.enabled == false);
            m_NeedToNormalize = true;
        }
        if (m_NeedToNormalize)
        {
            Normalize();
            m_NeedToNormalize = false;
        }
    }
        /// <summary>
        /// Place an instanced area on the internal free list for its
        /// associated template area.
        /// </summary>
        /// <param name="InstancedArea">Supplies the instanced area to place on
        /// the free list.</param>
        private void ReleaseInstancedArea(uint InstancedArea)
        {
            uint         TemplateArea = GetLocalObject(InstancedArea, "ACR_AREA_INSTANCE_PARENT_AREA");
            Stack <uint> FreeList;

            if (!InstancedAreaFreeList.TryGetValue(TemplateArea, out FreeList))
            {
                FreeList = new Stack <uint>();
                InstancedAreaFreeList.Add(TemplateArea, FreeList);
            }

            FreeList.Push(InstancedArea);
        }
示例#3
0
 public void StopSound()
 {
     foreach (var source in PlayingList)
     {
         source.name = "_pool";
         source.Stop();
         source.time    = 0f;
         source.enabled = false;
         source.loop    = false;
         source.clip    = null;
         source.gameObject.SetActive(false);
         FreeList.Push(source);
     }
     PlayingList.Clear();
     ++InstanceIndex;
 }
示例#4
0
 internal static void Free(StackFrame frame)
 {
     FreeList.Push(frame);
 }