|
@@ -29,6 +29,8 @@ namespace Comp
|
|
|
|
|
|
private readonly WaitForSeconds _waitEverySecond = new WaitForSeconds(1f);
|
|
private readonly WaitForSeconds _waitEverySecond = new WaitForSeconds(1f);
|
|
|
|
|
|
|
|
+ private Rigidbody _rigidbody;
|
|
|
|
+
|
|
// 水平与垂直方向运动相关
|
|
// 水平与垂直方向运动相关
|
|
|
|
|
|
public int playerId;
|
|
public int playerId;
|
|
@@ -43,6 +45,8 @@ namespace Comp
|
|
|
|
|
|
private bool _createMiss = false;
|
|
private bool _createMiss = false;
|
|
|
|
|
|
|
|
+ public bool willBeLift = false;
|
|
|
|
+
|
|
public ICockController CockController
|
|
public ICockController CockController
|
|
{
|
|
{
|
|
get
|
|
get
|
|
@@ -70,6 +74,7 @@ namespace Comp
|
|
private void Awake()
|
|
private void Awake()
|
|
{
|
|
{
|
|
_cockMoveComp = GetComponent<CockMoveComp>();
|
|
_cockMoveComp = GetComponent<CockMoveComp>();
|
|
|
|
+ _rigidbody = GetComponent<Rigidbody>();
|
|
}
|
|
}
|
|
|
|
|
|
private void Start()
|
|
private void Start()
|
|
@@ -95,33 +100,6 @@ namespace Comp
|
|
CreateMissText();
|
|
CreateMissText();
|
|
}
|
|
}
|
|
|
|
|
|
- private void FixedUpdate()
|
|
|
|
- {
|
|
|
|
- // transform.Translate(_thrust * Time.deltaTime);
|
|
|
|
-
|
|
|
|
- // 移动游戏对象
|
|
|
|
- // if (GameCore.Instance.inBattleState)
|
|
|
|
- // transform.position += _curData.GetJumpVector();
|
|
|
|
- // if (GameCore.Instance.inBattleState)
|
|
|
|
- // {
|
|
|
|
- // if (rightForward)
|
|
|
|
- // {
|
|
|
|
- // transform.position += _curData.GetMoveVector();
|
|
|
|
- // }
|
|
|
|
- // else
|
|
|
|
- // {
|
|
|
|
- // transform.position -= _curData.GetMoveVector();
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
-
|
|
|
|
- // if (transform.position.y < _miniY)
|
|
|
|
- // {
|
|
|
|
- // var position = transform.position;
|
|
|
|
- // position = new Vector3(position.x, _miniY, position.z);
|
|
|
|
- // transform.position = position;
|
|
|
|
- // }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
private void OnRun()
|
|
private void OnRun()
|
|
{
|
|
{
|
|
_cockMoveComp.MoveAndNeverStop();
|
|
_cockMoveComp.MoveAndNeverStop();
|
|
@@ -147,10 +125,18 @@ namespace Comp
|
|
|
|
|
|
public void OnAttackEnd()
|
|
public void OnAttackEnd()
|
|
{
|
|
{
|
|
|
|
+ if (willBeLift)
|
|
|
|
+ {
|
|
|
|
+ _rigidbody.useGravity = false;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
public void OnJumpEnd()
|
|
public void OnJumpEnd()
|
|
{
|
|
{
|
|
|
|
+ if (willBeLift)
|
|
|
|
+ {
|
|
|
|
+ _rigidbody.useGravity = false;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
public void SetHighJump(bool high)
|
|
public void SetHighJump(bool high)
|