public float GetSturdinessValue(float level)
        {
            Shield         shield          = (Shield)this.m_item;
            AttributeCurve sturdinessValue = shield.sturdiness;

            return(sturdinessValue.curve.Evaluate(level));
        }
        public float GetLongevityValue(float level)
        {
            Shield         shield         = (Shield)this.m_item;
            AttributeCurve longevityCurve = shield.longevity;

            return(longevityCurve.curve.Evaluate(level));
        }
        public float GetDeflectionValue(float level)
        {
            Shield         shield          = (Shield)this.m_item;
            AttributeCurve deflectionCurve = shield.deflection;

            return(deflectionCurve.curve.Evaluate(level));
        }
Exemple #4
0
        public float GetFireRateValue(float level)
        {
            MeleeWeapon    meleeWeapon   = (MeleeWeapon)this.m_item;
            AttributeCurve fireRateCurve = meleeWeapon.fireRate;

            return(fireRateCurve.curve.Evaluate(level));
        }
        public float GetArmourValue(float level)
        {
            Wear           wear        = (Wear)this.m_item;
            AttributeCurve armourCurve = wear.armour;

            return(armourCurve.curve.Evaluate(level));
        }
        public float GetSpecialEffectValue(float level)
        {
            Bow            bow = (Bow)this.m_item;
            AttributeCurve specialEffectCurve = bow.specialEffect;

            return(specialEffectCurve.curve.Evaluate(level));
        }
        public float GetHandlingValue(float level)
        {
            Bow            bow           = (Bow)this.m_item;
            AttributeCurve handlingCurve = bow.handling;

            return(handlingCurve.curve.Evaluate(level));
        }
Exemple #8
0
        public float GetLongevityValue(float level)
        {
            MeleeWeapon    meleeWeapon    = (MeleeWeapon)this.m_item;
            AttributeCurve longevityCurve = meleeWeapon.longevity;

            return(longevityCurve.curve.Evaluate(level));
        }
        public float GetShotPowerValue(float drawTime)
        {
            Bow            bow = (Bow)this.m_item;
            AttributeCurve drawProfileCurve = bow.drawProfile;

            return(drawProfileCurve.curve.Evaluate(drawTime));
        }
        public float GetDrawStrengthValue(float level)
        {
            Bow            bow = (Bow)this.m_item;
            AttributeCurve drawStrengthCurve = bow.drawStrength;

            return(drawStrengthCurve.curve.Evaluate(level));
        }
        public float GetEffectsEfficacyValue(float level)
        {
            Quiver         quiver = (Quiver)this.m_item;
            AttributeCurve effectsEfficacyCurve = quiver.effectsEfficacy;

            return(effectsEfficacyCurve.curve.Evaluate(level));
        }
        public float GetRoundsValue(float level)
        {
            Quiver         quiver      = (Quiver)this.m_item;
            AttributeCurve roundsCurve = quiver.rounds;

            return(roundsCurve.curve.Evaluate(level));
        }
        public float GetCarriedGearEfficacyValue(float level)
        {
            Wear           wear = (Wear)this.m_item;
            AttributeCurve carriedGearEfficacyCurve = wear.carriedGearEfficacy;

            return(carriedGearEfficacyCurve.curve.Evaluate(level));
        }
        public float GetSwiftnessValue(float level)
        {
            Wear           wear           = (Wear)this.m_item;
            AttributeCurve swiftnessCurve = wear.swiftness;

            return(swiftnessCurve.curve.Evaluate(level));
        }
