Browse Source

方向

master
jiannan.guo@yingxiong.com 1 month ago
parent
commit
2e224e6caf
  1. 5
      client/client/Assets/Scripts/CoreGame/AFramSync/Logic/System/Ball/ShootBall/RecvBallSystem.cs
  2. 11
      client/client/Assets/Scripts/CoreGame/AFramSync/Logic/System/Ball/ShootBall/ThrowBallSystem.cs
  3. 2
      client/client/Assets/Scripts/CoreGame/AFramSync/Render/View/DirCtrlInput.cs
  4. 3
      client/client/Assets/Scripts/CoreGame/AFramSync/Shared/CoreGameConfig.cs

5
client/client/Assets/Scripts/CoreGame/AFramSync/Logic/System/Ball/ShootBall/RecvBallSystem.cs

@ -1,4 +1,5 @@
using Entitas;
using CoreGame.Shared;
using Entitas;
using Sog;
using UnityEngine;
@ -33,7 +34,7 @@ namespace CoreGame.Logic
continue;
}
var ballTrans = ball.logicTransform;
if ((heroTrans.position - ballTrans.position).SqrMagnitude < Fixed64._4
if ((heroTrans.position - ballTrans.position).SqrMagnitude < CoreGameConfig.RecvBallDistSqrt
&& FixedMath.Dot(ballTrans.forward, heroTrans.position - ballTrans.position) > Fixed64._0)
{
ball.isDestroyEnt = true;

11
client/client/Assets/Scripts/CoreGame/AFramSync/Logic/System/Ball/ShootBall/ThrowBallSystem.cs

@ -34,17 +34,6 @@ namespace CoreGame.Logic
var ballInfo = bagComp.willShootBalls.Dequeue();
var logicTransform = entity.logicTransform;
// Fixed64Vector2 dir = Fixed64Vector2.up;
// if (logicTransform.position.y < -1)
// {
// dir = Fixed64Vector2.zero - logicTransform.position;
// dir.Normalize();
// }
// else
// {
// dir = FixedRandom.instance.NextDirection2D();
// }
//
LEntityCreatorSvc.CreateBallEntity(entity, logicTransform.position, bagComp.shootDir, ballInfo);
}
}

2
client/client/Assets/Scripts/CoreGame/AFramSync/Render/View/DirCtrlInput.cs

@ -22,7 +22,7 @@ namespace CoreGame.Render
var localPlayer = instance.LocalPlayerEntHandle;
if (localPlayer)
{
var f = 10 + (1 - value) * 160;
var f = 10 + (value) * 160;
var moveDirectionCommand = RenderCommandSvc.CreateFrameCommand<ChangeShootDirCmd>();
moveDirectionCommand.Degree = (short)f;

3
client/client/Assets/Scripts/CoreGame/AFramSync/Shared/CoreGameConfig.cs

@ -66,7 +66,8 @@ namespace CoreGame.Shared
public static float AttachOutTime = 5f;
public static Fixed64Vector2 ExtendSize = new Fixed64Vector2(Fixed64._0_50 + 5, 10);
public static Fixed64Vector2 ExtendSize = new(Fixed64._0_50 + 5, 10);
public static Fixed64 TurnTime = Fixed64._3;
public static Fixed64 RecvBallDistSqrt = Fixed64._1_50;
}
}
Loading…
Cancel
Save