This commit is contained in:
DESKTOP-PB0N82B\admin 2025-11-04 21:19:23 +08:00
commit 9c6a653b91
25 changed files with 402 additions and 400 deletions

View File

@ -221,9 +221,9 @@ namespace HighlightPlus {
HighlightEffect parentEffect = newObject.GetComponentInParent<HighlightEffect>();
if (parentEffect != null && parentEffect.Includes(newObject)) {
currentEffect = parentEffect;
if (highlightOnHover) {
Highlight(true);
}
return;
}
}
@ -231,9 +231,9 @@ namespace HighlightPlus {
baseEffect.enabled = currentEffect == baseEffect;
currentEffect.SetTarget(currentObject);
if (highlightOnHover) {
Highlight(true);
}
}

View File

@ -112,14 +112,14 @@ namespace Coffee.UIEffects
/// </summary>
public void Stop(bool reset)
{
if (reset)
{
//if (reset)
//{
_time = 0;
if (_callback != null)
{
_callback(_time);
}
}
// }
play = false;
}

View File

@ -257,22 +257,22 @@ namespace ZTools
{
monthFirstDay = new DateTime(Year, Month, 1);
lastMonthEmptyDays = GetLastMonthDays();
if (zCalendarModel.autoFillDate)
{
for (int i = lastMonthEmptyDays; i > 0; i--)
{
AddDayItem(monthFirstDay.AddDays(-i));
}
}
else
{
for (int i = 0; i < lastMonthEmptyDays; i++)
{
ZCalendarDayItem dayItem = zCalendarModel.Instantiate();
dayItem.zCalendarController = this;
dayItem.CloseClickAble();
}
}
}
/// <summary>
/// <20><><EFBFBD><EFBFBD><EFBFBD>¸<EFBFBD><C2B8>µ<EFBFBD>ʱ<EFBFBD><CAB1>
@ -282,14 +282,14 @@ namespace ZTools
int nextMonthDays = 42 - (lastMonthEmptyDays + days);
if (nextMonthDays != 0)
{
if (zCalendarModel.autoFillDate)
{
DateTime lastDay = monthFirstDay.AddDays(days);
for (int i = 0; i < nextMonthDays; i++)
{
AddDayItem(lastDay.AddDays(i));
}
}
}
}
/// <summary>

View File

@ -118,15 +118,15 @@ namespace ZTools
}
if (!zCalendarController.zCalendarModel.isUnexpiredTimeCanClick)
IsUnexpiredTime(zCalendarController.nowTime, dateTime);
if (zCalendarController.zCalendarModel.autoFillDate)
{
IsCrtMonth(zCalendarController.Month);
}
if (zCalendarController.zCalendarModel.lunar)
{
lunarTxt.gameObject.SetActive(true);
SolarToLunar(dateTime);
}
}
/// <summary>
/// 关闭可点击权限

View File

