Submissions from 2022-06-06 to 2022-06-07 (1 total)

i'm knocking out a few of my early naive implementations and it feels awesome.

my structure is now

  • Generic Sword is a .asset file (created from the Weapon ScriptableObject)
  • Weapon is a class extending Item, but it specifies some weapon-specific attributes and carries logic for enabling and disabling its own hitbox
  • Item is a class extending ScriptableObject, and specifies some item-general attributes like a name and a rarity

all of this is edited in the Unity inspector now thanks to ScriptableObject, and although having Weapon handle behavior is still a little awkward, i think the full customization of the system will start to shine when i layer a Projectile class onto Hitbox and can make weapons do some truly interesting things.

i also realized that C# delegates were always a thing and i didn't have to go looking for UnityEvent to do that for me. but they have some minor differences that are useful to know! for my sake, the restrictions of C# delegates are actually safer so i'll probably switch to them whenever i think of it.