protected override void OnCarInstantiated(CarInstantiateSignal carInstantiateSignal)
 {
     if (PhotonNetwork.LocalPlayer.ActorNumber == carInstantiateSignal.OwnerActor)
     {
         SetViewId(_playerChaserFactory.Create().Transform, carInstantiateSignal);
     }
 }
Example #2
0
        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);
        }
 protected void SetViewId(Transform carTransform, CarInstantiateSignal carInstantiateSignal)
 {
     carTransform.position = carInstantiateSignal.Position;
     carTransform.rotation = carInstantiateSignal.Rotation;
     carTransform.GetComponent <PhotonView>().ViewID = carInstantiateSignal.PhotonId;
 }
 protected virtual void OnCarInstantiated(CarInstantiateSignal carInstantiateSignal)
 {
 }