Compare commits

2 Commits

Author SHA1 Message Date
78692b6820 Merge branch 'main' of https://scove-vault.duckdns.org/scove/HALLUCINATION 2026-06-06 00:39:34 +07:00
9540528203 được sơ sơ 2026-06-06 00:37:41 +07:00
5 changed files with 126 additions and 492 deletions

View File

@@ -6,9 +6,10 @@
<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/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/EnemyAI.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/AI NPC/EnemyAI.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Third Parties/TextMesh Pro/Resources/Fonts &amp; Materials/LiberationSans SDF - Fallback.asset" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Third Parties/TextMesh Pro/Resources/Fonts &amp; Materials/LiberationSans SDF - Fallback.asset" 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/Prefabs/Shooter/Player/vShooterMelee_Inventory.prefab" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Prefabs/Shooter/Player/vShooterMelee_Inventory.prefab" 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/Scripts/AI NPC/KamikazeAI.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/AI NPC/KamikazeAI.cs" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -73,7 +74,7 @@
}</component>
<component name="RunManager" selected="Attach to Unity Editor.Attach to Unity Editor">
<configuration name="Standalone Player" type="RunUnityExe" factoryName="Unity Executable">
<option name="EXE_PATH" value="$PROJECT_DIR$/Build\HALLUCINATE.exe" />
<option name="EXE_PATH" value="$PROJECT_DIR$/../Build test\HALLUCINATE.exe" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="D:\BAI MUTIPLAY" />
<option name="PASS_PARENT_ENVS" value="1" />
@@ -102,7 +103,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" />
@@ -113,6 +114,7 @@
<option name="selectedOptions">
<list />
</option>
<option name="useMixedMode" value="false" />
<method v="2" />
</configuration>
<configuration name="Attach to" type="UnityDevicePlayer" factoryName="UnityAttachToDevicePlayer">
@@ -178,7 +180,8 @@
<workItem from="1780364354282" duration="4357000" />
<workItem from="1780409218377" duration="9852000" />
<workItem from="1780494322686" duration="643000" />
<workItem from="1780633654231" duration="29762000" />
<workItem from="1780633654231" duration="23904000" />
<workItem from="1780674685197" duration="1960000" />
</task>
<servers />
</component>

View File

