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