2.0003
This commit is contained in:
parent
8564b999ac
commit
5551a323fe
|
|
@ -25,16 +25,16 @@ namespace UnityStandardAssets.Vehicles.Ball
|
||||||
public void Move(Vector3 moveDirection, bool jump)
|
public void Move(Vector3 moveDirection, bool jump)
|
||||||
{
|
{
|
||||||
// If using torque to rotate the ball...
|
// If using torque to rotate the ball...
|
||||||
if (m_UseTorque)
|
|
||||||
{
|
|
||||||
// ... add torque around the axis defined by the move direction.
|
// ... add torque around the axis defined by the move direction.
|
||||||
m_Rigidbody.AddTorque(new Vector3(moveDirection.z, 0, -moveDirection.x)*m_MovePower);
|
m_Rigidbody.AddTorque(new Vector3(moveDirection.z, 0, -moveDirection.x)*m_MovePower);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Otherwise add force in the move direction.
|
|
||||||
m_Rigidbody.AddForce(moveDirection*m_MovePower);
|
|
||||||
}
|
|
||||||
|
|
||||||
// If on the ground and jump is pressed...
|
// If on the ground and jump is pressed...
|
||||||
if (Physics.Raycast(transform.position, -Vector3.up, k_GroundRayLength) && jump)
|
if (Physics.Raycast(transform.position, -Vector3.up, k_GroundRayLength) && jump)
|
||||||
|
|
|
||||||
|
|
@ -243,15 +243,15 @@ public class ProgressBarController : MonoBehaviour
|
||||||
{
|
{
|
||||||
if (completionText != null)
|
if (completionText != null)
|
||||||
{
|
{
|
||||||
if (showPercentage)
|
|
||||||
{
|
|
||||||
int percentage = Mathf.RoundToInt(progress * 100);
|
int percentage = Mathf.RoundToInt(progress * 100);
|
||||||
completionText.text = $"{progressMessage} {percentage}%";
|
completionText.text = $"{progressMessage} {percentage}%";
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
completionText.text = $"{progressMessage} 进度: {progress:F2}";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1942,8 +1942,8 @@ public class ModerController : MonoBehaviour
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (active)
|
|
||||||
{
|
|
||||||
// 随机选择一个损坏模型变体
|
// 随机选择一个损坏模型变体
|
||||||
int randomIndex = Random.Range(0, existingBrokenModels.Count);
|
int randomIndex = Random.Range(0, existingBrokenModels.Count);
|
||||||
string selectedBrokenModel = existingBrokenModels[randomIndex];
|
string selectedBrokenModel = existingBrokenModels[randomIndex];
|
||||||
|
|
@ -1968,20 +1968,20 @@ public class ModerController : MonoBehaviour
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// 关闭所有损坏模型
|
|
||||||
foreach (string modelName in existingBrokenModels)
|
|
||||||
{
|
|
||||||
Transform child = parent.Find(modelName);
|
|
||||||
if (child != null)
|
|
||||||
{
|
|
||||||
child.gameObject.SetActive(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Debug.Log($"关闭所有损坏模型,基础模型: {baseModelName}");
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -38,8 +38,8 @@ public class DragWindow : MonoBehaviour, IDragHandler, IBeginDragHandler, IEndDr
|
||||||
}
|
}
|
||||||
public void OnDrag(PointerEventData eventData)
|
public void OnDrag(PointerEventData eventData)
|
||||||
{
|
{
|
||||||
if (!IgnoretheUI)
|
|
||||||
if (EventSystem.current.IsPointerOverGameObject()) return;
|
if (EventSystem.current.IsPointerOverGameObject()) return;
|
||||||
if (CanDrag)
|
if (CanDrag)
|
||||||
{
|
{
|
||||||
Vector2 localPosition;
|
Vector2 localPosition;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue