Пример #1
0
        protected override void OnDestroy()
        {
            //obliterate pooler
            if (_pooler != null)
            {
                _pooler.Destroy();
                _pooler = null;
            }

            //unload ball
            AssetService.UnloadAsset(_ballPrefab.name, true);
        }
Пример #2
0
        public virtual void ClearMenuOptions()
        {
            if (positionAtMouse)
            {
                _rectTransform.anchoredPosition = Input.mousePosition;
            }

            // Remove the old
            foreach (var item in _menuOptions)
            {
                _pool.Destroy(item.uiElement);
                //Destroy(item.uiElement.gameObject);
            }

            _menuOptions.Clear();
        }
        protected virtual void UpdateAllAudioSources()
        {
            for (int i = activeAudioSources.Count - 1; i >= 0; i--)
            {
                var source = activeAudioSources[i];

                bool delete;
                UpdateAudioSource(source, out delete);

                if (delete)
                {
                    activeAudioSources.RemoveAt(i);
                    audioSourcePool.Destroy(source);
                }
            }
        }
Пример #4
0
        protected virtual IEnumerator DestroyAfter(NoticeMessageUI item, float time)
        {
            yield return(new WaitForSeconds(time));

            pool.Destroy(item);
        }