Hello, I'm working on a feature for CharacterItem that may rely on the StateSystem. I have to say that the StateSystem is very convenient to use, but I have encountered some issues when using it on CharacterItem.
Some StateObjects on CharacterItem use Character as a BoundGameObject, which is not a problem when there are only a few types of items because you can set a unique state name for each state of each item.
However, once the number of items increases, using Character as a BoundGameObject will cause two problems:
In conclusion, using Character as a BoundGameObject for some StateObjects on CharacterItem is not a reliable approach, which will reduce the usability and scalability of the item system.
Perhaps these StateObjects should be directly bound to the GameObject of CharacterItem. If you need to let Character receive the state of CharacterItem, you can write a separate script that forwards the state of CharacterItem's GameObject to Character.
Do you think there is something wrong with my thinking? If you think my idea is good, please improve it. Thank you!
Some StateObjects on CharacterItem use Character as a BoundGameObject, which is not a problem when there are only a few types of items because you can set a unique state name for each state of each item.
However, once the number of items increases, using Character as a BoundGameObject will cause two problems:
- It is difficult to manage to set a unique state name for each state of each item in a large number of items, so it is better for all items to share state names. In the current situation, this will cause interference between different items' states.
- Multiple instances of an item that can be equipped in both the left and right hands are equipped simultaneously in the left and right hands. In the current situation, this will cause interference between these two instances' states.
In conclusion, using Character as a BoundGameObject for some StateObjects on CharacterItem is not a reliable approach, which will reduce the usability and scalability of the item system.
Perhaps these StateObjects should be directly bound to the GameObject of CharacterItem. If you need to let Character receive the state of CharacterItem, you can write a separate script that forwards the state of CharacterItem's GameObject to Character.
Do you think there is something wrong with my thinking? If you think my idea is good, please improve it. Thank you!