protected override void OnCarInstantiated(CarInstantiateSignal carInstantiateSignal) { if (PhotonNetwork.LocalPlayer.ActorNumber == carInstantiateSignal.OwnerActor) { SetViewId(_playerChaserFactory.Create().Transform, carInstantiateSignal); } }
protected override void OnCarInstantiated(CarInstantiateSignal carInstantiateSignal) { if (PhotonNetwork.LocalPlayer.ActorNumber == carInstantiateSignal.OwnerActor) { return; } Transform carTransform; if (carInstantiateSignal.CarType == PlayerType.Runner) { carTransform = _runnerFactory.Create().Transform; } else { carTransform = carInstantiateSignal.Ai ? _aiChaserFactory.Create().Transform : _playerChaserFactory.Create().Transform; } SetViewId(carTransform, carInstantiateSignal); }
public override void Initialize() { _factory.Create(); base.Initialize(); }