@ -280,15 +280,15 @@ namespace RenderHeads.Media.AVProVideo
private void SwapPlayers()
{
// Pause the previously playing video
// This is useful for systems that will struggle to play 2 videos at once
if (_pausePreviousOnTransition)
{
CurrentPlayer.Pause();
}
// Pause the previously playing video
// This is useful for systems that will struggle to play 2 videos at once
// Tell listeners that the playlist item has changed
Events.Invoke(this, MediaPlayerEvent.EventType.PlaylistItemChanged, ErrorCode.None);
CurrentPlayer.Pause();
// Tell listeners that the playlist item has changed
Events.Invoke(this, MediaPlayerEvent.EventType.PlaylistItemChanged, ErrorCode.None);
// Start the transition
if (_currentTransition != Transition.None)

View File

@ -178,14 +178,14 @@ namespace RenderHeads.Media.AVProVideo
#endif
public static void LogInfo(string message, Object context = null)
{
if (context == null)
{
Debug.Log("[AVProVideo] " + message);
}
else
{
Debug.Log("[AVProVideo] " + message, context);
}
//if (context == null)
//{
// Debug.Log("[AVProVideo] " + message);
//}
//else
//{
// Debug.Log("[AVProVideo] " + message, context);
//}
}
public static int GetUnityAudioSampleRate()

View File

@ -412,8 +412,8 @@ namespace Framework.Manager
if (uiObjects.TryGetValue(currentStep.uiObjectName, out GameObject uiObject))
{
// 如果启用了UI状态检测需要检查UI是否完全显示
if (enableUIStateCheck)
{
//if (enableUIStateCheck)
//{
if (IsUIObjectFullyDisplayed(uiObject))
{
Debug.Log($"执行引导步骤: {currentStep.stepName} 查询的对象:{uiObject.name}");
@ -428,14 +428,14 @@ namespace Framework.Manager
bool delayedResult = await DelayedFindUIObjectAsync(currentStep);
return delayedResult;
}
}
else
{
Debug.Log($"执行引导步骤: {currentStep.stepName} 查询的对象:{uiObject.name}");
GuideMask.Instance.CreateRectangleMask(uiObject);
// 如果UI对象是InputField自动聚焦到该输入框
FocusInputFieldIfApplicable(uiObject);
}
//}
//else
//{
// Debug.Log($"执行引导步骤: {currentStep.stepName} 查询的对象:{uiObject.name}");
// GuideMask.Instance.CreateRectangleMask(uiObject);
// // 如果UI对象是InputField自动聚焦到该输入框
// FocusInputFieldIfApplicable(uiObject);
//}
return true;
}
else
@ -551,8 +551,8 @@ namespace Framework.Manager
if (foundObject != null)
{
// 如果启用了UI状态检测需要等待UI完全显示
if (enableUIStateCheck)
{
//if (enableUIStateCheck)
//{
if (IsUIObjectFullyDisplayed(foundObject))
{
Debug.Log($"延迟查找成功且UI完全显示第{attempts + 1}次尝试找到UI对象: {step.uiObjectName}");
@ -566,15 +566,15 @@ namespace Framework.Manager
Debug.Log($"第{attempts + 1}次尝试找到UI对象但未完全显示: {step.uiObjectName},继续等待...");
foundObject = null; // 重置foundObject继续等待
}
}
else
{
Debug.Log($"延迟查找成功,第{attempts + 1}次尝试找到UI对象: {step.uiObjectName}");
GuideMask.Instance.CreateRectangleMask(foundObject);
// 如果UI对象是InputField自动聚焦到该输入框
FocusInputFieldIfApplicable(foundObject);
return true; // 成功找到并显示UI对象
}
//}
//else
//{
// Debug.Log($"延迟查找成功,第{attempts + 1}次尝试找到UI对象: {step.uiObjectName}");
// GuideMask.Instance.CreateRectangleMask(foundObject);
// // 如果UI对象是InputField自动聚焦到该输入框
// FocusInputFieldIfApplicable(foundObject);
// return true; // 成功找到并显示UI对象
//}
}
// 等待一段时间再尝试
@ -589,18 +589,18 @@ namespace Framework.Manager
Debug.LogWarning($"多次尝试({maxAttempts}次)后仍未找到UI对象: {step.uiObjectName}");
// 判断是否自动跳过
bool autoSkipMissingUI = false; // 可以添加配置选项控制此行为
if (autoSkipMissingUI)
{
Debug.Log($"自动跳过未找到的UI对象: {step.uiObjectName}");
TriggerNextGuide(); // 跳过当前步骤,继续下一个
return true; // 虽然UI对象未找到但已自动跳过视为成功
}
else
{
//bool autoSkipMissingUI = false; // 可以添加配置选项控制此行为
//if (autoSkipMissingUI)
//{
// Debug.Log($"自动跳过未找到的UI对象: {step.uiObjectName}");
// TriggerNextGuide(); // 跳过当前步骤,继续下一个
// return true; // 虽然UI对象未找到但已自动跳过视为成功
//}
//else
//{
Debug.Log($"等待UI对象: {step.uiObjectName} 注册后继续引导");
return false; // 延迟查找失败
}
//}
}
return false; // 默认返回失败

View File

@ -144,12 +144,12 @@ namespace MotionFramework
if (Contains(typeof(T)))
throw new Exception($"Game module {typeof(T)} is already existed");
// 如果没有设置优先级
if (priority == 0)
{
int minPriority = GetMinPriority();
priority = --minPriority;
}
MotionLog.Log($"Create game module : {typeof(T)}");
T module = Activator.CreateInstance<T>();

View File

@ -131,13 +131,13 @@ namespace Framework.Scripts.Runtime.Engine.Engine.Camera.CameraControl
public void ControlCamera()
{
if (enableMouseOverUI)
{
if (EventSystem.current.IsPointerOverGameObject())
{
return;
}
}
if (enableMouseFunctions)
{

View File

@ -130,8 +130,8 @@ namespace MotionFramework.Utility
}
else
{
if(checkError)
throw new Exception($"class {type} must inherit from {parentType}.");
//if(checkError)
// throw new Exception($"class {type} must inherit from {parentType}.");
}
}
}

View File

