private void Awake()
        {
            Instance = this;

            _lobby       = gameObject.AddComponent <QSBNetworkLobby>();
            _assetBundle = QSB.NetworkAssetBundle;

            playerPrefab = _assetBundle.LoadAsset <GameObject>("assets/networkplayer.prefab");
            playerPrefab.AddComponent <PlayerTransformSync>();
            playerPrefab.AddComponent <AnimationSync>();
            playerPrefab.AddComponent <WakeUpSync>();
            DebugLog.LogState("PlayerPrefab", playerPrefab);

            _shipPrefab = _assetBundle.LoadAsset <GameObject>("assets/networkship.prefab");
            _shipPrefab.AddComponent <ShipTransformSync>();
            spawnPrefabs.Add(_shipPrefab);
            DebugLog.LogState("ShipPrefab", _shipPrefab);

            _cameraPrefab = _assetBundle.LoadAsset <GameObject>("assets/networkcameraroot.prefab");
            _cameraPrefab.AddComponent <PlayerCameraSync>();
            spawnPrefabs.Add(_cameraPrefab);
            DebugLog.LogState("CameraPrefab", _cameraPrefab);

            _probePrefab = _assetBundle.LoadAsset <GameObject>("assets/networkprobe.prefab");
            _probePrefab.AddComponent <PlayerProbeSync>();
            spawnPrefabs.Add(_probePrefab);
            DebugLog.LogState("ProbePrefab", _probePrefab);

            ConfigureNetworkManager();
        }
Example #2
0
        public new void Awake()
        {
            base.Awake();
            Instance = this;

            _lobby       = gameObject.AddComponent <QSBNetworkLobby>();
            _assetBundle = QSBCore.NetworkAssetBundle;

            playerPrefab = _assetBundle.LoadAsset <GameObject>("assets/networkplayer.prefab");
            SetupNetworkId(playerPrefab);
            SetupNetworkTransform(playerPrefab);
            playerPrefab.AddComponent <PlayerTransformSync>();
            playerPrefab.AddComponent <AnimationSync>();
            playerPrefab.AddComponent <WakeUpSync>();
            playerPrefab.AddComponent <InstrumentsManager>();

            _shipPrefab = _assetBundle.LoadAsset <GameObject>("assets/networkship.prefab");
            SetupNetworkId(_shipPrefab);
            SetupNetworkTransform(_shipPrefab);
            _shipPrefab.AddComponent <ShipTransformSync>();
            spawnPrefabs.Add(_shipPrefab);

            _cameraPrefab = _assetBundle.LoadAsset <GameObject>("assets/networkcameraroot.prefab");
            SetupNetworkId(_cameraPrefab);
            SetupNetworkTransform(_cameraPrefab);
            _cameraPrefab.AddComponent <PlayerCameraSync>();
            spawnPrefabs.Add(_cameraPrefab);

            _probePrefab = _assetBundle.LoadAsset <GameObject>("assets/networkprobe.prefab");
            SetupNetworkId(_probePrefab);
            SetupNetworkTransform(_probePrefab);
            _probePrefab.AddComponent <PlayerProbeSync>();
            spawnPrefabs.Add(_probePrefab);

            OrbPrefab = _assetBundle.LoadAsset <GameObject>("assets/networkorb.prefab");
            SetupNetworkId(OrbPrefab);
            SetupNetworkTransform(OrbPrefab);
            OrbPrefab.AddComponent <NomaiOrbTransformSync>();
            spawnPrefabs.Add(OrbPrefab);

            _stickPrefab = _assetBundle.LoadAsset <GameObject>("assets/networkstickpivot.prefab");
            SetupNetworkId(_stickPrefab);
            SetupNetworkTransform(_stickPrefab);
            _stickPrefab.AddComponent <RoastingStickTransformSync>();
            spawnPrefabs.Add(_stickPrefab);

            ConfigureNetworkManager();
            QSBSceneManager.OnUniverseSceneLoaded += OnSceneLoaded;
        }