示例#1
0
    void Start()
    {
        this.particles       = new ParticleSystem.Particle[this.partcleAmount];
        this._particleSystem = this.gameObject.GetComponent <ParticleSystem>();
        this._particleSystem.maxParticles = this.partcleAmount;
        this.floatingThreshold            = this.particleSize * this.floatingThresholdRate;
        this.previousSizes = new float[this.partcleAmount];

        this._particleMoveModels = new ParticleMoveModel[this.partcleAmount];
        for (int i = 0; i < this._particleMoveModels.Length; i++)
        {
            this._particleMoveModels[i] = new ParticleMoveModel(
                new Vector3(
                    Random.Range(-200f, 200f),
                    Random.Range(-200f, 200f),
                    Random.Range(-100f, 100f)
                    ),
                this.normalColor,
                4f
                );
            this._particleMoveModels[i].isGravityZ    = this.isGravityZ;
            this._particleMoveModels[i].sizeThreshold = this.floatingThreshold;
            this._particleMoveModels[i].setGoalColor(Color.cyan);
            this._particleMoveModels[i].setFloatingRate(this.timeProcessRate);
        }

        this.sideSize = Mathf.FloorToInt(Mathf.Sqrt(this.partcleAmount));

        this._currentPattern = this.setSolidGrid;
        LeanTween.delayedCall(this.gameObject, 2.5f, () => { this._currentPattern = this.setFlowGridMotion; });
    }
示例#2
0
        public ModuleButtonTooltip(MemoryStruct.IContainer Raw)
        {
            this.Raw = Raw;

            if (null == Raw)
            {
                return;
            }

            var LabelRegexMatchSuccessIgnoreCase = new Func <string, bool>(
                Pattern => Raw?.LabelText?.Any(Label => Label?.Text?.RegexMatchSuccess(Pattern, System.Text.RegularExpressions.RegexOptions.IgnoreCase) ?? false) ?? false);

            var LabelAnyRegexMatchSuccessIgnoreCase = new Func <string[], bool>(
                SetPattern => SetPattern?.Any(LabelRegexMatchSuccessIgnoreCase) ?? false);

            IsWeapon = LabelAnyRegexMatchSuccessIgnoreCase(IsWeaponSetIndicatorLabelRegexPattern);

            IsTargetPainter = LabelAnyRegexMatchSuccessIgnoreCase(IsTargetPainterSetIndicatorLabelRegexPattern);

            IsHardener = LabelAnyRegexMatchSuccessIgnoreCase(IsHardenerSetIndicatorLabelRegexPattern);

            IsShieldBooster = LabelAnyRegexMatchSuccessIgnoreCase(IsShieldBoosterSetIndicatorLabelRegexPattern);
            IsArmorRepairer = LabelAnyRegexMatchSuccessIgnoreCase(IsArmorRepairerSetIndicatorLabelRegexPattern);

            IsMiner         = LabelAnyRegexMatchSuccessIgnoreCase(IsMinerSetIndicatorLabelRegexPattern);
            IsSurveyScanner = LabelRegexMatchSuccessIgnoreCase(@"Survey\s*Scan");

            var MatchFromLabelWithRegexPattern = new Func <string, System.Text.RegularExpressions.Match>(regexPattern =>
                                                                                                         Raw?.LabelText?.Select(LabelText => LabelText?.Text?.RegexMatchIfSuccess(regexPattern, System.Text.RegularExpressions.RegexOptions.IgnoreCase))?.WhereNotDefault()?.FirstOrDefault());

            var DistanceMinFromLabelWithRegexPattern = new Func <string, int?>(prefixPattern =>
                                                                               (int?)Distance.DistanceParseMin(MatchFromLabelWithRegexPattern(prefixPattern + Distance.DistanceRegexPattern)?.Value?.RegexMatchIfSuccess(Distance.DistanceRegexPattern)?.Value));

            RangeWithin  = DistanceMinFromLabelWithRegexPattern(@"^Range within\s*");
            RangeOptimal = DistanceMinFromLabelWithRegexPattern(@"Optimal range within\s*");
            RangeFalloff = DistanceMinFromLabelWithRegexPattern(@"Falloff range within\s*");

            SignatureRadiusModifierMilli = (int?)MatchFromLabelWithRegexPattern(@"(" + Number.DefaultNumberFormatRegexPatternAllowLeadingAndTrailingChars + @")\s*%\s*Signature\s*Radius\s*(Modifier|Bonus)")?.Groups[1]?.Value?.NumberParseDecimalMilli() / 100;

            ToggleKeyTextLabel = Raw?.LabelText?.OrderByNearestPointOnLine(new Vektor2DInt(-1, 1), label => label?.RegionCenter())?.FirstOrDefault();
            ToggleKey          = ToggleKeyTextLabel?.Text?.ListKeyCodeFromUIText()?.ToArray();
        }