@ -25,16 +25,16 @@ namespace UnityStandardAssets.Vehicles.Ball
public void Move(Vector3 moveDirection, bool jump)
{
// If using torque to rotate the ball...
if (m_UseTorque)
{
// ... add torque around the axis defined by the move direction.
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 (Physics.Raycast(transform.position, -Vector3.up, k_GroundRayLength) && jump)

View File

@ -43,8 +43,8 @@ namespace UnityStandardAssets.Utility
// read input from mouse or mobile controls
float inputH;
float inputV;
if (relative)
{
inputH = CrossPlatformInputManager.GetAxis("Mouse X");
inputV = CrossPlatformInputManager.GetAxis("Mouse Y");
@ -92,16 +92,16 @@ namespace UnityStandardAssets.Utility
// clamp values to allowed range
m_TargetAngles.y = Mathf.Clamp(m_TargetAngles.y, -rotationRange.y*0.5f, rotationRange.y*0.5f);
m_TargetAngles.x = Mathf.Clamp(m_TargetAngles.x, -rotationRange.x*0.5f, rotationRange.x*0.5f);
}
else
{
inputH = Input.mousePosition.x;
inputV = Input.mousePosition.y;
// set values to allowed range
m_TargetAngles.y = Mathf.Lerp(-rotationRange.y*0.5f, rotationRange.y*0.5f, inputH/Screen.width);
m_TargetAngles.x = Mathf.Lerp(-rotationRange.x*0.5f, rotationRange.x*0.5f, inputV/Screen.height);
}
// smoothly interpolate current values to target angles
m_FollowAngles = Vector3.SmoothDamp(m_FollowAngles, m_TargetAngles, ref m_FollowVelocity, dampingTime);

View File

@ -147,10 +147,10 @@ namespace UnityStandardAssets.Vehicles.Car
m_HighDecel.volume = highFade*decFade;
// adjust the doppler levels
m_HighAccel.dopplerLevel = useDoppler ? dopplerLevel : 0;
m_LowAccel.dopplerLevel = useDoppler ? dopplerLevel : 0;
m_HighDecel.dopplerLevel = useDoppler ? dopplerLevel : 0;
m_LowDecel.dopplerLevel = useDoppler ? dopplerLevel : 0;
m_HighAccel.dopplerLevel = 1;
m_LowAccel.dopplerLevel = 1;
m_HighDecel.dopplerLevel = 1;
m_LowDecel.dopplerLevel = 1;
}
}
}

View File

@ -102,7 +102,7 @@ namespace Cysharp.Threading.Tasks
{
if (ex != null)
{
if (!PropagateOperationCanceledException && ex is OperationCanceledException)
if (ex is OperationCanceledException)
{
return;
}

View File

@ -47,10 +47,10 @@ public class AdaptiveButton : MonoBehaviour
// 查找文本组件
FindTextComponent();
if (enableDebugLog)
{
Debug.Log($"[AdaptiveButton] 组件初始化完成 - 对象: {gameObject.name}");
}
}
/// <summary>
@ -67,10 +67,10 @@ public class AdaptiveButton : MonoBehaviour
return;
}
if (enableDebugLog)
{
Debug.Log($"[AdaptiveButton] 找到文本组件 - 对象: {textComponent.gameObject.name}");
}
}
/// <summary>
@ -101,10 +101,10 @@ public class AdaptiveButton : MonoBehaviour
currentSize.x = targetWidth;
buttonRectTransform.sizeDelta = currentSize;
if (enableDebugLog)
{
Debug.Log($"[AdaptiveButton] 按钮宽度已调整 - 文本宽度: {textWidth:F1}, 目标宽度: {targetWidth:F1}, 对象: {gameObject.name}");
}
}
/// <summary>
@ -125,10 +125,10 @@ public class AdaptiveButton : MonoBehaviour
// 调整按钮宽度
AdjustButtonWidth();
if (enableDebugLog)
{
Debug.Log($"[AdaptiveButton] 文本已设置 - 内容: \"{text}\", 对象: {gameObject.name}");
}
}
/// <summary>
@ -179,10 +179,10 @@ public class AdaptiveButton : MonoBehaviour
public void SetMinWidth(float width)
{
minWidth = width;
if (enableDebugLog)
{
Debug.Log($"[AdaptiveButton] 最小宽度已设置为: {width}, 对象: {gameObject.name}");
}
}
/// <summary>
@ -192,10 +192,10 @@ public class AdaptiveButton : MonoBehaviour
public void SetMaxWidth(float width)
{
maxWidth = width;
if (enableDebugLog)
{
Debug.Log($"[AdaptiveButton] 最大宽度已设置为: {width}, 对象: {gameObject.name}");
}
}
/// <summary>
@ -205,9 +205,9 @@ public class AdaptiveButton : MonoBehaviour
public void SetPadding(float paddingValue)
{
padding = paddingValue;
if (enableDebugLog)
{
Debug.Log($"[AdaptiveButton] 内边距已设置为: {paddingValue}, 对象: {gameObject.name}");
}
}
}

