1.创建NetworkManager(空物体),在上面添加NetworkManager组件,添加NetWorkManagerHUD组件
2.创建预制体PlayerPrefab,在上面添加NetworkIdentity,勾选Local Player Authority,在NetWorkManager组件下的SpawnInfo里,将预制件拖入PlayerPrefab上
3。控制移动:添加PlayerController脚本,
4.在Player预制体上添加NetworkTransform,实时同步
5.在子弹上面加NetworkIdentity,同时添加NetworkTransform,将子弹添加到SpawnInfo中
6.制作敌人,添加预制件Enemy
7.添加EnemySpawner
8.添加两个NetworkStartPosition,在NetworkManager里选择RoundRobin
using System.Collections;
using System.Collections.Generic;
using U