Exemplo n.º 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;
        }
Exemplo n.º 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
                }
            }
        }
Exemplo n.º 3
0
        public static void CreateVersionFile(string path)
        {
            if (path[path.Length - 1] == '/')
            {
                path = path.Remove(path.Length - 1, 1);
            }

            string filePath = path + "/version.xml";

            PYBundleVersion version = new PYBundleVersion();

            if (File.Exists(filePath))
            {
                version = PYXML.Deserializer <PYBundleVersion>(filePath);
            }

            // Update informations
            version.Version      = BuildModeEditor.GetBundleVersion();
            version.CreationDate = DateTime.Now.ToString("MM/dd/yyyy HH:mm:ss");
            PYXML.Serializer(filePath, version);

            AssetDatabase.Refresh();
            PYBundleBuildWindow.Instance.Focus();
        }