View File

@ -50,10 +50,10 @@ public class AutoHideScript : MonoBehaviour
if (canvasGroup == null)
{
canvasGroup = gameObject.AddComponent<CanvasGroup>();
if (enableDebugLog)
{
Debug.Log($"AutoHideScript: 为物体 {gameObject.name} 添加了CanvasGroup组件");
}
}
SetCanvasGroupAlpha(hideAlpha);
@ -70,11 +70,11 @@ public class AutoHideScript : MonoBehaviour
canvasGroup.alpha = alpha;
// 根据透明度设置交互状态
if (disableInteractionWhenHidden)
{
canvasGroup.interactable = alpha > 0.1f;
canvasGroup.blocksRaycasts = alpha > 0.1f;
}
}
}
@ -83,10 +83,10 @@ public class AutoHideScript : MonoBehaviour
/// </summary>
public void ShowObject(string title)
{
if (enableDebugLog)
{
Debug.Log($"AutoHideScript: 显示物体 {gameObject.name}");
}
transform.Find("text").GetComponent<TMP_Text>().text = title;
// 显示物体使用CanvasGroup透明度
SetCanvasGroupAlpha(showAlpha);
@ -94,10 +94,10 @@ public class AutoHideScript : MonoBehaviour
// 如果已经在等待隐藏,取消之前的等待任务
if (isWaitingToHide)
{
if (enableDebugLog)
{
Debug.Log($"AutoHideScript: 取消之前的隐藏任务,重新开始计时");
}
CancelCurrentHideTask();
}
@ -110,10 +110,10 @@ public class AutoHideScript : MonoBehaviour
/// </summary>
public void HideObject()
{
if (enableDebugLog)
{
Debug.Log($"AutoHideScript: 立即隐藏物体 {gameObject.name}");
}
// 取消当前的隐藏任务
CancelCurrentHideTask();
@ -157,10 +157,10 @@ public class AutoHideScript : MonoBehaviour
{
try
{
if (enableDebugLog)
{
Debug.Log($"AutoHideScript: 开始等待 {hideDelay} 秒后隐藏物体 {gameObject.name}");
}
// 等待指定时间
await UniTask.Delay(TimeSpan.FromSeconds(hideDelay), cancellationToken: cancellationToken);
@ -168,20 +168,20 @@ public class AutoHideScript : MonoBehaviour
// 等待完成后隐藏物体
if (gameObject != null)
{
if (enableDebugLog)
{
Debug.Log($"AutoHideScript: 等待完成,隐藏物体 {gameObject.name}");
}
SetCanvasGroupAlpha(hideAlpha);
}
}
catch (OperationCanceledException)
{
// 任务被取消,这是正常情况
if (enableDebugLog)
{
Debug.Log($"AutoHideScript: 隐藏任务被取消 {gameObject.name}");
}
}
catch (Exception ex)
{
@ -202,10 +202,10 @@ public class AutoHideScript : MonoBehaviour
public void SetHideDelay(float delay)
{
hideDelay = Mathf.Max(0f, delay);
if (enableDebugLog)
{
Debug.Log($"AutoHideScript: 设置隐藏延迟时间为 {hideDelay} 秒");
}
}
/// <summary>

View File

@ -38,10 +38,10 @@ public class DropdownValidator : MonoBehaviour
// 监听选择变化事件
dropdown.onValueChanged.AddListener(OnDropdownValueChanged);
if (enableDebugLog)
{
Debug.Log($"DropdownValidator: 初始化完成 - {gameObject.name}");
}
}
/// <summary>
@ -71,30 +71,30 @@ public class DropdownValidator : MonoBehaviour
// 检查是否有有效选择
if (selectedIndex < 0 || selectedIndex >= dropdown.options.Count)
{
if (enableDebugLog)
{
Debug.Log($"DropdownValidator: 选择无效,不验证 - 下拉框: {gameObject.name}, 索引: {selectedIndex}");
}
return;
}
// 获取选择的文本
string selectedText = dropdown.options[selectedIndex].text;
if (enableDebugLog)
{
Debug.Log($"DropdownValidator: 开始验证选择 - 下拉框: {gameObject.name}, 索引: {selectedIndex}, 文本: '{selectedText}'");
}
// 使用新的严谨验证方法验证选择是否匹配当前动作的正确答案传递UI ID
bool isSelectionCorrect = MotionFramework.MotionEngine.GetModule<ProcessManager>().ValidateInputAgainstCurrentAction(selectedText, gameObject.name);
if (isSelectionCorrect)
{
if (enableDebugLog)
{
Debug.Log($"DropdownValidator: 选择正确自动跳转 - 下拉框: {gameObject.name}, 索引: {selectedIndex}, 文本: '{selectedText}'");
}
if (enableAutoJump)
{
@ -104,10 +104,10 @@ public class DropdownValidator : MonoBehaviour
}
else
{
if (enableDebugLog)
{
Debug.Log($"DropdownValidator: 选择错误,不跳转 - 下拉框: {gameObject.name}, 索引: {selectedIndex}, 文本: '{selectedText}'");
}
}
}
@ -129,10 +129,10 @@ public class DropdownValidator : MonoBehaviour
public void SetAutoJumpEnabled(bool enabled)
{
enableAutoJump = enabled;
if (enableDebugLog)
{
Debug.Log($"DropdownValidator: 自动跳转功能 {(enabled ? "" : "")} - {gameObject.name}");
}
}
/// <summary>
@ -142,10 +142,10 @@ public class DropdownValidator : MonoBehaviour
public void SetValidationDelay(float delay)
{
validationDelay = Mathf.Max(0f, delay);
if (enableDebugLog)
{
Debug.Log($"DropdownValidator: 验证延迟设置为 {validationDelay} 秒 - {gameObject.name}");
}
}
/// <summary>
@ -194,10 +194,10 @@ public class DropdownValidator : MonoBehaviour
dropdown.AddOptions(options);
lastValidatedIndex = -1;
if (enableDebugLog)
{
Debug.Log($"DropdownValidator: 设置选项完成 - 下拉框: {gameObject.name}, 选项数量: {options.Count}");
}
}
}
}

