コード例 #1
0
        public static StatAttribute Create(float baseValue, string attributeType)
        {
            var baseValueF = FloatConstant.Create(baseValue);
            var type       = AttributeType.Create(attributeType);

            return(Create(baseValueF, attributeType: type));
        }
コード例 #2
0
 private void Start()
 {
     if (weightAttributeType == null)
     {
         weightAttributeType = AttributeType.Create("Weight");
     }
     weightModifier               = ScriptableObject.CreateInstance <StatModifier>();
     weightModifier.value         = FloatConstant.Create(weigth);
     weightModifier.modifierType  = StatModifierType.AdditiveAbsolute;
     weightModifier.attributeType = weightAttributeType;
 }
コード例 #3
0
        protected override void Start()
        {
            base.Start();
            team = StatAttribute.Create(1f, "Team");

            maxHealth = StatAttribute.Create(10f, "MaxHealth");
            health    = FloatVariable.Create(FloatConstant.Create(maxHealth.Value), FloatConstant.Create(0), maxHealth,
                                             AttributeType.Create("Health"));

            armor = StatAttribute.Create(10f, "Armor");

            speed           = StatAttribute.Create(3f, "Speed");
            sneakMultiplier = 0.7f;
            runMultiplier   = 2f;

            jumpPower = 450f;

            weight    = StatAttribute.Create(0, "Weight");
            maxWeight = StatAttribute.Create(0, "MaxWeight");

            slotCapacity = -1;
        }