static SquirrelUpdater() {
     // TODO: Read beta from the executable informationalversion... ?
     var releaseInfo = GetReleaseInfo();
     Info = new SquirrelInfo {
         Uri = new Uri(CommonUrls.SoftwareUpdateUri, "drop/rel" + releaseInfo.Folder),
         Package = "PlaywithSIX" + releaseInfo.Txt
     };
 }
예제 #2
0
 static SquirrelUpdater() {
     // TODO: Read beta from the executable informationalversion... ?
     var releaseInfo = GetReleaseInfo();
     Info = new SquirrelInfo {
         Uri = new Uri(CdnUrl2, "/software/withSIX/drop/sync" + releaseInfo.Folder),
         Package = "sync" + releaseInfo.Txt
     };
 }
예제 #3
0
        static SquirrelUpdater()
        {
            // TODO: Read beta from the executable informationalversion... ?
            var releaseInfo = GetReleaseInfo();

            Info = new SquirrelInfo {
                Uri     = new Uri(CommonUrls.SoftwareUpdateUri, "drop/rel" + releaseInfo.Folder),
                Package = "PlaywithSIX" + releaseInfo.Txt
            };
        }
예제 #4
0
        public static async Task <bool> UpdateIfPossible()
        {
            if (!Exists())             // Ignore updating if Update.exe does not exist
            {
                log.Warn("No Updater found");
                return(false);
            }

            string url = await GetUpdateUrl();

            log.Info("Trying to update from " + url);

            BufferedCommandResult result = await Cli.Wrap(relativePath)
                                           .WithArguments(b => b.Add($"--checkForUpdate={url}", true))
                                           .WithValidation(CommandResultValidation.None)
                                           .ExecuteBufferedAsync();

            if (result.ExitCode != 0)
            {
                log.Error($"Checked for updates with output and ERROR:\n{result.StandardOutput}\n{result.StandardError}");
                return(false);
            }

            log.Info($"Checked for updates with output:\n{result.StandardOutput}");

            string json = result.StandardOutput.Split(Environment.NewLine, StringSplitOptions.RemoveEmptyEntries).Last();

            SquirrelInfo info = JsonConvert.DeserializeObject <SquirrelInfo>(json);

            if (info.CurrentVersion == info.FutureVersion)
            {
                log.Info($"No update available");
                return(false);
            }

            result = await Cli.Wrap(relativePath)
                     .WithArguments(b => b.Add($"--update={url}", true))
                     .WithValidation(CommandResultValidation.None)
                     .ExecuteBufferedAsync();

            if (result.ExitCode != 0)
            {
                log.Error($"Ran updater with output and ERROR:\n{result.StandardOutput}\n{result.StandardError}");
                return(false);
            }

            log.Info($"Ran updater with output:\n{result.StandardOutput}");

            log.Info("Restarting application for update.");

            Process.Start(relativePath, string.Format("--processStartAndWait \"{0}\"", exeName));

            return(true);
        }
    // Update is called once per frame
    void Update()
    {
        GameObject targ     = null;
        float      distance = 0;

        for (float a = -info.eyeAngleOffset; a < 2 * info.eyeAngleOffset; a += 2 * info.eyeAngleOffset)
        {
            for (float i = 0; i < 180; i += info.sightClarity)
            {
                float rad    = (i + a) * Mathf.Deg2Rad;
                float radius = (info.sightScale * Mathf.Sin(rad)) / (Mathf.Abs(90 - ((i) % 180)) / info.transformFade + info.transformSmooth);

                Vector3 sightLine = this.transform.rotation * (new Vector3(Mathf.Cos(rad), 0, Mathf.Sin(rad)));

                float      range = 0;
                RaycastHit hit;
                if (Physics.Raycast(this.transform.position, sightLine, out hit, radius, 1 << 8))
                {
                    range = hit.distance;
                    SquirrelInfo itsInfo = hit.transform.GetComponent <SquirrelInfo>();
                    if ((targ == null || distance < hit.distance) && info.canMate && itsInfo.canMate && (itsInfo.hasYC ^ info.hasYC))
                    {
                        targ     = hit.collider.gameObject;
                        distance = hit.distance;
                    }
                }
                else
                {
                    range = radius;
                }

                Debug.DrawLine(this.transform.position, this.transform.position + range * sightLine);
            }
        }

        SetTarget(targ);
    }
 // Use this for initialization
 void Start()
 {
     destination = this.transform.position;
     info        = this.GetComponent <SquirrelInfo>();
 }
 // Use this for initialization
 void Start()
 {
     info = this.GetComponent <SquirrelInfo>();
 }
