Ejemplo n.º 1
0
        public void AddToGameObjectPool(Object obj)
        {
            var unityObj = obj as UnityObject;

            if (unityObj == null)
            {
                unityObj = UnityObject.GetUnityObject(obj as GameObject);
            }

            _assetManager.Recycle(unityObj);
        }
Ejemplo n.º 2
0
        public static void Destroy()
        {
            if (SingletonManager.Get <FreeUiManager>().Contexts1 != null && SingletonManager.Get <FreeUiManager>().Contexts1.session != null && SingletonManager.Get <FreeUiManager>().Contexts1.session.clientSessionObjects != null)
            {
                var assetManager = SingletonManager.Get <FreeUiManager>().Contexts1.session.commonSession.AssetManager;

                foreach (string buddle in cache.Keys)
                {
                    foreach (Queue <GameObject> que in cache[buddle].Values)
                    {
                        foreach (GameObject obj in que)
                        {
                            var unityObj = UnityObject.GetUnityObject(obj);
                            assetManager.Recycle(unityObj);
                        }
                    }
                }
            }
            cache.Clear();
        }