public static StatAttribute Create(float baseValue, string attributeType) { var baseValueF = FloatConstant.Create(baseValue); var type = AttributeType.Create(attributeType); return(Create(baseValueF, attributeType: type)); }
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; }
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; }