예제 #8
0
    void OnCollisionEnter(Collision collision)
    {
        SquirrelInfo thatInfo = collision.gameObject.GetComponent <SquirrelInfo>();

        if (thatInfo.gameObject.layer == this.gameObject.layer && info.canMate && thatInfo.canMate &&
            (thatInfo.hasYC ^ info.hasYC) && (info.target == thatInfo.gameObject || thatInfo.target == this.gameObject))
        {
            resetCollided();
            thatInfo.GetComponent <SquirrelReproduce>().resetCollided();

            if (thatInfo.target == this.gameObject)
            {
                thatInfo.GetComponent <SquirrelMove>().resetTarget();
            }
            if (info.target == thatInfo.gameObject)
            {
                this.GetComponent <SquirrelMove>().resetTarget();
            }

            if (!info.hasYC)
            {
                Transform    child   = GameObject.Instantiate(prefab);
                SquirrelInfo itsInfo = child.GetComponent <SquirrelInfo>();
//				SquirrelInfo itsInfo = new SquirrelInfo();
//				child.gameObject.SetActive(false);

                float randRange     = (info.randomnizerRange + thatInfo.randomnizerRange) / 2;
                float moveScalar    = (info.moveChanceScaler + thatInfo.moveChanceScaler) / 2;
                float clarityScaler = (info.sightClarityScaler + thatInfo.sightClarityScaler) / 2;
                float coolScalar    = (info.cooldownScaler + thatInfo.cooldownScaler) / 2;

                float num1 = Random.Range(-randRange, randRange) * moveRangeScaler + (info.maxRange + thatInfo.maxRange) / 2;
                float num2 = Random.Range(-randRange, randRange) * moveRangeScaler + (info.minRange + thatInfo.minRange) / 2;
                if (num1 >= num2)
                {
                    itsInfo.maxRange = num1; itsInfo.minRange = num2;
                }
                else
                {
                    itsInfo.minRange = num1; itsInfo.maxRange = num2;
                }

                num1 = Random.Range(-randRange, randRange) * moveSpeedScaler + (info.maxMoveSpeed + thatInfo.maxMoveSpeed) / 2;
                num2 = Random.Range(-randRange, randRange) * moveSpeedScaler + (info.minMoveSpeed + thatInfo.minMoveSpeed) / 2;
                if (num1 >= num2)
                {
                    itsInfo.maxMoveSpeed = num1; itsInfo.minMoveSpeed = num2;
                }
                else
                {
                    itsInfo.minMoveSpeed = num1; itsInfo.maxMoveSpeed = num2;
                }

                itsInfo.sightScale         = Random.Range(-randRange, randRange) * sightScaleScaler + (info.sightScale + thatInfo.sightScale) / 2;
                itsInfo.sightClarity       = Random.Range(-randRange, randRange) * clarityScaler + (info.sightClarity + thatInfo.sightClarity) / 2;
                itsInfo.moveChance         = Random.Range(-randRange, randRange) * moveScalar + (info.moveChance + thatInfo.moveChance) / 2;
                itsInfo.rotateSpeed        = Random.Range(-randRange, randRange) * rotateSpeedScaler + (info.rotateSpeed + thatInfo.rotateSpeed) / 2;
                itsInfo.reproduceCooldown  = Random.Range(-randRange, randRange) * coolScalar + (info.reproduceCooldown + thatInfo.reproduceCooldown) / 2;
                itsInfo.birthCooldown      = Random.Range(-randRange, randRange) * coolScalar + (info.birthCooldown + thatInfo.birthCooldown) / 2;
                itsInfo.moveChanceScaler   = moveScalar + Random.Range(-randRange, randRange) * moveScalar;
                itsInfo.sightClarityScaler = clarityScaler + Random.Range(-randRange, randRange) * clarityScaler;
                itsInfo.cooldownScaler     = coolScalar + Random.Range(-randRange, randRange) * coolScalar;
                itsInfo.randomnizerRange   = randRange + Random.Range(-randRange, randRange) * randRange;
                itsInfo.hasYC = Random.Range(0f, 1f) < 0.5;

//				child.gameObject.SetActive(true);
                child.gameObject.GetComponent <SquirrelReproduce>().setBirth();
            }
        }
    }