In the legacy world of GameObject, we have various of methods to send values between 2 classes or 2 gameObjects.
For example:
Demo for send value between 2 gameobject and class:
XXType xxType = FindFirstObjectOfType<XXXX>(); //find by type
XXType xxType; //(Directly connect from inspector)
XXType xxType = FindFirstObjectWithTag("Player"); //find by tag
XXType xxType = GameObject.Find("myGO").GetComponent<XXType>(); //find with obj name and then GetComponent by type
float newHeath = 5;
xxType.playerHeath = newHeath;
While for Sending value between GameObject world and the Entity, it looks like there’s no official method? I found some tutorials from different places and it looks like they are all using some work around to ahieve the target.
Could we simply list one or a few offial methods like the example above to showcase how to send value between GO and Entity?
Updates:
Method #1 - GameObject Singleton
Simply call it inside a System script of ECS