Exemplo n.º 1
0
        public override void Import(TextAsset packageJsonAsset, Action success, Action fail)
        {
            ExecuteAction(() =>
            {
                var packageJson      = JsonUtility.FromJson <PackageJson>(packageJsonAsset.text);
                var unityPackageFile = GetTempUnityPackagePath();

                var data = new FtpData
                {
                    Url              = url,
                    User             = user,
                    Password         = readPassword,
                    LocalFile        = unityPackageFile,
                    PackageName      = packageJson.name,
                    PackageVersion   = packageJson.version,
                    UnityPackageName = name,
                };

                FtpUtils.Download(data, () =>
                {
                    AssetDatabase.ImportPackage(unityPackageFile, true);
                    success();
                }, fail);
            }, fail);
        }
Exemplo n.º 2
0
 static void Main(string[] args)
 {
     Utility.LogMessage("START");
     FtpUtils.Download();
     Utility.LogMessage("END");
 }