feature-attributes #7
@ -1,10 +1,14 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
zephyr marked this conversation as resolved
Outdated
|
||||
public class Attribute : ScriptableObject
|
||||
[Serializable]
|
||||
public struct Attribute
|
||||
{
|
||||
public long Base { get; set; }
|
||||
public long Base;
|
||||
|
||||
public Attribute(long stat) { Base = stat; }
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the stat value with accumulated buff and debuff modifiers.
|
||||
|
@ -17,8 +17,7 @@ public class AttributeTest
|
||||
[TestCase(1000000, 0, -20000, 0, ExpectedResult = 0)]
|
||||
public long Value(long startStat, long baseBonus, long permyriadBonus, long flatBonus)
|
||||
{
|
||||
var attr = ScriptableObject.CreateInstance<Attribute>();
|
||||
attr.Base = startStat;
|
||||
var attr = new Attribute(startStat);
|
||||
var effect = EffectSO.New(baseBonus, permyriadBonus, flatBonus);
|
||||
return attr.Calc(effect);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user
Missing SO suffix
I think this should go back to a struct rather than an SO. But it also seems like that makes it so the editor can't see them. Might need to implement a custom editor?