예제 #1
0
파일: Replay.cs 프로젝트: PMArkive/strafe
        private void TickPlayback()
        {
            if (_frames.Count == 0 ||
                _pause <= 3)
            {
                return;
            }

            if (_playbackIndex >= _frames.Count)
            {
                _playbackIndex = 0;
                _pause         = 0;
                return;
            }

            CurrentFrame = _frames[_playbackIndex];
            _playbackIndex++;
        }
예제 #2
0
파일: Replay.cs 프로젝트: PMArkive/strafe
        private void TickRecord()
        {
            var frame = new ReplayFrame()
            {
                Position = Entity.Position,
                Angles   = Entity.WorldAng,
                Velocity = Entity.Velocity
            };

            var cl = Client.All.FirstOrDefault(x => x.Pawn == Entity);

            if (cl is StrafePlayer player)
            {
                frame.Buttons    = GetButtons(cl);
                frame.JustJumped = (player.Controller as StrafeWalkController).JustJumped;
                frame.Grounded   = player.Controller.GroundEntity != null;
            }

            _frames.Add(frame);
        }