Exemple #15
0
        public float GetKnockPowerValue(float level)
        {
            MeleeWeapon    meleeWeapon     = (MeleeWeapon)this.m_item;
            AttributeCurve knockPowerCurve = meleeWeapon.knockPower;

            return(knockPowerCurve.curve.Evaluate(level));
        }
        public float GetEfficacyValue(float level)
        {
            Pack           pack          = (Pack)this.m_item;
            AttributeCurve efficacyCurve = pack.efficacy;

            return(efficacyCurve.curve.Evaluate(level));
        }
        public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
        {
            // if(prop.objectReferenceValue == null) return;
            SerializedObject   attCurveSO     = new SerializedObject((AttributeCurve)prop.objectReferenceValue);
            SerializedProperty curveProp      = attCurveSO.FindProperty("curve");
            SerializedProperty nameProp       = attCurveSO.FindProperty("curveName");
            SerializedProperty outMinProp     = attCurveSO.FindProperty("outputMin");
            SerializedProperty outMaxProp     = attCurveSO.FindProperty("outputMax");
            SerializedProperty inMinProp      = attCurveSO.FindProperty("inputMin");
            SerializedProperty inMaxProp      = attCurveSO.FindProperty("inputMax");
            SerializedProperty previewOutProp = attCurveSO.FindProperty("previewOutput");
            SerializedProperty previewInProp  = attCurveSO.FindProperty("previewInput");
            SerializedProperty showProp       = attCurveSO.FindProperty("showInInspector");
            SerializedProperty inputNameProp  = attCurveSO.FindProperty("inputName");
            SerializedProperty outputNameProp = attCurveSO.FindProperty("outputName");


            Rect titleRect = new Rect(pos);

            titleRect.height = defHeight;
            titleRect.y      = pos.y + bigSpace;

            Rect contentRect = new Rect(pos);

            contentRect.height = pos.height - bigSpace - defHeight - space;
            contentRect.y      = pos.y + bigSpace + defHeight + space;

            Rect curveRow = new Rect(contentRect);

            curveRow.height = curveBoxDimension + space + defHeight;

            float floatBoxWidth = defHeight * 2;

            Rect curveRect = new Rect(curveRow);

            curveRect.height = curveBoxDimension;
            curveRect.width  = curveRow.width - space - defHeight;
            curveRect.x      = curveRow.x + floatBoxWidth + space;

            Rect outMaxRect = new Rect(curveRow);

            outMaxRect.height = defHeight;
            outMaxRect.width  = floatBoxWidth;

            Rect outMinRect = new Rect(outMaxRect);

            outMinRect.y = curveRow.y + curveRow.height - defHeight - space - defHeight;

            Rect inMinRect = new Rect(outMinRect);

            inMinRect.x = curveRect.x;
            inMinRect.y = curveRect.y + curveRect.height + space;

            Rect inMaxRect = new Rect(inMinRect);

            inMaxRect.x = curveRow.x + curveRow.width - floatBoxWidth;

            // Rect nameRow = new Rect(contentRect);
            // nameRow.height = defHeight;
            // nameRow.y = contentRect.y + curveRow.height/* + space + defHeight*/ + space;

            Rect sliderRow = new Rect(contentRect);

            sliderRow.height = defHeight;
            sliderRow.y      = contentRect.y + curveRow.height + space /* + defHeight + space*/ /*+ nameRow.height + space*/;

            float labelRatio = .3f;

            Rect sliderLabelRect = new Rect(sliderRow);

            sliderLabelRect.width = (sliderRow.width - space) * labelRatio;

            Rect sliderFieldRect = new Rect(sliderRow);

            sliderFieldRect.width = sliderRow.width - sliderLabelRect.width - space;
            sliderFieldRect.x     = sliderRow.x + sliderLabelRect.width + space;

            Rect previewRow = new Rect(contentRect);

            previewRow.height = defHeight;
            previewRow.y      = contentRect.y + curveRow.height + space + defHeight + space /*+ nameRow.height + space*//* + sliderRow.height + space*/;

            Rect previewLabelRect = new Rect(previewRow);

            previewLabelRect.width = (previewRow.width - space) * labelRatio;
            Rect previewFieldRect = new Rect(previewRow);

            previewFieldRect.width = previewRow.width - previewLabelRect.width - space;
            previewFieldRect.x     = previewRow.x + previewLabelRect.width + space;



            SerializedObject curveSO = curveProp.serializedObject;

            attCurveSO.Update();
            curveSO.Update();

            int indent = EditorGUI.indentLevel;

            EditorGUI.indentLevel = 0;

            showProp.boolValue = EditorGUI.Foldout(titleRect, showProp.boolValue, nameProp.stringValue);
            if (showProp.boolValue)
            {
                EditorGUI.DrawRect(contentRect, greyCol);

                curveProp.animationCurveValue = EditorGUI.CurveField(curveRect, curveProp.animationCurveValue);

                outMaxProp.floatValue = EditorGUI.FloatField(outMaxRect, outMaxProp.floatValue);
                outMinProp.floatValue = EditorGUI.FloatField(outMinRect, outMinProp.floatValue);
                inMaxProp.floatValue  = EditorGUI.FloatField(inMaxRect, inMaxProp.floatValue);
                inMinProp.floatValue  = EditorGUI.FloatField(inMinRect, inMinProp.floatValue);


                AttributeCurve attCurveScr = (AttributeCurve)attCurveSO.targetObject;

                attCurveScr.UpdateCurve();

                curveSO.ApplyModifiedProperties();



                EditorGUI.LabelField(sliderLabelRect, inputNameProp.stringValue.ToString());
                previewInProp.floatValue = EditorGUI.Slider(sliderFieldRect, previewInProp.floatValue, inMinProp.floatValue, inMaxProp.floatValue);

                previewOutProp.floatValue = curveProp.animationCurveValue.Evaluate(previewInProp.floatValue);

                EditorGUI.LabelField(previewLabelRect, outputNameProp.stringValue);
                EditorGUI.LabelField(previewFieldRect, previewOutProp.floatValue.ToString());
            }

            EditorGUI.indentLevel = indent;
            attCurveSO.ApplyModifiedProperties();
        }