|
@@ -60,17 +60,16 @@ namespace Comp
|
|
|
private IEnumerator CockRayCast() // 判断碰撞点,现在不用射线了
|
|
|
{
|
|
|
yield return new WaitForSeconds(1f);
|
|
|
+ Debug.Log("lift cock");
|
|
|
var actionComp = GameCore.Instance.GetCockActionCompByPlayerId(playerId);
|
|
|
var cockObj = actionComp.gameObject;
|
|
|
_cock = cockObj;
|
|
|
if (playerId == GameCore.Instance.localPlayer.playerId)
|
|
|
- _collisionX = _cock.transform.position.x - 1f;
|
|
|
+ _collisionX = _cock.transform.position.x - 1.5f;
|
|
|
else
|
|
|
{
|
|
|
- _collisionX = _cock.transform.position.x + 1f;
|
|
|
+ _collisionX = _cock.transform.position.x + 1.5f;
|
|
|
}
|
|
|
-
|
|
|
- actionComp.willBeLift = true;
|
|
|
}
|
|
|
|
|
|
private void FixedUpdate()
|
|
@@ -123,17 +122,18 @@ namespace Comp
|
|
|
{
|
|
|
_liftPos = _cock.transform.position;
|
|
|
_cock.transform.parent = transform;
|
|
|
- var comp = _cock.GetComponent<CockActionComp>();
|
|
|
+ var comp = GameCore.Instance.GetCockActionCompByPlayerId(playerId);
|
|
|
+ comp.CloseGravity = true;
|
|
|
switch (comp.cockId)
|
|
|
{
|
|
|
case 1:
|
|
|
- _cock.transform.localPosition = new Vector3(0, 0.9f, 0.3f);
|
|
|
+ comp.stayPos = new Vector3(0, 0.9f, 0.3f);
|
|
|
break;
|
|
|
case 2:
|
|
|
- _cock.transform.localPosition = new Vector3(0, 0.9f, 0.4f);
|
|
|
+ comp.stayPos = new Vector3(0, 0.9f, 0.4f);
|
|
|
break;
|
|
|
default:
|
|
|
- _cock.transform.localPosition = new Vector3(0, 0.9f, 0.3f);
|
|
|
+ comp.stayPos = new Vector3(0, 0.9f, 0.3f);
|
|
|
break;
|
|
|
}
|
|
|
|
|
@@ -141,9 +141,11 @@ namespace Comp
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
+ var comp = GameCore.Instance.GetCockActionCompByPlayerId(playerId);
|
|
|
+ comp.stayPos = Vector3.zero;
|
|
|
_cock.transform.parent = GameCore.Instance.parent.transform;
|
|
|
_cock.transform.position = _liftPos;
|
|
|
- _cock.GetComponent<Rigidbody>().useGravity = true;
|
|
|
+ comp.OpenGravity = true;
|
|
|
_isPutDown = false;
|
|
|
}
|
|
|
}
|