View File

@ -39,10 +39,10 @@ public class NPUTFieldValidator : MonoBehaviour
// 监听输入变化事件
inputField.onValueChanged.AddListener(OnInputValueChanged);
if (enableDebugLog)
{
// Debug.Log($"InputFieldValidator: 初始化完成 - {gameObject.name}");
}
}
/// <summary>
@ -69,18 +69,18 @@ public class NPUTFieldValidator : MonoBehaviour
{
lastValidatedValue = value;
if (enableDebugLog)
{
Debug.Log($"InputFieldValidator: 开始验证输入 - 输入框: {gameObject.name}, 值: '{value}'");
}
// 检查是否为空值
if (string.IsNullOrWhiteSpace(value))
{
if (enableDebugLog)
{
Debug.Log($"InputFieldValidator: 输入为空,不验证 - 输入框: {gameObject.name}");
}
return;
}
@ -89,10 +89,10 @@ public class NPUTFieldValidator : MonoBehaviour
if (isInputCorrect)
{
if (enableDebugLog)
{
Debug.Log($"InputFieldValidator: 输入正确自动跳转 - 输入框: {gameObject.name}, 值: '{value}'");
}
if (enableAutoJump)
{
@ -102,10 +102,10 @@ public class NPUTFieldValidator : MonoBehaviour
}
else
{
if (enableDebugLog)
{
Debug.Log($"InputFieldValidator: 输入错误,不跳转 - 输入框: {gameObject.name}, 值: '{value}'");
}
}
}
@ -127,10 +127,10 @@ public class NPUTFieldValidator : MonoBehaviour
public void SetAutoJumpEnabled(bool enabled)
{
enableAutoJump = enabled;
if (enableDebugLog)
{
Debug.Log($"InputFieldValidator: 自动跳转功能 {(enabled ? "" : "")} - {gameObject.name}");
}
}
/// <summary>
@ -140,10 +140,10 @@ public class NPUTFieldValidator : MonoBehaviour
public void SetValidationDelay(float delay)
{
validationDelay = Mathf.Max(0f, delay);
if (enableDebugLog)
{
Debug.Log($"InputFieldValidator: 验证延迟设置为 {validationDelay} 秒 - {gameObject.name}");
}
}
/// <summary>

View File

@ -243,15 +243,15 @@ public class ProgressBarController : MonoBehaviour
{
if (completionText != null)
{
if (showPercentage)
{
int percentage = Mathf.RoundToInt(progress * 100);
completionText.text = $"{progressMessage} {percentage}%";
}
else
{
completionText.text = $"{progressMessage} 进度: {progress:F2}";
}
}
}

View File

@ -69,10 +69,10 @@ public class ScrollableInputField : MonoBehaviour
return;
}
//if (enableDebugLog)
//{
// Debug.Log($"ScrollableInputField: 初始化完成 - {gameObject.name}");
//}
SetText("大量文本大量文本内容大量文本内容大量文本大量文本内容大量文本内容大量文本内容大量文本内容大量文本内容大量文本内容大量文本内容大量文本内容大量文本内容大量文本内容大量文本内容大量文本内容大量文本内容大量文本内容大量文本内容大量文本内容大量文本内容大量文本内容大量文本内容大量文本内容大量文本内容大量文本内容大量文本内容内容大量文本内容大量文本内容大量文本内容大量文本内容大量文本内容大量文本内容大量文本内容大量文本内容大量文本内容大量文本内容大量文本内容大量文本内容大量文本内容大量文本内容大量文本内容大量文本内容大量文本内容大量文本内容大量文本内容大量文本内容大量文本内容内容...");
}
@ -97,10 +97,10 @@ public class ScrollableInputField : MonoBehaviour
inputField.onValueChanged.AddListener(OnInputFieldTextChanged);
inputField.onEndEdit.AddListener(OnInputFieldEndEdit);
//if (enableDebugLog)
//{
// Debug.Log($"ScrollableInputField: InputField设置完成 - 多行模式: {inputField.lineType}, 字符限制: {inputField.characterLimit}");
//}
}
/// <summary>
@ -112,10 +112,10 @@ public class ScrollableInputField : MonoBehaviour
{
copyButton.onClick.AddListener(CopyTextToClipboard);
//if (enableDebugLog)
//{
// Debug.Log($"ScrollableInputField: 复制按钮设置完成");
//}
}
}
@ -134,10 +134,10 @@ public class ScrollableInputField : MonoBehaviour
ScrollToBottom();
}
//if (enableDebugLog)
//{
// Debug.Log($"ScrollableInputField: 文本变化 - 长度: {text.Length}");
//}
}
/// <summary>
@ -146,10 +146,10 @@ public class ScrollableInputField : MonoBehaviour
/// <param name="text">最终文本内容</param>
private void OnInputFieldEndEdit(string text)
{
//if (enableDebugLog)
//{
// Debug.Log($"ScrollableInputField: 编辑结束 - 最终长度: {text.Length}");
//}
}
/// <summary>
@ -197,10 +197,10 @@ public class ScrollableInputField : MonoBehaviour
{
GUIUtility.systemCopyBuffer = textToCopy;
//if (enableDebugLog)
//{
// Debug.Log($"ScrollableInputField: 文本已复制到剪贴板 - 长度: {textToCopy.Length}");
//}
// 触发复制成功事件
OnCopySuccess?.Invoke();
@ -221,10 +221,10 @@ public class ScrollableInputField : MonoBehaviour
{
inputField.text = text;
//if (enableDebugLog)
//{
// Debug.Log($"ScrollableInputField: 设置文本 - 长度: {text?.Length ?? 0}");
//}
}
}
@ -255,10 +255,10 @@ public class ScrollableInputField : MonoBehaviour
{
inputField.text += text;
// if (enableDebugLog)
//{
// Debug.Log($"ScrollableInputField: 追加文本 - 追加长度: {text?.Length ?? 0}, 总长度: {inputField.text.Length}");
// }
}
}
@ -274,10 +274,10 @@ public class ScrollableInputField : MonoBehaviour
{
inputField.characterLimit = limit > 0 ? limit : 0;
//if (enableDebugLog)
//{
// Debug.Log($"ScrollableInputField: 设置字符限制: {limit}");
//}
}
}
@ -289,10 +289,10 @@ public class ScrollableInputField : MonoBehaviour
{
autoScrollToBottom = autoScroll;
//if (enableDebugLog)
//{
// Debug.Log($"ScrollableInputField: 设置自动滚动: {autoScroll}");
//}
}
/// <summary>
@ -324,10 +324,10 @@ public class ScrollableInputField : MonoBehaviour
{
inputField.interactable = interactable;
//if (enableDebugLog)
//{
// Debug.Log($"ScrollableInputField: 设置可交互状态: {interactable}");
//}
}
}

