updaye
This commit is contained in:
14
.idea/.idea.HALLUCINATE/.idea/workspace.xml
generated
14
.idea/.idea.HALLUCINATE/.idea/workspace.xml
generated
@@ -5,15 +5,8 @@
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="f9183c68-daf0-43b8-be4c-fad79983f91b" name="Changes" comment="">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/.idea.HALLUCINATE/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.HALLUCINATE/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Assets/Audio/Basic Locomotion/Mixers/FOR AI GAME.mixer" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Audio/Basic Locomotion/Mixers/FOR AI GAME.mixer" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Assets/Prefabs/NPC/xNPC.prefab" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Prefabs/NPC/xNPC.prefab" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Assets/Presets/FOR AI GAME.asset" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Presets/FOR AI GAME.asset" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Assets/Scenes/Cho môn AI/Only AI.unity" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scenes/Cho môn AI/Only AI.unity" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Assets/Scripts/AI NPC/ChatBubble.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/AI NPC/ChatBubble.cs" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Assets/Scripts/AI NPC/EnemyAI.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/AI NPC/EnemyAI.cs" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Assets/Scripts/AI NPC/GeminiService.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/AI NPC/GeminiService.cs" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Assets/Scripts/Player/CharacterController/Editor/Resources/vEditorStartupPrefs.asset" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/Player/CharacterController/Editor/Resources/vEditorStartupPrefs.asset" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Assets/Animation/Shooter/Animator/Invector@ShooterMelee.controller" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Animation/Shooter/Animator/Invector@ShooterMelee.controller" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Assets/Scripts/AI NPC/AnimatorAI.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/AI NPC/AnimatorAI.cs" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Assets/Third Parties/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF - Fallback.asset" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Third Parties/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF - Fallback.asset" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
@@ -108,7 +101,7 @@
|
||||
<option name="MIXED_MODE_DEBUG" value="0" />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
<configuration name="Attach to Unity Editor" type="UNITY_DEBUG_RUN_CONFIGURATION" factoryName="Unity Debug" show_console_on_std_err="false" show_console_on_std_out="false" port="50000" address="localhost" useMixedMode="false">
|
||||
<configuration name="Attach to Unity Editor" type="UNITY_DEBUG_RUN_CONFIGURATION" factoryName="Unity Debug" show_console_on_std_err="false" show_console_on_std_out="false" port="50000" address="localhost">
|
||||
<option name="allowRunningInParallel" value="false" />
|
||||
<option name="listenPortForConnections" value="false" />
|
||||
<option name="pid" />
|
||||
@@ -119,6 +112,7 @@
|
||||
<option name="selectedOptions">
|
||||
<list />
|
||||
</option>
|
||||
<option name="useMixedMode" value="false" />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
<configuration name="Attach to" type="UnityDevicePlayer" factoryName="UnityAttachToDevicePlayer">
|
||||
|
||||
@@ -14716,7 +14716,10 @@ AnimatorStateMachine:
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Base Layer
|
||||
m_ChildStates: []
|
||||
m_ChildStates:
|
||||
- serializedVersion: 1
|
||||
m_State: {fileID: 4416801500611958025}
|
||||
m_Position: {x: -358.64734, y: -43.860413, z: 0}
|
||||
m_ChildStateMachines:
|
||||
- serializedVersion: 1
|
||||
m_StateMachine: {fileID: 1107191697213795204}
|
||||
@@ -36256,6 +36259,32 @@ AnimatorStateTransition:
|
||||
m_InterruptionSource: 0
|
||||
m_OrderedInterruption: 1
|
||||
m_CanTransitionToSelf: 1
|
||||
--- !u!1102 &4416801500611958025
|
||||
AnimatorState:
|
||||
serializedVersion: 6
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: TestRun
|
||||
m_Speed: 1
|
||||
m_CycleOffset: 0
|
||||
m_Transitions: []
|
||||
m_StateMachineBehaviours: []
|
||||
m_Position: {x: 50, y: 50, z: 0}
|
||||
m_IKOnFeet: 0
|
||||
m_WriteDefaultValues: 1
|
||||
m_Mirror: 0
|
||||
m_SpeedParameterActive: 0
|
||||
m_MirrorParameterActive: 0
|
||||
m_CycleOffsetParameterActive: 0
|
||||
m_TimeParameterActive: 0
|
||||
m_Motion: {fileID: 7400012, guid: 37c6cfe59f56e8a4799011397a870a8b, type: 3}
|
||||
m_Tag:
|
||||
m_SpeedParameter:
|
||||
m_MirrorParameter:
|
||||
m_CycleOffsetParameter:
|
||||
m_TimeParameter:
|
||||
--- !u!1101 &4602781940129309487
|
||||
AnimatorStateTransition:
|
||||
m_ObjectHideFlags: 1
|
||||
|
||||
@@ -90221,6 +90221,22 @@ PrefabInstance:
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6469822191588635990, guid: 15df559ce497e104a81254e0adf3107e, type: 3}
|
||||
propertyPath: useSimulation
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6469822191588635990, guid: 15df559ce497e104a81254e0adf3107e, type: 3}
|
||||
propertyPath: autoCycleSpeed
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6469822191588635990, guid: 15df559ce497e104a81254e0adf3107e, type: 3}
|
||||
propertyPath: forcePlayState
|
||||
value: Free Movement
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6469822191588635990, guid: 15df559ce497e104a81254e0adf3107e, type: 3}
|
||||
propertyPath: showLayerWeights
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7522161431095319480, guid: 15df559ce497e104a81254e0adf3107e, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: xNPC
|
||||
|
||||
@@ -68,6 +68,10 @@ public class AnimatorAI : MonoBehaviour
|
||||
protected vAnimatorParameter powerCharger;
|
||||
#endregion
|
||||
|
||||
[Header("Nuclear Diagnostic (Siêu chẩn đoán)")]
|
||||
public string forcePlayState = ""; // Gõ tên State vào đây để ép nó chạy (vd: Idle)
|
||||
public bool showLayerWeights = false;
|
||||
|
||||
protected virtual void Start()
|
||||
{
|
||||
animator = GetComponentInChildren<Animator>();
|
||||
@@ -81,45 +85,57 @@ public class AnimatorAI : MonoBehaviour
|
||||
return;
|
||||
}
|
||||
|
||||
// CHẨN ĐOÁN SÂU:
|
||||
if (debugMode) StartCoroutine(DeepDiagnosticRoutine());
|
||||
// Chạy chẩn đoán hạt nhân
|
||||
StartCoroutine(NuclearDiagnosticRoutine());
|
||||
|
||||
InitializeParameters();
|
||||
}
|
||||
|
||||
private IEnumerator DeepDiagnosticRoutine()
|
||||
private IEnumerator NuclearDiagnosticRoutine()
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
yield return new WaitForSeconds(2f); // Kiểm tra mỗi 2 giây
|
||||
yield return new WaitForSeconds(1f);
|
||||
|
||||
if (animator == null) yield break;
|
||||
|
||||
// 1. Kiểm tra Avatar
|
||||
if (animator.avatar == null)
|
||||
Debug.LogError($"<color=red>[T-POSE ALERT]</color> {animator.gameObject.name} KHÔNG CÓ AVATAR! Đây là lý do bị T-Pose. Hãy kéo Avatar vào component Animator.");
|
||||
|
||||
// 2. Kiểm tra Speed
|
||||
if (animator.speed <= 0)
|
||||
Debug.LogWarning($"<color=yellow>[T-POSE ALERT]</color> Tốc độ Animator đang bằng {animator.speed}. Nhân vật sẽ không cử động.");
|
||||
// 1. Kiểm tra Enabled
|
||||
if (!animator.enabled)
|
||||
Debug.LogError($"<color=red>[NUCLEAR ALERT]</color> Component Animator đang bị TẮT (enabled = false)!");
|
||||
|
||||
// 3. Kiểm tra Animation Clips
|
||||
var stateInfo = animator.GetCurrentAnimatorStateInfo(0);
|
||||
var clipInfo = animator.GetCurrentAnimatorClipInfo(0);
|
||||
|
||||
if (clipInfo.Length == 0)
|
||||
// 2. Kiểm tra Rig Type
|
||||
if (animator.isHuman)
|
||||
Debug.Log($"<color=white>[Rig Info]</color> Rig là Humanoid. Hãy chắc chắn các Animation cũng là Humanoid.");
|
||||
else
|
||||
Debug.LogWarning($"<color=yellow>[Rig Info]</color> Rig là Generic/Legacy. Nếu bạn dùng Animation Humanoid nó sẽ không chạy.");
|
||||
|
||||
// 3. Kiểm tra Layer Weight
|
||||
if (showLayerWeights)
|
||||
{
|
||||
Debug.LogError($"<color=red>[T-POSE ALERT]</color> State hiện tại ({stateInfo.fullPathHash}) KHÔNG CÓ Clip animation nào! Hãy kéo file .anim vào ô Motion của State trong Animator Controller.");
|
||||
}
|
||||
|
||||
// 4. Kiểm tra Culling
|
||||
if (animator.cullingMode == AnimatorCullingMode.CullCompletely)
|
||||
{
|
||||
// Đôi khi Unity tự tắt animation nếu camera không nhìn thấy
|
||||
Debug.Log($"<color=white>[Info]</color> Culling Mode đang là CullCompletely. Nếu nhân vật ở xa có thể sẽ dừng animation.");
|
||||
for (int i = 0; i < animator.layerCount; i++)
|
||||
{
|
||||
Debug.Log($"Layer {i} ({animator.GetLayerName(i)}): Weight = {animator.GetLayerWeight(i)}");
|
||||
}
|
||||
}
|
||||
|
||||
if (!useSimulation) yield break; // Nếu không dùng simulation thì chỉ check 1 lần rồi thôi
|
||||
// 4. Ép chạy State nếu có yêu cầu
|
||||
if (!string.IsNullOrEmpty(forcePlayState))
|
||||
{
|
||||
Debug.Log($"<color=magenta>[Nuclear Force]</color> ÉP CHẠY STATE: {forcePlayState}");
|
||||
animator.Play(forcePlayState);
|
||||
forcePlayState = ""; // Reset sau khi chạy
|
||||
}
|
||||
|
||||
// 5. Kiểm tra vị trí xương (Nếu T-pose thì thường xương không đổi vị trí)
|
||||
Vector3 handPos = animator.GetBoneTransform(HumanBodyBones.RightHand) ? animator.GetBoneTransform(HumanBodyBones.RightHand).position : Vector3.zero;
|
||||
yield return new WaitForSeconds(0.1f);
|
||||
if (handPos != Vector3.zero && Vector3.Distance(handPos, animator.GetBoneTransform(HumanBodyBones.RightHand).position) < 0.001f && animator.speed > 0)
|
||||
{
|
||||
// Nếu xương không nhúc nhích dù tốc độ > 0
|
||||
Debug.LogWarning($"<color=red>[NUCLEAR ALERT]</color> CẢNH BÁO: Xương nhân vật không nhúc nhích! Có thể do Rig lỗi hoặc bị script khác khóa xương.");
|
||||
}
|
||||
|
||||
if (!useSimulation) yield break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user