// Token: 0x06002091 RID: 8337 RVA: 0x0008D098 File Offset: 0x0008B298
 private void Update()
 {
     this.hasEffectiveAuthority = Util.HasEffectiveAuthority(this.networkIdentity);
     if (this.hasEffectiveAuthority)
     {
         this.networkDesiredViewAngles = this.viewAngles;
         return;
     }
     this.viewAngles = PitchYawPair.SmoothDamp(this.viewAngles, this.networkDesiredViewAngles, ref this.velocity, this.GetNetworkSendInterval() * this.bufferMultiplier, this.maxSmoothVelocity);
 }
        // Token: 0x06002097 RID: 8343 RVA: 0x0008D1BC File Offset: 0x0008B3BC
        public override void OnDeserialize(NetworkReader reader, bool initialState)
        {
            PitchYawPair pitchYawPair = reader.ReadPitchYawPair();

            if (this.hasEffectiveAuthority)
            {
                return;
            }
            this.networkDesiredViewAngles = pitchYawPair;
            if (initialState)
            {
                this.viewAngles = pitchYawPair;
                this.velocity   = PitchYawPair.zero;
            }
        }
Exemplo n.º 3
0
            public void Update()
            {
                if (accept)
                {
                    if (!DisableToStartNewTween)
                    {
                        oldPitchYaw = new PitchYawPair(cameraRig.pitch, cameraRig.yaw);
                        SetPitchYawPair(testing);
                        DisableToStartNewTween = true;
                    }

                    if (slerpValue < 1f)
                    {
                        slerpValue += incrementValue;
                        //var currentPitchYaw = new PitchYawPair(cameraRig.pitch, cameraRig.yaw);
                        var resultingPitchYaw = PitchYawPair.Lerp(oldPitchYaw, targetPitchYaw, slerpValue);
                        cameraRig.SetPitchYaw(resultingPitchYaw);
                    }
                }
            }
Exemplo n.º 4
0
 public void SetPitchYawPair(PitchYawPair pitchYawPair)
 {
     slerpValue             = 0f;
     DisableToStartNewTween = false;
     targetPitchYaw         = pitchYawPair;
 }