Ejemplo n.º 1
0
        void SpawnCube()
        {
            Debug.LogError("SpawnCube");
            handle = AddressableResMgr.S.InstantiateAsync("CellNode", OnAssetLoaded);

            // if (handle != null)
            //     (handle).InstantiateAsync(OnAssetLoaded);
        }
Ejemplo n.º 2
0
        public AddressableGameObjectRes InstantiateAsync(string assetName, Action <GameObject> completeCallback = null, string label = "")
        {
            BaseAddressableRes res = null;

            if (!m_ResMap.TryGetValue(assetName, out res))
            {
                res           = new AddressableGameObjectRes();
                res.assetName = assetName;
                m_LstHandle.Add(res);
                m_ResMap.Add(assetName, res);
            }
            (res as AddressableGameObjectRes).InstantiateAsync(completeCallback);
            return(res as AddressableGameObjectRes);
        }