@@ -11,7 +11,7 @@ GameObject:
- component: {fileID: 6775114823217050358}
- component: {fileID: 4848796683983860819}
- component: {fileID: 1063752242239153259}
m_Layer: 9
m_Layer: 5
m_Name: Image
m_TagString: Untagged
m_Icon: {fileID: 0}
@@ -89,7 +89,7 @@ GameObject:
- component: {fileID: 1194338186308686302}
- component: {fileID: 1620994605374968907}
- component: {fileID: 3045503552244378433}
m_Layer: 9
m_Layer: 5
m_Name: Canvas
m_TagString: Untagged
m_Icon: {fileID: 0}
@@ -219,13 +219,13 @@ GameObject:
- component: {fileID: 2937726564081786020}
- component: {fileID: 8396699406453661974}
- component: {fileID: 5807828578023492633}
m_Layer: 9
m_Layer: 0
m_Name: Cube
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!4 &5863061020199015852
Transform:
m_ObjectHideFlags: 0
@@ -235,7 +235,7 @@ Transform:
m_GameObject: {fileID: 5687887011233860168}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.002, y: 1.5, z: 0.514}
m_LocalPosition: {x: 0.041, y: 1.5, z: -0.007}
m_LocalScale: {x: 0.05, y: 0.05, z: 0.05}
m_ConstrainProportionsScale: 1
m_Children: []
@@ -330,7 +330,7 @@ GameObject:
- component: {fileID: 2685789783496722106}
- component: {fileID: 6402235304255896193}
- component: {fileID: 4454520411962799200}
m_Layer: 9
m_Layer: 5
m_Name: Text (TMP)
m_TagString: Untagged
m_Icon: {fileID: 0}
@@ -471,9 +471,7 @@ GameObject:
- component: {fileID: 8239948856752686218}
- component: {fileID: 6469822191588635990}
- component: {fileID: 9027690817715396964}
- component: {fileID: 204793640880232070}
- component: {fileID: 2997468006321853334}
m_Layer: 9
m_Layer: 0
m_Name: xNPC
m_TagString: Enemy
m_Icon: {fileID: 0}
@@ -514,8 +512,8 @@ MonoBehaviour:
moveSpeed: 3
rotateSpeed: 50
patrolWaitTime: 2
patrolSpeed: 2
patrolRadius: 5
patrolSpeed: 2.5
patrolRadius: 12
playerHasArtifact: 0
isAggroedBySound: 0
laserPrefab: {fileID: 3965388737199864462, guid: fbec2b501d70daa4c9cb481ba53fc0b8, type: 3}
@@ -525,17 +523,12 @@ MonoBehaviour:
dodgeForce: 8
dodgeDuration: 0.5
dodgeCooldown: 3
isPanicking: 0
isEnraged: 0
panicHealthThreshold: 40
regenRate: 2
regenDelay: 5
minStrafeDuration: 0.5
maxStrafeDuration: 2.2
maxSpreadAngle: 3
maxSpreadAngle: 6
burstInterval: 0.12
approachWeight: 1
minCombatDistance: 6
approachWeight: 0.35
minCombatDistance: 5
npcName: Guard
persona: You are a grumpy guard protecting gold.
talkRange: 5
@@ -623,14 +616,14 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7522161431095319480}
m_Enabled: 0
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 35bba55c2a743d042ab1fff35e29db50, type: 3}
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::AnimatorAI
sprintThreshold: 0.8
forceGrounded: 1
movementBoost: 1.5
dampTime: 0.1
groundDistanceValue: 0.05
--- !u!136 &9027690817715396964
CapsuleCollider:
m_ObjectHideFlags: 0
@@ -646,70 +639,14 @@ CapsuleCollider:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_IsTrigger: 1
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 2
m_Radius: 0.41056824
m_Radius: 0.37279892
m_Height: 1.8474874
m_Direction: 1
m_Center: {x: 0, y: 0.92911196, z: 0.061820984}
--- !u!114 &204793640880232070
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7522161431095319480}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f56a83ea88140fa4f869bb2f7ffdb184, type: 3}
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::Invector.vHealthController
openCloseEvents: 0
openCloseWindow: 1
selectedToolbar: 0
_isDead: 1
_currentHealth: 0
isImmortal: 0
fillHealthOnStart: 1
_maxHealth: 100
_healthRecovery: 0
_healthRecoveryDelay: 0
checkHealthEvents: []
_onStartReceiveDamage:
m_PersistentCalls:
m_Calls: []
_onReceiveDamage:
m_PersistentCalls:
m_Calls: []
_onDead:
m_PersistentCalls:
m_Calls: []
onChangeHealth:
m_PersistentCalls:
m_Calls: []
onResetHealth:
m_PersistentCalls:
m_Calls: []
--- !u!114 &2997468006321853334
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7522161431095319480}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9d3efef3ad62cd548b0f85eb11858ed1, type: 3}
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::Invector.vHitDamageParticle
openCloseEvents: 0
openCloseWindow: 1
selectedToolbar: 0
defaultDamageEffects:
- {fileID: 120346, guid: b8f2fe1ee1a01724cb72f5b0e6bd2eef, type: 3}
customDamageEffects: []
m_Center: {x: 0, y: 0.92911196, z: -0.24853802}
--- !u!1001 &7561534673732472622
PrefabInstance:
m_ObjectHideFlags: 0
@@ -718,278 +655,10 @@ PrefabInstance:
serializedVersion: 3
m_TransformParent: {fileID: 6442306242859885696}
m_Modifications:
- target: {fileID: 100000, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100004, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100006, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100008, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100010, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100012, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100014, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100016, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100018, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100022, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100024, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100026, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100030, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100032, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100034, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100038, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100040, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100042, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100046, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100048, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100050, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100054, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100056, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100058, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100062, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100064, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100066, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100068, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100070, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100072, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100074, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100076, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100078, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100082, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100084, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100086, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100090, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100092, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100094, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100098, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100100, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100102, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100106, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100108, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100110, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100114, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100116, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100118, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100122, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100124, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100126, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100128, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100132, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Name
value: V-bot@Highpoly
objectReference: {fileID: 0}
- target: {fileID: 100132, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100136, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100138, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100140, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100142, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100144, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100146, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100148, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100150, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100152, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100154, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100156, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100158, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100160, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 100162, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
- target: {fileID: 400132, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_LocalPosition.x
value: 0
@@ -1033,18 +702,18 @@ PrefabInstance:
- target: {fileID: 9500000, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Avatar
value:
objectReference: {fileID: 9000000, guid: 340f99b8334a14c4a8a01dce6e1e5348, type: 3}
objectReference: {fileID: 9000000, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
- target: {fileID: 9500000, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_Controller
value:
objectReference: {fileID: 9100000, guid: 87885946b43e2d1449e1d5aa2042f8a8, type: 2}
- target: {fileID: 9500000, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_UpdateMode
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9500000, guid: f32cd9f795c1282478d3bc3fbd8b2831, type: 3}
propertyPath: m_AnimatePhysics
value: 1
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []

View File

@@ -4197,6 +4197,11 @@ MonoBehaviour:
_spawnParticle: 1
_spawnStepMark: 1
_useTriggerEnter: 1
emitAINoise: 1
aiNoiseRange: 10
npcLayer:
serializedVersion: 2
m_Bits: 0
leftFootTrigger: {fileID: 11408204}
rightFootTrigger: {fileID: 11477308}
currentStep: {fileID: 0}

View File

@@ -3,97 +3,86 @@ using UnityEngine.AI;
using Invector;
using Invector.vEventSystems;
using System.Collections;
using System.Collections.Generic;
/// <summary>
/// AnimatorAI: Advanced Invector-style Animator synchronization for EnemyAI.
/// Resolves T-pose by ensuring all core Invector parameters are correctly synced.
/// </summary>
public class AnimatorAI : MonoBehaviour, vIAnimatorStateInfoController
{
protected Animator animator;
protected EnemyAI enemyAI;
protected NavMeshAgent agent;
protected Rigidbody rb;
protected vHealthController healthController;
protected EnemyAI enemyAI;
protected KamikazeAI kamikazeAI;
[Header("Movement Settings")]
public float sprintThreshold = 0.8f;
[Header("Force Settings")]
public bool forceGrounded = true;
public float movementBoost = 1.2f;
public float dampTime = 0.1f;
public float groundDistanceValue = 0.05f;
public vAnimatorStateInfos animatorStateInfos { get; protected set; }
#region Animator Parameters (Invector Style)
protected vAnimatorParameter isDead;
protected vAnimatorParameter isGrounded;
protected vAnimatorParameter isStrafing;
protected vAnimatorParameter isSprinting;
protected vAnimatorParameter isAiming;
protected vAnimatorParameter verticalVelocity;
protected vAnimatorParameter horizontalVelocity;
protected vAnimatorParameter groundDistance;
protected vAnimatorParameter moveSet_ID;
protected vAnimatorParameter attackID;
protected vAnimatorParameter hitDirection;
protected vAnimatorParameter reactionID;
protected vAnimatorParameter triggerReaction;
protected vAnimatorParameter resetState;
#region Animator Parameters
protected vAnimatorParameter isDead, isGrounded, isStrafing, isSprinting, isAiming;
protected vAnimatorParameter verticalVelocity, horizontalVelocity, inputMagnitude;
protected vAnimatorParameter groundDistance, moveSet_ID, attackID, triggerReaction, resetState;
#endregion
protected Vector3 lastPosition;
protected float currentV;
protected float currentH;
protected float currentV, currentH, currentMagnitude, calculatedSpeed;
protected virtual void Awake()
{
animator = GetComponentInChildren<Animator>();
enemyAI = GetComponent<EnemyAI>();
if (animator == null) animator = GetComponentInParent<Animator>();
agent = GetComponent<NavMeshAgent>();
rb = GetComponent<Rigidbody>();
healthController = GetComponent<vHealthController>();
if (agent == null) agent = GetComponentInParent<NavMeshAgent>();
healthController = GetComponentInChildren<vHealthController>();
enemyAI = GetComponent<EnemyAI>();
kamikazeAI = GetComponent<KamikazeAI>();
if (animator)
{
animator.applyRootMotion = false;
animator.updateMode = AnimatorUpdateMode.Normal;
// Reset all layers initially to prevent T-Pose
for (int i = 1; i < animator.layerCount; i++) animator.SetLayerWeight(i, 0f);
animatorStateInfos = new vAnimatorStateInfos(animator);
InitializeParameters();
Debug.Log($"<color=green>[AnimSystem]</color> Đã kích hoạt trên {gameObject.name}");
}
lastPosition = transform.position;
}
protected virtual void OnEnable()
{
this.Register();
if (healthController) healthController.onReceiveDamage.AddListener(OnReceiveDamage);
}
protected virtual void OnDisable()
{
this.UnRegister();
if (healthController) healthController.onReceiveDamage.RemoveListener(OnReceiveDamage);
}
protected virtual void OnEnable() { this.Register(); }
protected virtual void OnDisable() { this.UnRegister(); }
protected virtual void InitializeParameters()
{
isDead = new vAnimatorParameter(animator, "isDead");
isGrounded = new vAnimatorParameter(animator, "IsGrounded");
isStrafing = new vAnimatorParameter(animator, "IsStrafing");
isSprinting = new vAnimatorParameter(animator, "IsSprinting");
isAiming = new vAnimatorParameter(animator, "IsAiming");
verticalVelocity = new vAnimatorParameter(animator, "VerticalVelocity");
horizontalVelocity = new vAnimatorParameter(animator, "HorizontalVelocity");
groundDistance = new vAnimatorParameter(animator, "GroundDistance");
moveSet_ID = new vAnimatorParameter(animator, "MoveSet_ID");
attackID = new vAnimatorParameter(animator, "AttackID");
hitDirection = new vAnimatorParameter(animator, "HitDirection");
reactionID = new vAnimatorParameter(animator, "ReactionID");
triggerReaction = new vAnimatorParameter(animator, "TriggerReaction");
resetState = new vAnimatorParameter(animator, "ResetState");
isDead = ValidateAndInit("isDead");
isGrounded = ValidateAndInit("isGrounded");
if (!isGrounded.isValid) isGrounded = ValidateAndInit("IsGrounded");
isStrafing = ValidateAndInit("IsStrafing");
isSprinting = ValidateAndInit("IsSprinting");
isAiming = ValidateAndInit("IsAiming");
verticalVelocity = ValidateAndInit("InputVertical");
horizontalVelocity = ValidateAndInit("InputHorizontal");
inputMagnitude = ValidateAndInit("InputMagnitude");
groundDistance = ValidateAndInit("GroundDistance");
moveSet_ID = ValidateAndInit("MoveSet_ID");
attackID = ValidateAndInit("AttackID");
triggerReaction = ValidateAndInit("TriggerReaction");
resetState = ValidateAndInit("ResetState");
}
private vAnimatorParameter ValidateAndInit(string pName) => new vAnimatorParameter(animator, pName);
protected virtual void Update()
{
if (animator == null || enemyAI == null || agent == null) return;
if (animator == null || agent == null) return;
UpdateMovementParameters();
UpdateCombatParameters();
@@ -101,95 +90,63 @@ public class AnimatorAI : MonoBehaviour, vIAnimatorStateInfoController
protected virtual void UpdateMovementParameters()
{
// 1. Grounded & GroundDistance (Critical for T-pose prevention)
bool grounded = agent.isOnNavMesh || agent.enabled;
SetBool(isGrounded, grounded);
SetFloat(groundDistance, grounded ? 0f : groundDistanceValue);
SetBool(isGrounded, forceGrounded);
SetFloat(groundDistance, 0f);
// 2. Responsive Velocity Calculation
// Use a mix of agent velocity and position delta for better responsiveness
Vector3 worldVelocity = (transform.position - lastPosition) / Time.deltaTime;
Vector3 delta = transform.position - lastPosition;
calculatedSpeed = delta.magnitude / Time.deltaTime;
lastPosition = transform.position;
if (worldVelocity.magnitude < 0.01f) worldVelocity = Vector3.zero;
Vector3 localVel = transform.InverseTransformDirection(delta / Time.deltaTime);
Vector3 localVelocity = transform.InverseTransformDirection(worldVelocity);
float maxS = (enemyAI) ? enemyAI.moveSpeed : (kamikazeAI ? agent.speed : 3f);
if (maxS <= 0) maxS = 3f;
float targetV = localVelocity.z / enemyAI.moveSpeed;
float targetH = localVelocity.x / enemyAI.moveSpeed;
float targetV = (localVel.z / maxS) * movementBoost;
float targetH = (localVel.x / maxS) * movementBoost;
// Smooth velocity values
currentV = Mathf.Lerp(currentV, targetV, 10f * Time.deltaTime);
currentH = Mathf.Lerp(currentH, targetH, 10f * Time.deltaTime);
currentMagnitude = new Vector2(currentH, currentV).magnitude;
// ÉP GIÁ TRỊ VÀO ANIMATOR
SetFloat(verticalVelocity, currentV);
SetFloat(horizontalVelocity, currentH);
// 3. Sprinting
bool sprinting = worldVelocity.magnitude > (enemyAI.moveSpeed * sprintThreshold);
SetBool(isSprinting, sprinting);
// 4. Strafing
SetBool(isStrafing, enemyAI.playerHasArtifact);
SetFloat(inputMagnitude, currentMagnitude);
}
protected virtual void UpdateCombatParameters()
{
SetBool(isAiming, enemyAI.playerHasArtifact);
SetInt(moveSet_ID, enemyAI.playerHasArtifact ? 1 : 0);
// 1. Kiểm tra trạng thái AI
bool isShooting = (enemyAI && enemyAI.IsShootingBurst);
bool hasArtifact = (enemyAI && enemyAI.playerHasArtifact);
// Shooting burst
if (enemyAI.IsShootingBurst)
SetInt(attackID, 1);
// 2. Cập nhật MoveSet và Aiming
SetInt(moveSet_ID, hasArtifact ? 1 : 0);
SetBool(isAiming, hasArtifact);
SetBool(isStrafing, hasArtifact);
// 3. Xử lý BẮN SÚNG (Layer 6 trong Animator của bạn)
if (isShooting)
{
// Bật Layer bắn súng lên 1 (Smooth)
animator.SetLayerWeight(6, Mathf.Lerp(animator.GetLayerWeight(6), 1f, 15f * Time.deltaTime));
SetInt(attackID, 1); // Kích hoạt animation bắn trong Blend Tree của Layer 6
}
else
{
// Tắt Layer bắn súng về 0
animator.SetLayerWeight(6, Mathf.Lerp(animator.GetLayerWeight(6), 0f, 10f * Time.deltaTime));
SetInt(attackID, 0);
// Dodge logic
if (enemyAI.IsDodging)
{
// In Invector, dodges are often handled via triggers or specific IDs
SetAnimatorTrigger(triggerReaction);
}
// Death state
if (healthController) SetBool(isDead, healthController.isDead);
}
protected virtual void OnReceiveDamage(vDamage damage)
{
if (animator == null || !animator.enabled) return;
// Sync damage parameters for hit reactions
if (hitDirection.isValid && damage.sender)
{
float angle = transform.HitAngle(damage.sender.position);
animator.SetInteger(hitDirection, (int)angle);
}
if (reactionID.isValid) animator.SetInteger(reactionID, damage.reaction_id);
SetAnimatorTrigger(triggerReaction);
SetAnimatorTrigger(resetState);
if (enemyAI && enemyAI.IsDodging) SetAnimatorTrigger(triggerReaction);
}
#region Helpers
protected void SetBool(vAnimatorParameter param, bool value)
{
if (param.isValid && animator.GetBool(param) != value)
animator.SetBool(param, value);
}
protected void SetFloat(vAnimatorParameter param, float value)
{
if (param.isValid)
animator.SetFloat(param, value, dampTime, Time.deltaTime);
}
protected void SetInt(vAnimatorParameter param, int value)
{
if (param.isValid && animator.GetInteger(param) != value)
animator.SetInteger(param, value);
}
protected void SetBool(vAnimatorParameter p, bool v) { if (p.isValid) animator.SetBool(p, v); }
protected void SetFloat(vAnimatorParameter p, float v) { if (p.isValid) animator.SetFloat(p, v, dampTime, Time.deltaTime); }
protected void SetInt(vAnimatorParameter p, int v) { if (p.isValid) animator.SetInteger(p, v); }
public void SetAnimatorTrigger(vAnimatorParameter trigger)
{

View File

@@ -106,7 +106,7 @@ public class KamikazeAI : MonoBehaviour
// HÀM TUẦN TRA NGẪU NHIÊN MỚI
private NodeState ActionRandomPatrol()
{
Debug.Log("Wandering randomly...");
// Debug.Log("Wandering randomly...");
agent.isStopped = false;
agent.speed = patrolSpeed;