private static void MakePackage()
        {
            var path = MouseSelector.GetSelectedPathOrFallback();

            if (!string.IsNullOrEmpty(path))
            {
                if (Directory.Exists(path))
                {
                    var installPath = string.Empty;

                    if (path.EndsWith("/"))
                    {
                        installPath = path;
                    }
                    else
                    {
                        installPath = path + "/";
                    }

                    new PackageVersion
                    {
                        InstallPath = installPath,
                        Version     = "v0.0.0"
                    }.Save();

                    AssetDatabase.Refresh();
                }
            }
        }
Exemple #2
0
    public IEnumerator DelayActive(float sec)
    {
        yield return(new WaitForSeconds(sec));

        isActive = true;
        MouseSelector.ActiveSelector(target);
    }
Exemple #3
0
 public void ActiveIt(List <GameObject> targets, int stepNum)
 {
     this.stepNum = stepNum;
     stepCount    = 0;
     this.targets = targets;
     isActive     = true;
     MouseSelector.ActiveSelector(targets);
     //Debug.Log("Active");
 }
Exemple #4
0
 public void ActiveIt(GameObject target, int stepNum)
 {
     this.stepNum = stepNum;
     stepCount    = 0;
     this.target  = target;
     isActive     = true;
     MouseSelector.ActiveSelector(target);
     targets = new List <GameObject>();
     Debug.Log("Active");
 }
Exemple #5
0
        static string MakeInstallPath()
        {
            var path = MouseSelector.GetSelectedPathOrFallback();

            if (path.EndsWith("/"))
            {
                return(path);
            }

            return(path + "/");
        }
Exemple #6
0
    private void Update()
    {
        if (isActive)
        {
            GameObject temp = MouseSelector.GetSelected();
            if (temp)
            {
                Debug.Log("temp:" + temp.name);


                if (targets.Contains(temp))
                {
                    targets.Remove(temp);
                }

                stepCount++;

                if (stepCount < stepNum)
                {
                    if (targets.Count == 0)
                    {
                        isActive = false;
                    }
                    target = temp;
                    Debug.Log("Catched! -> " + temp);
                    ExecuteEvent();
                    StartCoroutine(DelayActive(0.5f));
                }

                if (stepCount == stepNum)
                {
                    if (targets.Count == 0)
                    {
                        isActive = false;
                    }
                    target = temp;
                    ExecuteEvent();
                    //target = null;
                    stepCount = 0;
                    StopCoroutine("delayActive");
                    LevelManager.NextLevel();
                }
            }
        }
        //Debug.Log(stepCount+"/"+stepNum);
    }
Exemple #7
0
        static void MakePackage()
        {
            string packagePath       = MouseSelector.GetSelectedPathOrFallback();
            string packageConfigPath = Path.Combine(packagePath, "Package.assets");

            PackageConfig packageConfig = null;

            if (File.Exists(packageConfigPath))
            {
                packageConfig             = PackageConfig.LoadFromPath(packageConfigPath);
                packageConfig.PackagePath = packagePath;
            }
            else
            {
                packageConfig = new PackageConfig(packagePath);
            }
            packageConfig.SaveLocal();
        }
Exemple #8
0
        static void UploadPackage()
        {
            string packagePath       = MouseSelector.GetSelectedPathOrFallback();
            string packageConfigPath = packagePath.EndsWith(".asset") ? packagePath : packagePath.Append(".asset").ToString();

            if (File.Exists(packageConfigPath))
            {
                string err = string.Empty;

                PackageConfig config             = PackageConfig.LoadFromPath(packageConfigPath);
                string        serverUploaderPath = Application.dataPath.CombinePath(config.PackageServerGitUrl.GetLastWord());

                if (!Directory.Exists(serverUploaderPath))
                {
                    RunCommand(string.Empty, "git clone ".Append(config.PackageServerGitUrl).ToString());
                }

                ZipUtil.ZipDirectory(config.PackagePath,
                                     IOUtils.CreateDirIfNotExists(serverUploaderPath.CombinePath(config.Name)).CombinePath(config.Name + ".zip"));

                PackageListConfig
                .MergeGitClonedPackageList(config)
                .SaveExport(config.PackageServerGitUrl);

                RunCommand(config.PackageServerGitUrl.GetLastWord(), string.Format(
                               "git add . && git commit -m \"{0}\" && git push",
                               config.ReleaseNote.IsNullOrEmpty()
                                                ? "no release note"
                                                : config.Name.Append(" ").Append(config.Version).AppendFormat(" {0}", config.ReleaseNote).ToString()));

                RunCommand(string.Empty, "rm -rf " + config.PackageServerGitUrl.GetLastWord());

                AssetDatabase.Refresh();

                Application.OpenURL(config.PackageServerGitUrl);
            }
            else
            {
                Log.W("no package.json file in folder:{0}", packagePath);
            }
        }