Quantcast
Channel: Multiplayer
Viewing all articles
Browse latest Browse all 16796

How to sync a class member of a list of GameObjects across to the same unit on the server.

$
0
0
This is a code that has all the unnecessary details cut away.

Code (CSharp):
  1. public class GameUnit : NetworkBehaviour {
  2.   //This list keeps track of all enemies within the line of sight boundary. Enemies that leave the line of sight
  3.   //will be removed from the Line of Sight script.
  4.   public List<GameObject> enemies = new List<GameObject>();
  5.  
  6.   //....
  7.  
  8.   public void Check_For_Enemies_Within_Line_Of_Sight(){
  9.     //Grabs a list of all enemies within the boundary of a line of sight sphere...
How to sync a class member of a list of GameObjects across to the same unit on the server.

Viewing all articles
Browse latest Browse all 16796

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>