blob: 4cd4e3f1ee63b31fafeb0535c42b4327e874b206 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
using Sandbox;
using System;
namespace MurderGame;
public class PlayerAnimator : EntityComponent<Player>, ISingletonComponent
{
public void Simulate()
{
var helper = new CitizenAnimationHelper( Entity );
helper.WithVelocity( Entity.Velocity );
helper.WithLookAt( Entity.EyePosition + Entity.EyeRotation.Forward * 100 );
helper.HoldType = CitizenAnimationHelper.HoldTypes.None;
helper.IsGrounded = Entity.GroundEntity.IsValid();
if ( Entity.Controller.HasEvent( "jump" ) )
{
helper.TriggerJump();
}
}
}
|