asd
This commit is contained in:
@@ -1,10 +1,20 @@
|
||||
using Sandbox;
|
||||
|
||||
|
||||
public enum GravityType
|
||||
{
|
||||
Down,
|
||||
Circle
|
||||
}
|
||||
public sealed class Teleporter : Component, Component.ITriggerListener
|
||||
{
|
||||
[Property] public GameObject ToPosGameObject { get; set; }
|
||||
[Property] public GameObject Building { get; set; }
|
||||
// [Property] public bool ResetGravity { get; set; } = false;
|
||||
// [Property] public bool NormalGravity { get; set; } = true;
|
||||
|
||||
|
||||
|
||||
[Property] public GravityType gravityType { get; set; } = GravityType.Down;
|
||||
|
||||
public void OnTriggerEnter( Collider other )
|
||||
{
|
||||
@@ -17,7 +27,16 @@ public sealed class Teleporter : Component, Component.ITriggerListener
|
||||
Log.Info($"{otherEntity.Name} вошел в зону телепорта");
|
||||
|
||||
otherEntity.WorldPosition = ToPosGameObject.WorldPosition;
|
||||
controller.OverrideGravity = Vector3.Down;
|
||||
|
||||
if ( gravityType == GravityType.Circle )
|
||||
{
|
||||
controller.OverrideGravity = Vector3.Zero;
|
||||
}
|
||||
|
||||
if ( gravityType == GravityType.Down )
|
||||
{
|
||||
controller.OverrideGravity = Vector3.Down;
|
||||
}
|
||||
|
||||
controller.EyeAngles = new Angles( 0, ToPosGameObject.WorldRotation.Yaw(), 0 ).ToRotation();
|
||||
controller.Renderer.LocalRotation = new Angles( 0, ToPosGameObject.WorldRotation.Yaw(), 0 ).ToRotation();
|
||||
|
||||
@@ -6,10 +6,9 @@ public sealed partial class Dedugan
|
||||
{
|
||||
if ( Network.IsOwner )
|
||||
{
|
||||
// IsDancing = Input.Down( "Dance" );
|
||||
IsDancing = Input.Down( "Dance" );
|
||||
}
|
||||
|
||||
Log.Info(IsDancing);
|
||||
Renderer.Set( "test_dance", IsDancing );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@ public sealed class RagdollController : Component
|
||||
[Group("Setup"), Order(-100), Property] public ModelPhysics bodyPhysics { get; set; }
|
||||
[Group("Setup"), Order(-100), Property] public SkinnedModelRenderer bodyRenderer { get; set; }
|
||||
[Group("Config"), Order(0), Property] public bool isLocked { get; set; }
|
||||
|
||||
// [Property] public Collider Collider;
|
||||
|
||||
[Sync]
|
||||
public new bool Enabled
|
||||
@@ -14,6 +16,7 @@ public sealed class RagdollController : Component
|
||||
bodyPhysics.Enabled = value;
|
||||
bodyPhysics.MotionEnabled = value;
|
||||
bodyRenderer.UseAnimGraph = !value;
|
||||
// Collider.Enabled = !value;
|
||||
|
||||
if ( !value )
|
||||
{
|
||||
@@ -23,6 +26,13 @@ public sealed class RagdollController : Component
|
||||
}
|
||||
}
|
||||
|
||||
// protected override void OnStart()
|
||||
// {
|
||||
// Collider = GetComponent<Collider>();
|
||||
//
|
||||
// Log.Info(Collider.Enabled);
|
||||
// }
|
||||
|
||||
protected override void OnUpdate()
|
||||
{
|
||||
if ( Network.IsOwner )
|
||||
|
||||
Reference in New Issue
Block a user