コード例 #1
0
 protected void uLink_OnNetworkInstantiate(uLink.NetworkMessageInfo info)
 {
     this.instantiatedPlayerClient = base.playerClient;
     if (this.instantiatedPlayerClient)
     {
         base.name = string.Format("{0}{1}", this.instantiatedPlayerClient.name, info.networkView.localPrefab);
     }
     try
     {
         this.deathTransfer = base.AddAddon <DeathTransfer>();
     }
     catch (Exception exception)
     {
         Debug.LogException(exception, this);
     }
     if (!base.networkView.isMine)
     {
         if (base.CreateInterpolator())
         {
             base.interpolator.running = true;
         }
         UnityEngine.Object.Destroy(base.GetComponent <LocalDamageDisplay>());
     }
     else
     {
         CameraMount.ClearTemporaryCameraMount();
         UnityEngine.Object.Destroy(base.GetComponent <ApplyCrouch>());
         base.CreateCCMotor();
         base.CreateOverlay();
     }
 }
コード例 #2
0
ファイル: CameraMount.cs プロジェクト: sknchan/LegacyRust
 private static CameraMount CreateTemporaryCameraMount(CameraMount copyFrom, Transform parent, bool hasParent)
 {
     if (CameraMount.creatingTemporaryCameraMount)
     {
         throw new InvalidOperationException("Invalid/unexpected call stack recursion");
     }
     CameraMount.ClearTemporaryCameraMount();
     try
     {
         CameraMount.creatingTemporaryCameraMount  = true;
         CameraMount.temporaryCameraMountSource    = copyFrom;
         CameraMount.temporaryCameraMountHasParent = hasParent;
         CameraMount.temporaryCameraMountParent    = parent;
         GameObject gameObject = new GameObject("__-temp mount-__", new Type[] { typeof(CameraMount) })
         {
             hideFlags = HideFlags.DontSave
         };
         CameraMount.temporaryCameraMountGameObject = gameObject;
     }
     finally
     {
         CameraMount.creatingTemporaryCameraMount  = false;
         CameraMount.temporaryCameraMountSource    = null;
         CameraMount.temporaryCameraMountHasParent = false;
         CameraMount.temporaryCameraMountParent    = null;
         CameraMount.createdTemporaryCameraMount   = CameraMount.temporaryCameraMount;
     }
     return(CameraMount.temporaryCameraMount);
 }