View File

@ -38,10 +38,10 @@ public class TMPDropdownValidator : MonoBehaviour
// 监听选择变化事件
dropdown.onValueChanged.AddListener(OnDropdownValueChanged);
if (enableDebugLog)
{
Debug.Log($"TMPDropdownValidator: 初始化完成 - {gameObject.name}");
}
}
/// <summary>
@ -71,30 +71,30 @@ public class TMPDropdownValidator : MonoBehaviour
// 检查是否有有效选择
if (selectedIndex < 0 || selectedIndex >= dropdown.options.Count)
{
if (enableDebugLog)
{
Debug.Log($"TMPDropdownValidator: 选择无效,不验证 - 下拉框: {gameObject.name}, 索引: {selectedIndex}");
}
return;
}
// 获取选择的文本
string selectedText = dropdown.options[selectedIndex].text;
if (enableDebugLog)
{
Debug.Log($"TMPDropdownValidator: 开始验证选择 - 下拉框: {gameObject.name}, 索引: {selectedIndex}, 文本: '{selectedText}'");
}
// 使用新的严谨验证方法验证选择是否匹配当前动作的正确答案传递UI ID
bool isSelectionCorrect = MotionFramework.MotionEngine.GetModule<ProcessManager>().ValidateInputAgainstCurrentAction(selectedText, gameObject.name);
if (isSelectionCorrect)
{
if (enableDebugLog)
{
Debug.Log($"TMPDropdownValidator: 选择正确自动跳转 - 下拉框: {gameObject.name}, 索引: {selectedIndex}, 文本: '{selectedText}'");
}
if (enableAutoJump)
{
@ -104,10 +104,10 @@ public class TMPDropdownValidator : MonoBehaviour
}
else
{
if (enableDebugLog)
{
Debug.Log($"TMPDropdownValidator: 选择错误,不跳转 - 下拉框: {gameObject.name}, 索引: {selectedIndex}, 文本: '{selectedText}'");
}
}
}
@ -129,10 +129,10 @@ public class TMPDropdownValidator : MonoBehaviour
public void SetAutoJumpEnabled(bool enabled)
{
enableAutoJump = enabled;
if (enableDebugLog)
{
Debug.Log($"TMPDropdownValidator: 自动跳转功能 {(enabled ? "" : "")} - {gameObject.name}");
}
}
/// <summary>
@ -142,10 +142,10 @@ public class TMPDropdownValidator : MonoBehaviour
public void SetValidationDelay(float delay)
{
validationDelay = Mathf.Max(0f, delay);
if (enableDebugLog)
{
Debug.Log($"TMPDropdownValidator: 验证延迟设置为 {validationDelay} 秒 - {gameObject.name}");
}
}
/// <summary>
@ -194,10 +194,10 @@ public class TMPDropdownValidator : MonoBehaviour
dropdown.AddOptions(options);
lastValidatedIndex = -1;
if (enableDebugLog)
{
Debug.Log($"TMPDropdownValidator: 设置选项完成 - 下拉框: {gameObject.name}, 选项数量: {options.Count}");
}
}
}
}

