This is a code that has all the unnecessary details cut away.
How to sync a class member of a list of GameObjects across to the same unit on the server.
Code (CSharp):
- public class GameUnit : NetworkBehaviour {
- //This list keeps track of all enemies within the line of sight boundary. Enemies that leave the line of sight
- //will be removed from the Line of Sight script.
- public List<GameObject> enemies = new List<GameObject>();
- //....
- public void Check_For_Enemies_Within_Line_Of_Sight(){
- //Grabs a list of all enemies within the boundary of a line of sight sphere...