qwe
This commit is contained in:
parent
3255886197
commit
f6ac6dd67c
@ -58,7 +58,7 @@
|
|||||||
{
|
{
|
||||||
"__type": "AnimationHelper",
|
"__type": "AnimationHelper",
|
||||||
"__guid": "536068a6-fe5d-4f45-af74-9522ebf7e663",
|
"__guid": "536068a6-fe5d-4f45-af74-9522ebf7e663",
|
||||||
"BodyWeight": 0,
|
"BodyWeight": 1,
|
||||||
"EyesWeight": 0,
|
"EyesWeight": 0,
|
||||||
"HeadWeight": 1,
|
"HeadWeight": 1,
|
||||||
"LookAtEnabled": true,
|
"LookAtEnabled": true,
|
||||||
@ -68,6 +68,16 @@
|
|||||||
"go": "b99ceffc-a173-4a6e-a239-6d3c1612c09f",
|
"go": "b99ceffc-a173-4a6e-a239-6d3c1612c09f",
|
||||||
"component_type": "SkinnedModelRenderer"
|
"component_type": "SkinnedModelRenderer"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__type": "PlayerDresser",
|
||||||
|
"__guid": "9e0e0634-d503-4286-ace6-a8b6f1303e94",
|
||||||
|
"BodyRenderer": {
|
||||||
|
"_type": "component",
|
||||||
|
"component_id": "4fd8c36d-180b-41af-8439-6b975ca1c7b3",
|
||||||
|
"go": "b99ceffc-a173-4a6e-a239-6d3c1612c09f",
|
||||||
|
"component_type": "SkinnedModelRenderer"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"Children": [
|
"Children": [
|
||||||
|
@ -60,10 +60,6 @@ public sealed class AnimationHelper : Component, Component.ExecuteInEditor
|
|||||||
if ( !Target.IsValid() )
|
if ( !Target.IsValid() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
AimBodyWeight = 0f;
|
|
||||||
AimEyesWeight = 0f;
|
|
||||||
AimHeadWeight = 1f;
|
|
||||||
|
|
||||||
|
|
||||||
if ( LookAtEnabled )
|
if ( LookAtEnabled )
|
||||||
{
|
{
|
||||||
@ -126,9 +122,9 @@ public sealed class AnimationHelper : Component, Component.ExecuteInEditor
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public void WithLook( Vector3 lookDirection, float eyesWeight = 1.0f, float headWeight = 1.0f, float bodyWeight = 1.0f )
|
public void WithLook( Vector3 lookDirection, float eyesWeight = 1.0f, float headWeight = 1.0f, float bodyWeight = 1.0f )
|
||||||
{
|
{
|
||||||
// Target.SetLookDirection( "aim_eyes", lookDirection, eyesWeight );
|
Target.SetLookDirection( "aim_eyes", lookDirection, eyesWeight );
|
||||||
Target.SetLookDirection( "aim_head", lookDirection, headWeight );
|
Target.SetLookDirection( "aim_head", lookDirection, headWeight );
|
||||||
// Target.SetLookDirection( "aim_body", lookDirection, bodyWeight );
|
Target.SetLookDirection( "aim_body", lookDirection, bodyWeight );
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -56,7 +56,7 @@ public sealed class Kal : Component
|
|||||||
|
|
||||||
if ( Input.Pressed( "Jump" ) && Controller.IsOnGround )
|
if ( Input.Pressed( "Jump" ) && Controller.IsOnGround )
|
||||||
{
|
{
|
||||||
Controller.Punch( Vector3.Up * JumpStrength * 2f );
|
Controller.Punch( Vector3.Up * JumpStrength );
|
||||||
AnimationHelper.TriggerJump();
|
AnimationHelper.TriggerJump();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -79,7 +79,7 @@ public sealed class Kal : Component
|
|||||||
if ( Network.IsOwner )
|
if ( Network.IsOwner )
|
||||||
{
|
{
|
||||||
EyeAngles += Input.AnalogLook;
|
EyeAngles += Input.AnalogLook;
|
||||||
EyeAngles = EyeAngles.WithPitch(MathX.Clamp(EyeAngles.pitch, -10f, 40f));
|
EyeAngles = EyeAngles.WithPitch(MathX.Clamp(EyeAngles.pitch, -90f, 70f));
|
||||||
// Renderer.WorldRotation = Rotation.Slerp(Renderer.WorldRotation, Rotation.FromYaw(EyeAngles.yaw), Time.Delta * 5f);
|
// Renderer.WorldRotation = Rotation.Slerp(Renderer.WorldRotation, Rotation.FromYaw(EyeAngles.yaw), Time.Delta * 5f);
|
||||||
var cameraOffset = Vector3.Up * CamOffsetZ + Vector3.Backward * CamOffsetX;
|
var cameraOffset = Vector3.Up * CamOffsetZ + Vector3.Backward * CamOffsetX;
|
||||||
|
|
||||||
|
14
Code/PlayerDresser.cs
Normal file
14
Code/PlayerDresser.cs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
using Sandbox;
|
||||||
|
|
||||||
|
public class PlayerDresser : Component, Component.INetworkSpawn
|
||||||
|
{
|
||||||
|
[Property]
|
||||||
|
public SkinnedModelRenderer BodyRenderer { get; set; }
|
||||||
|
|
||||||
|
public void OnNetworkSpawn( Connection owner )
|
||||||
|
{
|
||||||
|
var clothing = new ClothingContainer();
|
||||||
|
clothing.Deserialize( owner.GetUserData( "avatar" ) );
|
||||||
|
clothing.Apply( BodyRenderer );
|
||||||
|
}
|
||||||
|
}
|
@ -24,6 +24,7 @@
|
|||||||
"CsProjName": "",
|
"CsProjName": "",
|
||||||
"StartupScene": "scenes/minimal.scene",
|
"StartupScene": "scenes/minimal.scene",
|
||||||
"MapStartupScene": "scenes/minimal.scene",
|
"MapStartupScene": "scenes/minimal.scene",
|
||||||
"LaunchMode": "Normal"
|
"LaunchMode": "Normal",
|
||||||
|
"DedicatedServerStartupScene": "scenes/minimal.scene"
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user