Esempio n. 1
0
        // -------------------------------------------

        /*
         * Will process the queue of delayed events
         */
        void Update()
        {
            if (_instance == null)
            {
                return;
            }

            // DELAYED EVENTS
            for (int i = 0; i < listEvents.Count; i++)
            {
                TimedEventData eventData = listEvents[i];
                if (eventData.Time == -1000)
                {
                    eventData.Destroy();
                    listEvents.RemoveAt(i);
                    break;
                }
                else
                {
                    eventData.Time -= Time.deltaTime;
                    if (eventData.Time <= 0)
                    {
                        if ((eventData != null) && (BasicSystemEvent != null))
                        {
                            BasicSystemEvent(eventData.NameEvent, eventData.List);
                            eventData.Destroy();
                        }
                        listEvents.RemoveAt(i);
                        break;
                    }
                }
            }
        }
Esempio n. 2
0
        // -------------------------------------------

        /*
         * Will process the queue of delayed events
         */
        void Update()
        {
            if (!m_isLoadinAnAssetBundle)
            {
                if (m_loadBundles.Count > 0)
                {
                    string assetBundleURL     = (string)m_loadBundles[0].Objects[0];
                    int    assetBundleVersion = (int)m_loadBundles[0].Objects[1];
                    m_loadBundles.RemoveAt(0);
                    m_isLoadinAnAssetBundle = true;
                    if (LoadAssetBundle(assetBundleURL, assetBundleVersion))
                    {
                        m_isLoadinAnAssetBundle = false;
                    }
                }
            }

            // DELAYED EVENTS
            for (int i = 0; i < listEvents.Count; i++)
            {
                TimedEventData eventData = listEvents[i];
                if (eventData.Time == -1000)
                {
                    eventData.Destroy();
                    listEvents.RemoveAt(i);
                    break;
                }
                else
                {
                    eventData.Time -= Time.deltaTime;
                    if (eventData.Time <= 0)
                    {
                        if ((eventData != null) && (AssetBundleEvent != null))
                        {
                            AssetBundleEvent(eventData.NameEvent, eventData.List);
                            eventData.Destroy();
                        }
                        listEvents.RemoveAt(i);
                        break;
                    }
                }
            }
        }
Esempio n. 3
0
        // -------------------------------------------

        /*
         * ClearAssetBundleEvents
         */
        public void ClearAssetBundleEvents(string _nameEvent = "")
        {
            if (_nameEvent.Length == 0)
            {
                for (int i = 0; i < listEvents.Count; i++)
                {
                    listEvents[i].Time = -1000;
                }
            }
            else
            {
                for (int i = 0; i < listEvents.Count; i++)
                {
                    TimedEventData eventData = listEvents[i];
                    if (eventData.NameEvent == _nameEvent)
                    {
                        eventData.Time = -1000;
                    }
                }
            }
        }