View File

@ -208,10 +208,10 @@ public class TMPInputFieldAutoSetup : MonoBehaviour
StartCoroutine(DelayedScrollbarUpdate());
}
//if (enableDebugLog)
//{
// Debug.Log($"TMPInputFieldAutoSetup: 设置已应用 - 溢出模式: {overflowMode}, 换行: {enableWordWrapping}, 自动调整: {enableAutoSizing}");
//}
}
/// <summary>
@ -420,10 +420,10 @@ public class TMPInputFieldAutoSetup : MonoBehaviour
{
contentRect.sizeDelta = new Vector2(contentRect.sizeDelta.x, preferredHeight + 20f); // 额外20像素边距
//if (enableDebugLog)
//{
// Debug.Log($"TMPInputFieldAutoSetup: Content高度已调整 - 文本高度: {preferredHeight}, Content高度: {contentRect.sizeDelta.y}");
//}
}
}
}
@ -491,10 +491,10 @@ public class TMPInputFieldAutoSetup : MonoBehaviour
textRect.sizeDelta = new Vector2(textRect.sizeDelta.x, 50f);
}
//if (enableDebugLog)
//{
// Debug.Log($"TMPInputFieldAutoSetup: 文本RectTransform已设置 - 大小: {textRect.sizeDelta}");
//}
}
/// <summary>
@ -513,10 +513,10 @@ public class TMPInputFieldAutoSetup : MonoBehaviour
// 临时禁用Layout Group
layoutGroup.enabled = false;
//if (enableDebugLog)
//{
// Debug.Log($"TMPInputFieldAutoSetup: 已临时禁用Layout Group: {layoutGroup.GetType().Name}");
//}
}
// 检测并处理Content Size Fitter的限制
@ -661,10 +661,10 @@ public class TMPInputFieldAutoSetup : MonoBehaviour
layoutGroup.enabled = true;
}
//if (enableDebugLog)
//{
// Debug.Log("TMPInputFieldAutoSetup: ScrollRect滚动功能已恢复");
//}
}
/// <summary>
@ -682,15 +682,15 @@ public class TMPInputFieldAutoSetup : MonoBehaviour
bool hasContent = scrollRect.content != null;
bool contentHasSize = hasContent && scrollRect.content.sizeDelta.y > 0;
//if (enableDebugLog)
//{
// Debug.Log($"TMPInputFieldAutoSetup: ScrollRect状态检查\n" +
// $"可滚动: {isScrollable}\n" +
// $"有Content: {hasContent}\n" +
// $"Content有大小: {contentHasSize}\n" +
// $"水平滚动: {scrollRect.horizontal}\n" +
// $"垂直滚动: {scrollRect.vertical}");
//}
return isScrollable && hasContent && contentHasSize;
}
@ -732,15 +732,15 @@ public class TMPInputFieldAutoSetup : MonoBehaviour
UpdateScrollbarVisibility(horizontalScrollbar, needsHorizontalScrollbar);
}
//if (enableDebugLog)
//{
// Debug.Log($"TMPInputFieldAutoSetup: 自适应滚动条更新\n" +
// $"文本高度: {textHeight}\n" +
// $"Viewport高度: {viewportHeight}\n" +
// $"Content高度: {contentHeight}\n" +
// $"需要垂直滚动条: {needsVerticalScrollbar}\n" +
// $"需要水平滚动条: {needsHorizontalScrollbar}");
//}
}
/// <summary>
@ -830,10 +830,10 @@ public class TMPInputFieldAutoSetup : MonoBehaviour
}
}
//if (enableDebugLog)
//{
// Debug.Log($"TMPInputFieldAutoSetup: 自适应滚动条功能已{(enable ? "启用" : "禁用")}");
//}
}
#if UNITY_EDITOR

