4 ms·
But, I still need inheritance. DuckComponent would need to inherit from Component in order for my GameObject to add that to the list of components attached. Am
by snake_case 12y ago
But, I still need inheritance. DuckComponent would need to inherit from Component in order for my GameObject to add that to the list of components attached.
Am I wrong?
- yuriks 12y agoThis sounds like the exact case where you'd use a trait.
- snake_case 12y agoYes, I think you're right!
- tomlu 12y agoYou'd use interfaces (or a similar behaviour-indirection mechanism like function pointers). In Rust I suppose you'd use a trait.