GameItemAttribute.cs
v4.0
// Owner will be the owner of the GameItemObject this is attached to. If it is not,
// then owner will be the GameItemAttributeList this is in. If it is not in a
// List, then it will be the value of _owner. The Owner is the IHaveStats objects
// which is affected by the stat effects on these objects.
public IHaveStats Owner => ParentList == null ? _owner : ParentList.Owner;
public ItemAttribute Parent() // Get the ItemAttribute scriptable object
public GameItemObject ParentItemObject // The GameItemObject this is attached to
public GameItemAttributeList ParentList // the List this is in
public string Uid() // Uid of the parent
public virtual string GameId(bool forceNew = false) // In game unique ID of this GameItemObject
public int NameOrder // Name order for this attribute
public string HumanName // Human nameConstructor
public GameItemAttribute(ItemAttribute parent, IHaveStats newOwner = null)
{
_parent = parent; // v3.6
SetUid(parent.Uid()); // v3.6 -- set the uid with this method now
objectName = parent.objectName;
objectType = parent.objectType;
dictionaries = parent.dictionaries.Clone(); // Clone the dictionaries object, so we don't overwrite our Scriptable Object data!
GameId();
SetOwner(newOwner); // Will set null if value is default. Owner is first taken from Parents before reverting to _owner
}Methods
Additional Methods
Properties
Last updated