View File

@ -38,10 +38,10 @@ public class TMPInputFieldValidator : MonoBehaviour
// 监听输入变化事件
inputField.onValueChanged.AddListener(OnInputValueChanged);
if (enableDebugLog)
{
Debug.Log($"InputFieldValidator: 初始化完成 - {gameObject.name}");
}
}
/// <summary>
@ -68,20 +68,20 @@ public class TMPInputFieldValidator : MonoBehaviour
{
lastValidatedValue = value;
if (enableDebugLog)
{
Debug.Log($"InputFieldValidator: 开始验证输入 - 输入框: {gameObject.name}, 值: {value}");
}
// 使用新的严谨验证方法验证输入是否匹配当前动作的正确答案传递UI ID
bool isInputCorrect = MotionFramework.MotionEngine.GetModule<ProcessManager>().ValidateInputAgainstCurrentAction(value, gameObject.name);
if (isInputCorrect)
{
if (enableDebugLog)
{
Debug.Log($"InputFieldValidator: 输入正确自动跳转 - 输入框: {gameObject.name}, 值: {value}");
}
if (enableAutoJump)
{
@ -91,10 +91,11 @@ public class TMPInputFieldValidator : MonoBehaviour
}
else
{
if (enableDebugLog)
{
Debug.Log($"InputFieldValidator: 输入错误,不跳转 - 输入框: {gameObject.name}, 值: {value}");
}
}
}
@ -116,10 +117,11 @@ public class TMPInputFieldValidator : MonoBehaviour
public void SetAutoJumpEnabled(bool enabled)
{
enableAutoJump = enabled;
if (enableDebugLog)
{
Debug.Log($"InputFieldValidator: 自动跳转功能 {(enabled ? "" : "")} - {gameObject.name}");
}
}
/// <summary>
@ -129,10 +131,10 @@ public class TMPInputFieldValidator : MonoBehaviour
public void SetValidationDelay(float delay)
{
validationDelay = Mathf.Max(0f, delay);
if (enableDebugLog)
{
Debug.Log($"InputFieldValidator: 验证延迟设置为 {validationDelay} 秒 - {gameObject.name}");
}
}
/// <summary>

View File

@ -1942,8 +1942,8 @@ public class ModerController : MonoBehaviour
return false;
}
if (active)
{
// 随机选择一个损坏模型变体
int randomIndex = Random.Range(0, existingBrokenModels.Count);
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;
}

View File

@ -38,8 +38,8 @@ public class DragWindow : MonoBehaviour, IDragHandler, IBeginDragHandler, IEndDr
}
public void OnDrag(PointerEventData eventData)
{
if (!IgnoretheUI)
if (EventSystem.current.IsPointerOverGameObject()) return;
if (EventSystem.current.IsPointerOverGameObject()) return;
if (CanDrag)
{
Vector2 localPosition;
@ -53,8 +53,8 @@ public class DragWindow : MonoBehaviour, IDragHandler, IBeginDragHandler, IEndDr
//停止拖拽
public void OnEndDrag(PointerEventData eventData)
{
if (!IgnoretheUI)
if (EventSystem.current.IsPointerOverGameObject()) return;
if (EventSystem.current.IsPointerOverGameObject()) return;
CanDrag = false;
if (isFirstDrag && transform.Find("tip"))
{