Commit 1dca60ae authored by wanqing's avatar wanqing

后续需求优化

parent 6e16b620
...@@ -8,7 +8,7 @@ public class SixLevelPlayerCollision : MonoBehaviour ...@@ -8,7 +8,7 @@ public class SixLevelPlayerCollision : MonoBehaviour
private bool m_bCollider = true; private bool m_bCollider = true;
private bool m_bControlWin = true; private bool m_bControlWin = true;
private Animator m_animator; private Animator m_animator;
private float m_moveSpeed = 1.0f; private float m_moveSpeed = 2.0f;
private float m_minHeight = -2.0f; private float m_minHeight = -2.0f;
private float m_targetX = 1.06f; private float m_targetX = 1.06f;
private float m_tartgetY = 2.0f; private float m_tartgetY = 2.0f;
......
...@@ -18,6 +18,7 @@ public class ChainHandle : MonoBehaviour ...@@ -18,6 +18,7 @@ public class ChainHandle : MonoBehaviour
private Vector3 m_maxHeightBallPos = new Vector3(2.075f, 3.0f, -6.5f);//铁球最大高度 private Vector3 m_maxHeightBallPos = new Vector3(2.075f, 3.0f, -6.5f);//铁球最大高度
private Transform m_parentTrans;//父节点 private Transform m_parentTrans;//父节点
private HingeJoint m_hingJoint; private HingeJoint m_hingJoint;
private bool m_controlRotate = true;//控制旋转
// Start is called before the first frame update // Start is called before the first frame update
private void Awake() private void Awake()
{ {
...@@ -196,6 +197,13 @@ public class ChainHandle : MonoBehaviour ...@@ -196,6 +197,13 @@ public class ChainHandle : MonoBehaviour
// m_topColliderPosY, // m_topColliderPosY,
// Mathf.Clamp(transform.position.z, varMinY, varMaxY)); // Mathf.Clamp(transform.position.z, varMinY, varMaxY));
//} //}
//铁球有去无回
if(transform.localEulerAngles.x > 180.0f && transform.localEulerAngles.x <= 330.0f && m_controlRotate)
{
m_controlRotate = false;
m_rigidBody.isKinematic = true;
transform.localRotation = Quaternion.Euler(-90, 0, 0);
}
} }
void Clicked() void Clicked()
...@@ -206,13 +214,13 @@ public class ChainHandle : MonoBehaviour ...@@ -206,13 +214,13 @@ public class ChainHandle : MonoBehaviour
if (Physics.Raycast(ray, out hit)) if (Physics.Raycast(ray, out hit))
{ {
if (hit.collider.gameObject.CompareTag("Target")) if (hit.collider && hit.collider.gameObject.CompareTag("Target"))
{ {
//十字架位置 //十字架位置
float varX = (Input.mousePosition.x - Screen.width / 2f) / (Screen.width / GlobalConfig.NormalWidth); float varX = (Input.mousePosition.x - Screen.width / 2f) / (Screen.width / GlobalConfig.NormalWidth);
float varY = (Input.mousePosition.y - Screen.height / 2f) / (Screen.width / GlobalConfig.NormalWidth); float varY = (Input.mousePosition.y - Screen.height / 2f) / (Screen.width / GlobalConfig.NormalWidth);
BattleCtrl.instance.battleUI.SetSymbolPos(varX, varY); BattleCtrl.instance.battleUI.SetSymbolPos(varX, varY);
//设置铁球位置 //重置状态
m_rigidBody.isKinematic = true; m_rigidBody.isKinematic = true;
if(m_hingJoint) if(m_hingJoint)
{ {
...@@ -220,9 +228,12 @@ public class ChainHandle : MonoBehaviour ...@@ -220,9 +228,12 @@ public class ChainHandle : MonoBehaviour
m_hingJoint = null; m_hingJoint = null;
} }
transform.localRotation = Quaternion.Euler(60,0,0); transform.localRotation = Quaternion.Euler(60,0,0);
m_controlRotate = true;
//设置铁球位置
Vector3 varVec3 = m_parentTrans.position; Vector3 varVec3 = m_parentTrans.position;
varVec3.x = hit.point.x - m_maxHeightBallPos.x; varVec3.x = hit.point.x - m_maxHeightBallPos.x;
varVec3.y = hit.point.y+6.0f; varVec3.y = hit.point.y+5.2f;
varVec3.z = 0; varVec3.z = 0;
m_parentTrans.position = varVec3; m_parentTrans.position = varVec3;
GameServices.timerServices.Push(this, 0.1f, delegate GameServices.timerServices.Push(this, 0.1f, delegate
......
...@@ -142,7 +142,7 @@ RectTransform: ...@@ -142,7 +142,7 @@ RectTransform:
m_GameObject: {fileID: 634235204} m_GameObject: {fileID: 634235204}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.3, y: 0.3, z: 1} m_LocalScale: {x: 0.5, y: 0.5, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 6064464677632144690} m_Father: {fileID: 6064464677632144690}
m_RootOrder: 14 m_RootOrder: 14
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment