Пример #1
0
        public PKKeyboardLettersLoader(TextAsset configFile)
        {
            PKKeyboardLettersLoader config = PYXML.DeserializerFromContent <PKKeyboardLettersLoader>(configFile.text);

            Confirm   = config.Confirm;
            Cancel    = config.Cancel;
            Backspace = config.Backspace;
            ClearAll  = config.ClearAll;
            Pages     = config.Pages;
        }
Пример #2
0
        private IEnumerator CreateAssetBundleReference(string bundlePath, PYBundlePriority priority)
        {
            DirectoryInfo dir  = new DirectoryInfo(bundlePath);
            BundleData    data = Bundles[priority].Find((t) => dir.Parent.Name == t.Name);

            if (data == null)
            {
                data = new BundleData(dir.Parent.Name.Split('.')[0]);
                Bundles[priority].Add(data);
            }

            AssetBundleCreateRequest bundleRequest = AssetBundle.LoadFromFileAsync(bundlePath);

            yield return(bundleRequest);

            data.Bundles.Add(bundleRequest.assetBundle);
            data.AbsoluteBundlePaths.Add(bundlePath);

            if (bundleRequest.assetBundle != null)
            {
                // Load PYBundleVersion for this bundleData
                TextAsset versionFile = bundleRequest.assetBundle.LoadAsset <TextAsset>("version");
                if (versionFile == null)
                {
                    Debug.LogWarning(string.Format("PYBUNDLE ({0}): Reading bundle ({1}) version.xml file not found!",
                                                   this.ToString().Replace("PYBundleSystem.", ""), data.Name));
                }
                else
                {
                    data.Version = PYXML.DeserializerFromContent <PYBundleVersion>(versionFile.text);

                    // Debug for unity output file
#if !UNITY_EDITOR
                    Debug.LogWarning(string.Format("PYBUNDLE ({0}): Reading bundle ({1}) version: ({2}) creationDate: ({3}) isReadable/Uptodate: ({4})",
                                                   this.ToString().Replace("PYBundleSystem.", ""), data.Name, data.Version.Version, data.Version.CreationDate, data.Version.IsReadable));
#endif
                }
            }
        }