Aeon Vex
Aeon Vex
CC#
Created by Aeon Vex on 9/22/2022 in #help
Implementing an inventory system with right click actions
that's all implementation details anyway, it was mostly the bigger picture I was scratching my head on
20 replies
CC#
Created by Aeon Vex on 9/22/2022 in #help
Implementing an inventory system with right click actions
right yeah
20 replies
CC#
Created by Aeon Vex on 9/22/2022 in #help
Implementing an inventory system with right click actions
I think the component / composition based workflow is still one I need to get better at leveraging
20 replies
CC#
Created by Aeon Vex on 9/22/2022 in #help
Implementing an inventory system with right click actions
yeah that already sounds a lot cleaner than what I was playing around with in my head initially
20 replies
CC#
Created by Aeon Vex on 9/22/2022 in #help
Implementing an inventory system with right click actions
right, but I feel that a simple var menuActions = item.Components.SelectMany(c => c.GetComponentActions()); or something along those lines would be pretty clean for the menu side of things
20 replies
CC#
Created by Aeon Vex on 9/22/2022 in #help
Implementing an inventory system with right click actions
yeah, I realized that as I was writing it out
20 replies
CC#
Created by Aeon Vex on 9/22/2022 in #help
Implementing an inventory system with right click actions
An issue with this is that an item can't have multiple uses at once like equipable and droppable
well in the example I have, all items would at the very least be droppable + something else. but I see what you mean, if I had a Consumable and a Wearable class, I'd run into trouble if I ever wanted to add a candy necklace. could this not be resolved through interfaces? say all items are IDroppable (for example), and then I could implement interfaces as needed so something could be both IConsumable and IWearable. of course, yeah, I suppose that could get messy having to create a concrete implementation for each combination of behaviours. so you'd go with a component based approach (whether through the unity component system if working in unity, or some other solution) and to construct the right click menu cycle through components and resolve actions for them?
20 replies
CC#
Created by Slikkepott på COOP-Extra on 9/18/2022 in #help
easy movement
5 replies
CC#
Created by LDami on 9/17/2022 in #help
Is there any benefit to write a Property with a private variable ?
I'd say in unity properties are still preferred, you just can't really use auto properties if you want to serialize
34 replies