- Home /
Проблема не воспроизводится или устарела
Share data between statemachinebehaviours not with scriptableobject
Hello all, again! I am using StateMachineBehaviour to describe a behaviours of things in my game. Some of objects have data, which must be shared between scripts (for example, simple enemy have attackRange which must be shared between movementBehaviour and attackBehaviour). So, what is the most correct way to share this data? I'm using ScriptableOjbect for this now, but this is incorrect - as I can understand, ScriptableObject is for other purposes. Also, I can get a component from gameobject through the animator at every OnStateEnter, and take this data from there, but, as far as I know, frequently calls of GetComponent<> isn't good idea too. What else I can use, any suggestions?
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
List appears null? C# 2 Answers
use ScriptableObject as player data (rpg combat) 2 Answers
Data with reference to scene objects: Monobehaviour or ScriptableObject? 1 Answer