void Start() { if (NetworkManager.Instance.IsServer) { searchForEnemies = false; for (int i = 0; i <= enemyAmount - 1; i++) { Vector3 randomPosition = new Vector3(Random.Range(-10.0f, 10.0f), 0, Random.Range(-10.0f, 10.0f)); GenericEnemyNetcode en = NetworkManager.Instance.InstantiateGenericEnemy(i, randomPosition) as GenericEnemyNetcode; en.enemyNumber = i; GameObject puppet = Instantiate(genericEnemyPuppetPrefab); puppet.GetComponent <GenericEnemyPuppet>().enemy = en.gameObject; } } }
void Start() { enemyNetcode = enemy.GetComponent <GenericEnemyNetcode>(); boxCollider = GetComponent <BoxCollider>(); meshRenderer = GetComponent <MeshRenderer>(); }