18 Commits

Author SHA1 Message Date
f70ddddf65 Update 2026-06-06 09:19:46 +07:00
75b005c691 update UI lose 2026-06-06 02:51:35 +07:00
3b24075a71 update 2026-06-06 02:36:43 +07:00
e7d8439412 linh tinh 2026-06-06 02:34:35 +07:00
af2713a00e Complete Update NPC AI 2026-06-06 02:03:22 +07:00
316a3f7760 Update 2026-06-06 00:54:47 +07:00
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
manhduyhoang90
a1e82db378 Merge branch 'main' of https://scove-vault.duckdns.org/scove/HALLUCINATION 2026-06-06 00:36:26 +07:00
manhduyhoang90
71d590d584 add background 2026-06-06 00:35:11 +07:00
e5a2fcfc44 Merge branch 'main' of https://scove-vault.duckdns.org/scove/HALLUCINATION 2026-06-06 00:33:23 +07:00
7409b0ca18 Update 2026-06-06 00:33:07 +07:00
manhduyhoang90
df6b8625c5 Merge branch 'main' of https://scove-vault.duckdns.org/scove/HALLUCINATION 2026-06-06 00:29:37 +07:00
manhduyhoang90
a7e07a007f Update ui 2026-06-06 00:25:02 +07:00
0580dd22b3 Merge branch 'main' of https://scove-vault.duckdns.org/scove/HALLUCINATION 2026-06-06 00:07:57 +07:00
6b4e3f1271 Update 2026-06-06 00:07:42 +07:00
manhduyhoang90
7e45faec11 Merge branch 'main' of https://scove-vault.duckdns.org/scove/HALLUCINATION 2026-06-06 00:02:35 +07:00
manhduyhoang90
763f933c2e update UI 2026-06-06 00:00:27 +07:00
37 changed files with 2695 additions and 1066 deletions

File diff suppressed because one or more lines are too long

View File

@@ -5,13 +5,12 @@
</component>
<component name="ChangeListManager">
<list default="true" id="f9183c68-daf0-43b8-be4c-fad79983f91b" name="Changes" comment="">
<change beforePath="$PROJECT_DIR$/.gemini-workspace-history/active-context.md" beforeDir="false" afterPath="$PROJECT_DIR$/.gemini-workspace-history/active-context.md" afterDir="false" />
<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/Prefabs/NPC/xNPC.prefab" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Prefabs/NPC/xNPC.prefab" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Prefabs/Shooter/Weapon/_bullets/vGrenadeRifle.prefab" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Prefabs/Shooter/Weapon/_bullets/vGrenadeRifle.prefab" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Prefabs/Shooter/Weapon/_weapons_WITH_Inventory/_ammo/vAmmoHandgun_Inventory.prefab" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Prefabs/Shooter/Weapon/_weapons_WITH_Inventory/_ammo/vAmmoHandgun_Inventory.prefab" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Prefabs/Shooter/Weapon/_weapons_WITH_Inventory/_weaponsPrefabs/vHandgun_Inventory.prefab" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Prefabs/Shooter/Weapon/_weapons_WITH_Inventory/_weaponsPrefabs/vHandgun_Inventory.prefab" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Scenes/Cho môn AI/Only AI/NavMesh-NavManager 1.asset" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scenes/Cho môn AI/Only AI/NavMesh-NavManager 1.asset" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Scripts/Player/Weapon/vProjectileControl.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/Player/Weapon/vProjectileControl.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Prefabs/projectile/_LazerPrọectile.prefab" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Prefabs/projectile/_LazerPrọectile.prefab" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Scripts/AI NPC/LaserProjectile.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/AI NPC/LaserProjectile.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Scripts/AI NPC/RagNPC.cs" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Scripts/AI NPC/RagNPC.cs.meta" beforeDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -19,7 +18,7 @@
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="EmbeddingIndexingInfo">
<option name="cachedIndexableFilesCount" value="77" />
<option name="cachedIndexableFilesCount" value="78" />
<option name="fileBasedEmbeddingIndicesEnabled" value="true" />
</component>
<component name="Git.Settings">
@@ -181,7 +180,9 @@
<workItem from="1780364354282" duration="4357000" />
<workItem from="1780409218377" duration="9852000" />
<workItem from="1780494322686" duration="643000" />
<workItem from="1780633654231" duration="26606000" />
<workItem from="1780633654231" duration="23904000" />
<workItem from="1780674685197" duration="1960000" />
<workItem from="1780709383381" duration="1351000" />
</task>
<servers />
</component>

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: ebed31fbd0a3be4499c2fe54022858b7
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,23 @@
fileFormatVersion: 2
guid: 5a569249b0485d347a698461b0334585
AudioImporter:
externalObjects: {}
serializedVersion: 8
defaultSettings:
serializedVersion: 2
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
preloadAudioData: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -5218,9 +5218,9 @@ Material:
- _OutlineWidth: 0
- _PerspectiveFilter: 0.875
- _Reflectivity: 10
- _ScaleRatioA: 1
- _ScaleRatioB: 1
- _ScaleRatioC: 1
- _ScaleRatioA: 0.9
- _ScaleRatioB: 0.73125
- _ScaleRatioC: 0.73125
- _ScaleX: 1
- _ScaleY: 1
- _ShaderFlags: 0

144
Assets/Materials/skubox.mat Normal file
View File

@@ -0,0 +1,144 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-6888318783798700149
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Editor::UnityEditor.Rendering.Universal.AssetVersion
version: 10
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: skubox
m_Shader: {fileID: 108, guid: 0000000000000000f000000000000000, type: 0}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords:
- _MAPPING_LATITUDE_LONGITUDE_LAYOUT
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses:
- MOTIONVECTORS
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: f6c8ebeb4fbe2954ba666fb8de1138f1, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AddPrecomputedVelocity: 0
- _AlphaClip: 0
- _AlphaToMask: 0
- _Blend: 0
- _BlendModePreserveSpecular: 1
- _BumpScale: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _DstBlendAlpha: 0
- _EnvironmentReflections: 1
- _Exposure: 1
- _GlossMapScale: 0
- _Glossiness: 0
- _GlossyReflections: 0
- _ImageType: 0
- _Layout: 0
- _Mapping: 1
- _Metallic: 0
- _MirrorOnBack: 0
- _OcclusionStrength: 1
- _Parallax: 0.005
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Rotation: 0
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _Surface: 0
- _WorkflowMode: 1
- _XRMotionVectorsPass: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
- _Tint: {r: 0.5, g: 0.5, b: 0.5, a: 0.5}
m_BuildTextureStacks: []
m_AllowLocking: 1

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7adfd3fc58213974581401c16602cb05
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -37,6 +37,7 @@ Material:
disabledShaderPasses:
- MOTIONVECTORS
- DepthOnly
- SHADOWCASTER
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
@@ -66,7 +67,7 @@ Material:
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Texture: {fileID: 2800000, guid: 2b09e034ca4296047993ed266a80d617, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:

View File

@@ -132,7 +132,7 @@ Material:
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 0.066176444, g: 0.066176444, b: 0.066176444, a: 0.9338235}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 0.06617642, g: 0.06617642, b: 0.06617642, a: 0.9338235}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []

View File

@@ -14,6 +14,7 @@ GameObject:
- component: {fileID: 6087599376744356948}
- component: {fileID: 3563399533700019190}
- component: {fileID: 681314853465352057}
- component: {fileID: 4042483058127329834}
m_Layer: 0
m_Name: KamikazeAI
m_TagString: Untagged
@@ -155,3 +156,41 @@ MonoBehaviour:
patrolRadius: 12
patrolWaitTime: 2
explosionEffectPrefab: {fileID: 8568474719719117872, guid: 39bf32dcd9299df4ca44fd10a817eda4, type: 3}
--- !u!114 &4042483058127329834
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6425756872251228809}
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: []

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: 0
m_IsActive: 1
--- !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.041, y: 1.5, z: -0.007}
m_LocalPosition: {x: 0.041, y: 1.5, z: 0.595}
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,8 +471,9 @@ GameObject:
- component: {fileID: 8239948856752686218}
- component: {fileID: 6469822191588635990}
- component: {fileID: 9027690817715396964}
- component: {fileID: 204793640880232070}
m_Layer: 9
- component: {fileID: 2252266660326254214}
- component: {fileID: 4329414276869835007}
m_Layer: 0
m_Name: xNPC
m_TagString: Enemy
m_Icon: {fileID: 0}
@@ -510,22 +511,28 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::EnemyAI
player: {fileID: 0}
moveSpeed: 3
rotateSpeed: 50
moveSpeed: 5
rotateSpeed: 20
patrolWaitTime: 2
patrolSpeed: 2
patrolRadius: 5
patrolRadius: 100
playerHasArtifact: 0
isAggroedBySound: 0
laserPrefab: {fileID: 3965388737199864462, guid: fbec2b501d70daa4c9cb481ba53fc0b8, type: 3}
firePoint: {fileID: 5863061020199015852}
minShootDelay: 1
maxShootDelay: 5
dodgeForce: 8
dodgeForce: 3
dodgeDuration: 0.5
dodgeCooldown: 3
dodgeCooldown: 2
isPanicking: 0
isEnraged: 0
panicHealthThreshold: 40
regenRate: 2
regenDelay: 2
minStrafeDuration: 0.5
maxStrafeDuration: 2.2
maxSpreadAngle: 6
maxSpreadAngle: 10
burstInterval: 0.12
approachWeight: 0.35
minCombatDistance: 5
@@ -616,23 +623,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
debugMode: 1
debugColor: {r: 1, g: 0, b: 0.21842146, a: 1}
useSimulation: 0
autoCycleSpeed: 0
simVerticalVelocity: 0
simIsSprinting: 0
simIsAiming: 0
simMoveSetID: 0
sprintThreshold: 0.8
forceGrounded: 1
movementBoost: 1.5
dampTime: 0.1
forcePlayState:
showLayerWeights: 0
--- !u!136 &9027690817715396964
CapsuleCollider:
m_ObjectHideFlags: 0
@@ -652,11 +650,11 @@ CapsuleCollider:
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 2
m_Radius: 0.37279892
m_Radius: 0.4324358
m_Height: 1.8474874
m_Direction: 1
m_Center: {x: 0, y: 0.92911196, z: -0.24853802}
--- !u!114 &204793640880232070
m_Center: {x: 0, y: 0.92911196, z: 0.11156863}
--- !u!114 &2252266660326254214
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
@@ -694,6 +692,24 @@ MonoBehaviour:
onResetHealth:
m_PersistentCalls:
m_Calls: []
--- !u!114 &4329414276869835007
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: []
--- !u!1001 &7561534673732472622
PrefabInstance:
m_ObjectHideFlags: 0
@@ -702,278 +718,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
@@ -1017,18 +765,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

@@ -27,12 +27,13 @@ Transform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1178214796800900241}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0.076, z: 0.124}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1804537267582578112}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!135 &1178214796804358001
SphereCollider:
@@ -42,9 +43,17 @@ SphereCollider:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1178214796800900241}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 1
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 2
serializedVersion: 3
m_Radius: 0.5
m_Center: {x: 0, y: 0, z: 0}
--- !u!114 &1178214796806424509
@@ -83,6 +92,7 @@ MonoBehaviour:
inputDelay: 0.1
playAnimationWhileHoldingButton: 1
doubleButtomTime: 0.25
canDoAction: 1
actionName: Action
actionTag: Action
disableOnStart: 0
@@ -96,6 +106,7 @@ MonoBehaviour:
customCameraState: Default
playAnimation:
crossFadeTransition: 0.25
animatorLayer: 0
endActionManualy: 0
endExitTimeAnimation: 0.8
animatorActionState: 0
@@ -238,6 +249,7 @@ MonoBehaviour:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1178214796800926091}
m_TargetAssemblyTypeName:
m_MethodName: SetActive
m_Mode: 6
m_Arguments:
@@ -252,6 +264,7 @@ MonoBehaviour:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1178214796800926091}
m_TargetAssemblyTypeName:
m_MethodName: SetActive
m_Mode: 6
m_Arguments:
@@ -262,6 +275,9 @@ MonoBehaviour:
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
OnCancelAction:
m_PersistentCalls:
m_Calls: []
targetEquipPoint:
twoHandWeapon: 1
weapon: {fileID: 1804537267582261728}
@@ -271,6 +287,7 @@ MonoBehaviour:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1178214796800926091}
m_TargetAssemblyTypeName:
m_MethodName: SetActive
m_Mode: 6
m_Arguments:
@@ -282,6 +299,7 @@ MonoBehaviour:
m_BoolArgument: 0
m_CallState: 2
- m_Target: {fileID: 1830727322889391579}
m_TargetAssemblyTypeName:
m_MethodName: set_enabled
m_Mode: 6
m_Arguments:
@@ -296,6 +314,7 @@ MonoBehaviour:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1830727322889391579}
m_TargetAssemblyTypeName:
m_MethodName: set_enabled
m_Mode: 6
m_Arguments:
@@ -344,6 +363,7 @@ MonoBehaviour:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 8342309185592125983}
m_TargetAssemblyTypeName:
m_MethodName: SetActive
m_Mode: 6
m_Arguments:
@@ -355,6 +375,7 @@ MonoBehaviour:
m_BoolArgument: 0
m_CallState: 2
- m_Target: {fileID: 1770855500603019112}
m_TargetAssemblyTypeName:
m_MethodName: InstantiateObject
m_Mode: 1
m_Arguments:
@@ -371,6 +392,7 @@ MonoBehaviour:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 8342309185592125983}
m_TargetAssemblyTypeName:
m_MethodName: SetActive
m_Mode: 6
m_Arguments:
@@ -387,6 +409,7 @@ MonoBehaviour:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 0}
m_TargetAssemblyTypeName:
m_MethodName: SetActive
m_Mode: 6
m_Arguments:
@@ -425,9 +448,9 @@ RectTransform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1178214796814376033}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 0, y: 0.5}
@@ -457,6 +480,7 @@ MonoBehaviour:
m_Material: {fileID: 2100000, guid: a33be1e1efa8ca14286b77d062313a4e, type: 2}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
@@ -502,10 +526,10 @@ RectTransform:
m_LocalRotation: {x: -0, y: -0, z: -0.2619354, w: 0.9650854}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.0013280489, y: 0.0013280488, z: 0.0013280488}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1178214796814376033}
m_Father: {fileID: 1804537267582578112}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
@@ -529,7 +553,9 @@ Canvas:
m_OverrideSorting: 0
m_OverridePixelPerfect: 0
m_SortingBucketNormalizedSize: 0
m_VertexColorAlwaysGammaSpace: 0
m_AdditionalShaderChannelsFlag: 25
m_UpdateRectTransformForStandalone: 0
m_SortingLayerID: 0
m_SortingOrder: 0
m_TargetDisplay: 0
@@ -555,6 +581,7 @@ MonoBehaviour:
m_FallbackScreenDPI: 96
m_DefaultSpriteDPI: 96
m_DynamicPixelsPerUnit: 1
m_PresetInfoIsWorld: 0
--- !u!114 &1178214796806402205
MonoBehaviour:
m_ObjectHideFlags: 0
@@ -636,9 +663,9 @@ RectTransform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1178214796814376033}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
@@ -668,6 +695,7 @@ MonoBehaviour:
m_Material: {fileID: 2100000, guid: a33be1e1efa8ca14286b77d062313a4e, type: 2}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
@@ -715,12 +743,12 @@ RectTransform:
m_LocalRotation: {x: 0, y: -1, z: 0, w: 0.00000041723246}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1178214796814260335}
- {fileID: 1178214796814260911}
- {fileID: 1178214796814384871}
m_Father: {fileID: 1178214796814369163}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
@@ -750,6 +778,7 @@ MonoBehaviour:
m_Material: {fileID: 2100000, guid: a33be1e1efa8ca14286b77d062313a4e, type: 2}
m_Color: {r: 0, g: 0, b: 0, a: 0.627451}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
@@ -780,6 +809,7 @@ MonoBehaviour:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1178214796800906329}
m_TargetAssemblyTypeName:
m_MethodName: SetActive
m_Mode: 6
m_Arguments:
@@ -791,6 +821,7 @@ MonoBehaviour:
m_BoolArgument: 0
m_CallState: 2
- m_Target: {fileID: 1178214796801013577}
m_TargetAssemblyTypeName:
m_MethodName: SetActive
m_Mode: 6
m_Arguments:
@@ -808,6 +839,7 @@ MonoBehaviour:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1178214796800906329}
m_TargetAssemblyTypeName:
m_MethodName: SetActive
m_Mode: 6
m_Arguments:
@@ -819,6 +851,7 @@ MonoBehaviour:
m_BoolArgument: 1
m_CallState: 2
- m_Target: {fileID: 1178214796801013577}
m_TargetAssemblyTypeName:
m_MethodName: SetActive
m_Mode: 6
m_Arguments:
@@ -857,9 +890,9 @@ RectTransform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1178214796814376033}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 0, y: 0.5}
@@ -889,6 +922,7 @@ MonoBehaviour:
m_Material: {fileID: 2100000, guid: a33be1e1efa8ca14286b77d062313a4e, type: 2}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
@@ -903,40 +937,12 @@ MonoBehaviour:
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!54 &5753856815630206312
Rigidbody:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1804537267582261728}
serializedVersion: 2
m_Mass: 1
m_Drag: 0
m_AngularDrag: 0.05
m_UseGravity: 1
m_IsKinematic: 0
m_Interpolate: 0
m_Constraints: 0
m_CollisionDetection: 0
--- !u!65 &6470183431665213616
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1804537267582261728}
m_Material: {fileID: 13400000, guid: c77abc477d4de2a4197e1f08cebc364e, type: 2}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 0.11955705, y: 0.17964685, z: 0.85108244}
m_Center: {x: -0.0013062507, y: 0.054864466, z: 0.13716096}
--- !u!1001 &1804537267582149120
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 130016, guid: 95173cd142940384c81611787936f938, type: 3}
@@ -991,20 +997,32 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 11429992, guid: 95173cd142940384c81611787936f938, type: 3}
propertyPath: selectedToolbar
value: 2
objectReference: {fileID: 0}
m_RemovedComponents:
- {fileID: 114382262437889658, guid: 95173cd142940384c81611787936f938, type: 3}
- {fileID: 3978637271864031997, guid: 95173cd142940384c81611787936f938, type: 3}
m_RemovedGameObjects: []
m_AddedGameObjects:
- targetCorrespondingSourceObject: {fileID: 430016, guid: 95173cd142940384c81611787936f938, type: 3}
insertIndex: -1
addedObject: {fileID: 1178214796814369163}
- targetCorrespondingSourceObject: {fileID: 430016, guid: 95173cd142940384c81611787936f938, type: 3}
insertIndex: -1
addedObject: {fileID: 1178214796800604863}
m_AddedComponents:
- targetCorrespondingSourceObject: {fileID: 130016, guid: 95173cd142940384c81611787936f938, type: 3}
insertIndex: -1
addedObject: {fileID: 5753856815630206312}
- targetCorrespondingSourceObject: {fileID: 130016, guid: 95173cd142940384c81611787936f938, type: 3}
insertIndex: -1
addedObject: {fileID: 6470183431665213616}
m_SourcePrefab: {fileID: 100100000, guid: 95173cd142940384c81611787936f938, type: 3}
--- !u!4 &1804537267582578112 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 430016, guid: 95173cd142940384c81611787936f938,
type: 3}
m_PrefabInstance: {fileID: 1804537267582149120}
m_PrefabAsset: {fileID: 0}
--- !u!114 &1770855500603019112 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 114937068035861864, guid: 95173cd142940384c81611787936f938,
type: 3}
m_CorrespondingSourceObject: {fileID: 114937068035861864, guid: 95173cd142940384c81611787936f938, type: 3}
m_PrefabInstance: {fileID: 1804537267582149120}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
@@ -1013,15 +1031,66 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: de8c6f6fb33efc547afa68f68e220d74, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &8342309185592125983 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 7696325297335060511, guid: 95173cd142940384c81611787936f938,
type: 3}
m_PrefabInstance: {fileID: 1804537267582149120}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1804537267582261728 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 130016, guid: 95173cd142940384c81611787936f938,
type: 3}
m_CorrespondingSourceObject: {fileID: 130016, guid: 95173cd142940384c81611787936f938, type: 3}
m_PrefabInstance: {fileID: 1804537267582149120}
m_PrefabAsset: {fileID: 0}
--- !u!54 &5753856815630206312
Rigidbody:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1804537267582261728}
serializedVersion: 5
m_Mass: 1
m_LinearDamping: 0
m_AngularDamping: 0.05
m_CenterOfMass: {x: 0, y: 0, z: 0}
m_InertiaTensor: {x: 1, y: 1, z: 1}
m_InertiaRotation: {x: 0, y: 0, z: 0, w: 1}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_ImplicitCom: 1
m_ImplicitTensor: 1
m_UseGravity: 1
m_IsKinematic: 0
m_Interpolate: 0
m_Constraints: 0
m_CollisionDetection: 0
--- !u!65 &6470183431665213616
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1804537267582261728}
m_Material: {fileID: 13400000, guid: c77abc477d4de2a4197e1f08cebc364e, type: 2}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 3
m_Size: {x: 0.11955705, y: 0.17964685, z: 0.85108244}
m_Center: {x: -0.0013062507, y: 0.054864466, z: 0.13716096}
--- !u!4 &1804537267582578112 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 430016, guid: 95173cd142940384c81611787936f938, type: 3}
m_PrefabInstance: {fileID: 1804537267582149120}
m_PrefabAsset: {fileID: 0}
--- !u!1 &8342309185592125983 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 7696325297335060511, guid: 95173cd142940384c81611787936f938, type: 3}
m_PrefabInstance: {fileID: 1804537267582149120}
m_PrefabAsset: {fileID: 0}

View File

@@ -1,34 +1,5 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!54 &4054124028099797856
Rigidbody:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4881589711078705830}
serializedVersion: 2
m_Mass: 1
m_Drag: 0
m_AngularDrag: 0.05
m_UseGravity: 1
m_IsKinematic: 0
m_Interpolate: 0
m_Constraints: 0
m_CollisionDetection: 0
--- !u!65 &7941838468431302446
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4881589711078705830}
m_Material: {fileID: 13400000, guid: c77abc477d4de2a4197e1f08cebc364e, type: 2}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 0.12160286, y: 0.2082051, z: 0.32264447}
m_Center: {x: 0.021650568, y: 0.006185949, z: 0.103613794}
--- !u!1 &7903731139681717537
GameObject:
m_ObjectHideFlags: 0
@@ -55,12 +26,13 @@ Transform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7903731139681717537}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0.056, z: 0.087}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 4881589711078555334}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!135 &7903731139668604497
SphereCollider:
@@ -70,9 +42,17 @@ SphereCollider:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7903731139681717537}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 1
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 2
serializedVersion: 3
m_Radius: 0.5
m_Center: {x: 0, y: 0, z: 0}
--- !u!114 &7903731139670676279
@@ -111,6 +91,7 @@ MonoBehaviour:
inputDelay: 0.1
playAnimationWhileHoldingButton: 1
doubleButtomTime: 0.25
canDoAction: 1
actionName: Action
actionTag: Action
disableOnStart: 0
@@ -124,6 +105,7 @@ MonoBehaviour:
customCameraState: Default
playAnimation:
crossFadeTransition: 0.25
animatorLayer: 0
endActionManualy: 0
endExitTimeAnimation: 0.8
animatorActionState: 0
@@ -266,6 +248,7 @@ MonoBehaviour:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 7903731139681943551}
m_TargetAssemblyTypeName:
m_MethodName: SetActive
m_Mode: 6
m_Arguments:
@@ -280,6 +263,7 @@ MonoBehaviour:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 7903731139681943551}
m_TargetAssemblyTypeName:
m_MethodName: SetActive
m_Mode: 6
m_Arguments:
@@ -290,6 +274,9 @@ MonoBehaviour:
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
OnCancelAction:
m_PersistentCalls:
m_Calls: []
targetEquipPoint:
twoHandWeapon: 1
weapon: {fileID: 4881589711078705830}
@@ -299,6 +286,7 @@ MonoBehaviour:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 7903731139681943551}
m_TargetAssemblyTypeName:
m_MethodName: SetActive
m_Mode: 6
m_Arguments:
@@ -356,12 +344,12 @@ RectTransform:
m_LocalRotation: {x: 0, y: -1, z: 0, w: 0.00000041723246}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 7903731139695343497}
- {fileID: 7903731139695326533}
- {fileID: 7903731139695282545}
m_Father: {fileID: 7903731139695313889}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
@@ -391,6 +379,7 @@ MonoBehaviour:
m_Material: {fileID: 2100000, guid: a33be1e1efa8ca14286b77d062313a4e, type: 2}
m_Color: {r: 0, g: 0, b: 0, a: 0.627451}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
@@ -421,6 +410,7 @@ MonoBehaviour:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 7903731139681958997}
m_TargetAssemblyTypeName:
m_MethodName: SetActive
m_Mode: 6
m_Arguments:
@@ -432,6 +422,7 @@ MonoBehaviour:
m_BoolArgument: 0
m_CallState: 2
- m_Target: {fileID: 7903731139681936937}
m_TargetAssemblyTypeName:
m_MethodName: SetActive
m_Mode: 6
m_Arguments:
@@ -449,6 +440,7 @@ MonoBehaviour:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 7903731139681958997}
m_TargetAssemblyTypeName:
m_MethodName: SetActive
m_Mode: 6
m_Arguments:
@@ -460,6 +452,7 @@ MonoBehaviour:
m_BoolArgument: 1
m_CallState: 2
- m_Target: {fileID: 7903731139681936937}
m_TargetAssemblyTypeName:
m_MethodName: SetActive
m_Mode: 6
m_Arguments:
@@ -498,9 +491,9 @@ RectTransform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 7903731139695298027}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
@@ -530,6 +523,7 @@ MonoBehaviour:
m_Material: {fileID: 2100000, guid: a33be1e1efa8ca14286b77d062313a4e, type: 2}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
@@ -576,9 +570,9 @@ RectTransform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 7903731139695298027}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 0, y: 0.5}
@@ -608,6 +602,7 @@ MonoBehaviour:
m_Material: {fileID: 2100000, guid: a33be1e1efa8ca14286b77d062313a4e, type: 2}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
@@ -653,10 +648,10 @@ RectTransform:
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.0013280489, y: 0.0013280488, z: 0.0013280488}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 7903731139695298027}
m_Father: {fileID: 4881589711078555334}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
@@ -680,7 +675,9 @@ Canvas:
m_OverrideSorting: 0
m_OverridePixelPerfect: 0
m_SortingBucketNormalizedSize: 0
m_VertexColorAlwaysGammaSpace: 0
m_AdditionalShaderChannelsFlag: 25
m_UpdateRectTransformForStandalone: 0
m_SortingLayerID: 0
m_SortingOrder: 0
m_TargetDisplay: 0
@@ -706,6 +703,7 @@ MonoBehaviour:
m_FallbackScreenDPI: 96
m_DefaultSpriteDPI: 96
m_DynamicPixelsPerUnit: 1
m_PresetInfoIsWorld: 0
--- !u!114 &7903731139670638581
MonoBehaviour:
m_ObjectHideFlags: 0
@@ -787,9 +785,9 @@ RectTransform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 7903731139695298027}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 0, y: 0.5}
@@ -819,6 +817,7 @@ MonoBehaviour:
m_Material: {fileID: 2100000, guid: a33be1e1efa8ca14286b77d062313a4e, type: 2}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
@@ -838,6 +837,7 @@ PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 170828, guid: a0ef3c70b27799d409935f45a6537bb0, type: 3}
@@ -892,19 +892,88 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 11470846, guid: a0ef3c70b27799d409935f45a6537bb0, type: 3}
propertyPath: hitLayer.m_Bits
value: 4294967295
objectReference: {fileID: 0}
- target: {fileID: 11470846, guid: a0ef3c70b27799d409935f45a6537bb0, type: 3}
propertyPath: selectedToolbar
value: 2
objectReference: {fileID: 0}
m_RemovedComponents:
- {fileID: 114790386807353386, guid: a0ef3c70b27799d409935f45a6537bb0, type: 3}
- {fileID: 114554122684540132, guid: a0ef3c70b27799d409935f45a6537bb0, type: 3}
m_RemovedGameObjects: []
m_AddedGameObjects:
- targetCorrespondingSourceObject: {fileID: 470828, guid: a0ef3c70b27799d409935f45a6537bb0, type: 3}
insertIndex: -1
addedObject: {fileID: 7903731139695313889}
- targetCorrespondingSourceObject: {fileID: 470828, guid: a0ef3c70b27799d409935f45a6537bb0, type: 3}
insertIndex: -1
addedObject: {fileID: 7903731139681598825}
m_AddedComponents:
- targetCorrespondingSourceObject: {fileID: 170828, guid: a0ef3c70b27799d409935f45a6537bb0, type: 3}
insertIndex: -1
addedObject: {fileID: 4054124028099797856}
- targetCorrespondingSourceObject: {fileID: 170828, guid: a0ef3c70b27799d409935f45a6537bb0, type: 3}
insertIndex: -1
addedObject: {fileID: 7941838468431302446}
m_SourcePrefab: {fileID: 100100000, guid: a0ef3c70b27799d409935f45a6537bb0, type: 3}
--- !u!4 &4881589711078555334 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 470828, guid: a0ef3c70b27799d409935f45a6537bb0,
type: 3}
m_CorrespondingSourceObject: {fileID: 470828, guid: a0ef3c70b27799d409935f45a6537bb0, type: 3}
m_PrefabInstance: {fileID: 4881589711078871530}
m_PrefabAsset: {fileID: 0}
--- !u!1 &4881589711078705830 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 170828, guid: a0ef3c70b27799d409935f45a6537bb0,
type: 3}
m_CorrespondingSourceObject: {fileID: 170828, guid: a0ef3c70b27799d409935f45a6537bb0, type: 3}
m_PrefabInstance: {fileID: 4881589711078871530}
m_PrefabAsset: {fileID: 0}
--- !u!54 &4054124028099797856
Rigidbody:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4881589711078705830}
serializedVersion: 5
m_Mass: 1
m_LinearDamping: 0
m_AngularDamping: 0.05
m_CenterOfMass: {x: 0, y: 0, z: 0}
m_InertiaTensor: {x: 1, y: 1, z: 1}
m_InertiaRotation: {x: 0, y: 0, z: 0, w: 1}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_ImplicitCom: 1
m_ImplicitTensor: 1
m_UseGravity: 1
m_IsKinematic: 0
m_Interpolate: 0
m_Constraints: 0
m_CollisionDetection: 0
--- !u!65 &7941838468431302446
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4881589711078705830}
m_Material: {fileID: 13400000, guid: c77abc477d4de2a4197e1f08cebc364e, type: 2}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 3
m_Size: {x: 0.12160286, y: 0.2082051, z: 0.32264447}
m_Center: {x: 0.021650568, y: 0.006185949, z: 0.103613794}

View File

@@ -662,7 +662,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
openCloseEvents: 0
openCloseWindow: 1
selectedToolbar: 0
selectedToolbar: 2
inputType: 0
actionInput:
useInput: 1

View File

@@ -246,8 +246,8 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 4e4f602386d4d484ea7a2a3b0c19ac21, type: 3}
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::LaserProjectile
speed: 100
lifeTime: 5
speed: 70
lifeTime: 2
damageAmount: 10
hitSound: Laser_Hit
--- !u!54 &-8021594009672363794
@@ -275,5 +275,5 @@ Rigidbody:
m_UseGravity: 1
m_IsKinematic: 1
m_Interpolate: 0
m_Constraints: 0
m_CollisionDetection: 0
m_Constraints: 112
m_CollisionDetection: 1

File diff suppressed because it is too large Load Diff

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;
public float dampTime = 0.1f;
public float groundDistanceValue = 0.05f;
[Header("Force Settings")]
public bool forceGrounded = true;
public float movementBoost = 1.2f;
public float dampTime = 0.1f;
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,106 +90,74 @@ 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 localVelocity = transform.InverseTransformDirection(worldVelocity);
Vector3 localVel = transform.InverseTransformDirection(delta / Time.deltaTime);
float targetV = localVelocity.z / enemyAI.moveSpeed;
float targetH = localVelocity.x / enemyAI.moveSpeed;
float maxS = (enemyAI) ? enemyAI.moveSpeed : (kamikazeAI ? agent.speed : 3f);
if (maxS <= 0) maxS = 3f;
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 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)
{
if (trigger.isValid) StartCoroutine(SetTriggerRoutine(trigger));
}
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);
}
public void SetAnimatorTrigger(vAnimatorParameter trigger)
{
if (trigger.isValid) StartCoroutine(SetTriggerRoutine(trigger));
}
private IEnumerator SetTriggerRoutine(int targetHash)
{
animator.SetTrigger(targetHash);
yield return new WaitForSeconds(0.1f);
animator.ResetTrigger(targetHash);
private IEnumerator SetTriggerRoutine(int targetHash)
{
animator.SetTrigger(targetHash);
yield return new WaitForSeconds(0.1f);
animator.ResetTrigger(targetHash);
}
#endregion
}

View File

@@ -5,14 +5,24 @@ using UnityEngine;
using UnityEngine.AI;
using System.Linq;
using UnityEngine.InputSystem;
using Invector;
using Invector.vCharacterController;
using Random = UnityEngine.Random;
[Serializable]
public class DialogueResult { public string text; public float speedMod; public float suspicionMod; }
public class DialogueResult
{
public string text;
public float speedMod;
public float suspicionMod;
public float aggressionMod; // Ảnh hưởng delay bắn (0.1 -> 1.0)
public float braveryMod; // Ảnh hưởng ngưỡng Panic
public float healthMod; // Hồi máu hoặc mất máu tâm lý
}
// Quy trình ưu tiên: Né đòn --> Bắn hạ (Artifact / Sound Aggro) --> Đuổi theo (Vector) --> Điều tra --> Nói chuyện --> Đi tuần
[RequireComponent(typeof(NavMeshAgent))]
[RequireComponent(typeof(Rigidbody))]
[RequireComponent(typeof(vHealthController))]
public class EnemyAI : MonoBehaviour
{
[Header("References")]
@@ -20,6 +30,8 @@ public class EnemyAI : MonoBehaviour
private NavMeshAgent agent;
private Rigidbody rb;
private FieldOfView fov;
private Collider mainCollider;
private vHealthController health;
[Header("Movement Settings")]
public float moveSpeed = 3f;
@@ -34,25 +46,39 @@ public class EnemyAI : MonoBehaviour
[Header("Combat State")]
public bool playerHasArtifact;
public bool isAggroedBySound; // <-- MỚI: Trạng thái bị đánh động bởi âm thanh
public bool isAggroedBySound;
public GameObject laserPrefab;
public Transform firePoint;
public float minShootDelay = 1.5f;
public float maxShootDelay = 3.5f;
public float minShootDelay = 1.8f; // Tăng nhẹ delay để đỡ khó
public float maxShootDelay = 4.0f;
private float nextShootTime;
[Header("Dodge Settings")]
public float dodgeForce = 10f;
public float dodgeForce = 8f;
public float dodgeDuration = 0.2f;
public float dodgeCooldown = 1.2f;
public float dodgeCooldown = 2.0f; // Tăng cooldown né đòn
private bool isDodging = false;
private float nextDodgeTime = 0f;
[Header("Artifact Combat Upgrades (New)")]
[Header("Advanced AI States")]
public bool isPanicking = false;
public bool isEnraged = false;
public float panicHealthThreshold = 50f; // Chạy ngược lại khi < 50% máu
public float regenRate = 1.5f;
public float regenDelay = 5f;
private float lastDamageTime;
[Header("Personality (Randomized)")]
private float personalApproachWeight;
private float personalMinCombatDistance;
private float personalBurstMax;
private float personalStrafeIntensity;
[Header("Artifact Combat Upgrades")]
public float minStrafeDuration = 0.5f;
public float maxStrafeDuration = 2.2f;
public float maxSpreadAngle = 6f;
public float burstInterval = 0.12f;
public float maxSpreadAngle = 7f;
public float burstInterval = 0.15f;
public float approachWeight = 0.35f;
public float minCombatDistance = 5.0f;
@@ -66,7 +92,7 @@ public class EnemyAI : MonoBehaviour
[Header("Conversation Settings")]
public string npcName = "Guard";
[TextArea] public string persona = "You are a bored security guard. You love coffee and hate night shifts.";
[TextArea] public string persona = "You are a bored security guard.";
public float talkRange = 12f;
public float talkCooldown = 60f;
private float lastTalkTime;
@@ -78,7 +104,7 @@ public class EnemyAI : MonoBehaviour
public float suspicionLevel = 0f;
public float investigationThreshold = 30f;
public float alertNeighborsThreshold = 70f;
public float alertRange = 20f;
public float alertRange = 30f;
public Node rootNode;
@@ -88,6 +114,31 @@ public class EnemyAI : MonoBehaviour
rb = GetComponent<Rigidbody>();
fov = GetComponent<FieldOfView>();
chatBubble = GetComponentInChildren<Hallucinate.UI.ChatBubble>(true);
mainCollider = GetComponent<Collider>();
health = GetComponent<vHealthController>();
// RANDOM TÍNH CÁCH
personalApproachWeight = Random.Range(0.2f, 0.7f);
personalMinCombatDistance = Random.Range(3f, 8f);
personalBurstMax = Random.Range(2, 5);
personalStrafeIntensity = Random.Range(0.5f, 1.5f);
health.onReceiveDamage.AddListener(OnReceiveDamage);
health.onDead.AddListener(OnDead);
if (gameObject.layer == LayerMask.NameToLayer("Default"))
{
int enemyLayer = LayerMask.NameToLayer("Enemy");
if (enemyLayer != -1)
{
gameObject.layer = enemyLayer;
Debug.Log($"[AI {npcName}] Đã chuyển sang Layer: Enemy");
}
else
{
Debug.LogWarning($"[AI {npcName}] CẢNH BÁO: Không tìm thấy Layer 'Enemy' trong Project! Hãy tạo Layer 'Enemy' để súng có thể bắn trúng.");
}
}
rb.isKinematic = true;
rb.freezeRotation = true;
@@ -105,10 +156,8 @@ public class EnemyAI : MonoBehaviour
void InitTree()
{
var dodgeSequence = new Sequence(new List<Node> { new TaskNode(CheckDodgeConditions), new TaskNode(ActionDodge) });
// Đổi hàm CheckHasArtifact thành CheckCombatConditions để dùng chung cho cả âm thanh
var panicSequence = new Sequence(new List<Node> { new TaskNode(CheckPanicConditions), new TaskNode(ActionRetreat) }); // Thay Panic bằng Retreat
var laserSequence = new Sequence(new List<Node> { new TaskNode(CheckCombatConditions), new TaskNode(ActionFocusAndShoot) });
var chaseSequence = new Sequence(new List<Node> { new TaskNode(CheckCanSeePlayer), new TaskNode(ActionChasePlayer) });
var investigateSequence = new Sequence(new List<Node> { new TaskNode(CheckHasInvestigateTarget), new TaskNode(ActionInvestigate) });
var talkSequence = new Sequence(new List<Node> { new TaskNode(CheckCanTalkToNPC), new TaskNode(ActionTalk) });
@@ -117,6 +166,7 @@ public class EnemyAI : MonoBehaviour
rootNode = new Selector(new List<Node>
{
dodgeSequence,
panicSequence,
laserSequence,
chaseSequence,
investigateSequence,
@@ -127,40 +177,131 @@ public class EnemyAI : MonoBehaviour
void Update()
{
if (player == null) return;
if (player == null || health.isDead) return;
if (!agent.isOnNavMesh) return;
if (mainCollider != null && !mainCollider.enabled) mainCollider.enabled = true;
HandleHealthRegen();
suspicionLevel = Mathf.Max(0, suspicionLevel - Time.deltaTime * 0.5f);
if (suspicionLevel <= 0f && !isEnraged) isAggroedBySound = false;
// Bình tĩnh lại và tắt chế độ bắn dồn dập khi mức độ nghi ngờ về 0
if (suspicionLevel <= 0f)
{
isAggroedBySound = false;
}
if (!isTalking && !isDodging && agent.isStopped)
if (!isTalking && !isDodging && !isPanicking && agent.isStopped)
agent.isStopped = false;
rootNode?.Evaluate();
}
private void HandleHealthRegen()
{
if (Time.time > lastDamageTime + regenDelay && health.currentHealth < health.maxHealth)
{
float currentRegenSpeed = regenRate;
float healthPercent = (float)health.currentHealth / health.maxHealth;
// Tăng tốc hồi máu khi máu cực thấp (< 25%)
if (healthPercent < 0.25f)
currentRegenSpeed *= 4f;
else if (healthPercent < 0.5f)
currentRegenSpeed *= 2f;
health.AddHealth((int)(currentRegenSpeed * Time.deltaTime));
}
}
#region HEALTH EVENTS
private void OnReceiveDamage(vDamage damage)
{
lastDamageTime = Time.time;
isAggroedBySound = true;
suspicionLevel = 100f;
StopConversation();
// PHẢN ỨNG TỨC THÌ: Alert toàn bộ lân cận
AlertNeighbors(damage.hitPosition);
// PHẢN ỨNG TỨC THÌ: Reset delay bắn để phản công nhanh hoặc né
nextShootTime = Time.time + 0.5f;
// Né đòn Elden Ring (Tăng tỉ lệ né khi trúng dame)
if (Time.time > nextDodgeTime && !isDodging && Random.value < 0.7f)
{
StartCoroutine(DodgeRollRoutine());
}
// Tự động Enrage nếu bị dồn vào đường cùng (nhưng đồng thời vẫn có thể bỏ chạy nếu không phẫn nộ)
if (health.currentHealth < health.maxHealth * 0.2f && !isEnraged)
{
EnterEnrageMode();
}
}
private void OnDead(GameObject killer)
{
Debug.Log($"<color=black>[AI {npcName}] DIED.</color>");
// 1. Vô hiệu hóa va chạm và di chuyển ngay lập tức
if (mainCollider != null) mainCollider.enabled = false;
agent.enabled = false;
// 2. Kích hoạt Enrage cho đồng đội xung quanh
Collider[] hitColliders = Physics.OverlapSphere(transform.position, alertRange);
foreach (var hit in hitColliders)
{
EnemyAI ally = hit.GetComponentInParent<EnemyAI>();
if (ally != null && ally != this) ally.EnterEnrageMode();
}
// 3. Tự hủy sau 3 giây (để kịp chạy animation chết hoặc hiệu ứng)
Destroy(gameObject, 3f);
this.enabled = false;
}
public void EnterEnrageMode()
{
if (isEnraged) return;
isEnraged = true;
isPanicking = false;
moveSpeed *= 1.3f; // Giảm nhẹ buff speed
minShootDelay *= 0.6f;
maxShootDelay *= 0.6f;
if (chatBubble != null) chatBubble.Show("I'LL TAKE YOU DOWN WITH ME!", 2f);
}
#endregion
#region CONDITIONS
private NodeState CheckDodgeConditions()
{
if (playerHasArtifact || isAggroedBySound) return NodeState.Failure;
if (isDodging) return NodeState.Success;
if (fov != null && fov.canSeePlayer && Mouse.current.leftButton.isPressed)
// Tự né khi thấy Player đang bắn
if (fov != null && fov.canSeePlayer && Mouse.current.leftButton.isPressed && Time.time > nextDodgeTime)
return NodeState.Success;
return NodeState.Failure;
}
// Node này thay thế cho CheckHasArtifact cũ
private NodeState CheckPanicConditions()
{
if (isEnraged) return NodeState.Failure; // Đang điên thì không sợ, chiến đến chết
// Nếu máu dưới ngưỡng thiết lập (ví dụ 50%), kích hoạt trạng thái tháo chạy
if (health.currentHealth < (health.maxHealth * (panicHealthThreshold / 100f)))
{
return NodeState.Success;
}
isPanicking = false;
return NodeState.Failure;
}
private NodeState CheckCombatConditions()
{
bool shouldCombat = playerHasArtifact || isAggroedBySound;
bool shouldCombat = playerHasArtifact || isAggroedBySound || isEnraged;
if (shouldCombat) StopConversation();
return shouldCombat ? NodeState.Success : NodeState.Failure;
}
@@ -168,48 +309,32 @@ public class EnemyAI : MonoBehaviour
private NodeState CheckCanSeePlayer()
{
bool canSee = fov != null && fov.canSeePlayer;
if (canSee) { StopConversation(); AlertNeighbors(); suspicionLevel = 100; }
if (canSee) { StopConversation(); AlertNeighbors(transform.position); suspicionLevel = 100; }
return canSee ? NodeState.Success : NodeState.Failure;
}
private NodeState CheckHasInvestigateTarget()
{
if (fov != null && fov.lastKnownPlayerPosition != Vector3.zero)
{
if (suspicionLevel > investigationThreshold)
{
if (Random.value < (suspicionLevel / 100f)) return NodeState.Success;
}
}
if (fov != null && fov.lastKnownPlayerPosition != Vector3.zero && suspicionLevel > investigationThreshold)
return NodeState.Success;
return NodeState.Failure;
}
private NodeState CheckCanTalkToNPC()
{
if (playerHasArtifact || isAggroedBySound || (fov != null && fov.canSeePlayer)) return NodeState.Failure;
if (Time.time < lastTalkTime + talkCooldown) return NodeState.Failure;
if (isTalking) return NodeState.Success;
if (Hallucinate.AI.ConversationManager.Instance == null)
{
Debug.LogError($"[AI {npcName}] ConversationManager Instance is NULL!");
return NodeState.Failure;
}
if (!Hallucinate.AI.ConversationManager.Instance.CanStartConversation()) return NodeState.Failure;
if (playerHasArtifact || isAggroedBySound || isEnraged || (fov != null && fov.canSeePlayer)) return NodeState.Failure;
if (Time.time < lastTalkTime + talkCooldown || isTalking) return NodeState.Failure;
if (Hallucinate.AI.ConversationManager.Instance == null || !Hallucinate.AI.ConversationManager.Instance.CanStartConversation()) return NodeState.Failure;
Collider[] hitColliders = Physics.OverlapSphere(transform.position, talkRange);
foreach (var hit in hitColliders)
{
if (hit.gameObject == gameObject) continue;
EnemyAI other = hit.GetComponentInParent<EnemyAI>();
if (other != null && !other.isTalking && Time.time >= other.lastTalkTime + talkCooldown)
if (other != null && !other.isTalking && !other.isEnraged)
{
float dist = Vector3.Distance(transform.position, other.transform.position);
if (dist <= talkRange && gameObject.GetInstanceID() < other.gameObject.GetInstanceID())
if (gameObject.GetInstanceID() < other.gameObject.GetInstanceID())
{
Debug.Log($"<color=green>[AI {npcName}]</color> Found partner: {other.npcName}. Starting conversation.");
Hallucinate.AI.ConversationManager.Instance.StartConversation(this, other);
return NodeState.Success;
}
@@ -224,21 +349,14 @@ public class EnemyAI : MonoBehaviour
public void HearNoise(Vector3 location, float volume)
{
suspicionLevel += volume * 15f;
suspicionLevel += volume * 20f;
if (fov != null) fov.lastKnownPlayerPosition = location;
// CẬP NHẬT: Nếu AI nghe thấy tiếng động làm mức nghi ngờ vượt mốc điều tra, chuyển sang trạng thái chiến đấu (bắn bồi)
if (suspicionLevel >= investigationThreshold)
{
isAggroedBySound = true;
}
if (suspicionLevel >= alertNeighborsThreshold) AlertNeighbors();
if (suspicionLevel >= investigationThreshold) isAggroedBySound = true;
if (suspicionLevel >= alertNeighborsThreshold) AlertNeighbors(location);
StopConversation();
Debug.Log($"<color=orange>[AI {npcName}]</color> Heard noise! Suspicion: {suspicionLevel}");
}
public void AlertNeighbors()
public void AlertNeighbors(Vector3 threatPos)
{
Collider[] hitColliders = Physics.OverlapSphere(transform.position, alertRange);
foreach (var hit in hitColliders)
@@ -246,83 +364,88 @@ public class EnemyAI : MonoBehaviour
EnemyAI neighbor = hit.GetComponentInParent<EnemyAI>();
if (neighbor != null && neighbor != this)
{
neighbor.suspicionLevel = Mathf.Max(neighbor.suspicionLevel, 50f);
if (fov != null && neighbor.fov != null) neighbor.fov.lastKnownPlayerPosition = fov.lastKnownPlayerPosition;
neighbor.TriggerCombatAlert(threatPos);
}
}
}
public void TriggerCombatAlert(Vector3 sourceLocation)
{
if (isEnraged) return;
suspicionLevel = 100f;
isAggroedBySound = true;
if (fov != null) fov.lastKnownPlayerPosition = sourceLocation;
StopConversation();
}
// Hành động tháo chạy khi máu thấp
private NodeState ActionRetreat()
{
isPanicking = true;
agent.isStopped = false;
agent.speed = moveSpeed * 1.3f; // Chạy nhanh hơn bình thường để thoát thân
// Tính toán hướng ngược lại với Player
Vector3 retreatDir = (transform.position - player.position).normalized;
Vector3 targetPos = transform.position + retreatDir * 15f + Random.insideUnitSphere * 5f;
if (!agent.pathPending && agent.remainingDistance < 1f)
{
NavMeshHit hit;
if (NavMesh.SamplePosition(targetPos, out hit, 10f, 1))
{
agent.SetDestination(hit.position);
}
}
if (chatBubble != null && Random.value < 0.005f) chatBubble.Show("I NEED TO RECOVER!", 1.5f);
// Khi máu đã hồi phục trên 50%, dừng chạy và quay lại tấn công
if (health.currentHealth >= health.maxHealth * 0.5f)
{
isPanicking = false;
return NodeState.Success;
}
return NodeState.Running;
}
private NodeState ActionTalk()
{
if (isTalking)
{
agent.isStopped = true;
if (talkingPartner != null)
{
if (Vector3.Distance(transform.position, talkingPartner.transform.position) > talkRange + 2f)
{
Debug.Log($"[AI {npcName}] Partner moved too far. Ending conversation.");
StopConversation();
return NodeState.Failure;
}
}
return NodeState.Running;
}
if (isTalking) { agent.isStopped = true; return NodeState.Running; }
return NodeState.Failure;
}
public void ProcessDialogueResult(string json)
{
try
{
DialogueResult result = JsonUtility.FromJson<DialogueResult>(json);
if (chatBubble != null) chatBubble.Show(result.text);
moveSpeed += result.speedMod;
suspicionLevel = Mathf.Clamp(suspicionLevel + result.suspicionMod, 0, 100);
lastTalkTime = Time.time;
}
catch { if (chatBubble != null) chatBubble.Show(json); }
}
private void StopConversation()
{
if (isTalking && Hallucinate.AI.ConversationManager.Instance != null)
{
Hallucinate.AI.ConversationManager.Instance.InterruptConversation(this);
if (chatBubble != null) chatBubble.Show("Wait, what was that?!", 2f);
}
}
private NodeState ActionPatrol()
{
isPanicking = false;
agent.isStopped = false;
agent.speed = patrolSpeed;
if (!agent.pathPending && agent.remainingDistance <= agent.stoppingDistance)
{
currentWaitTime += Time.deltaTime;
if (currentWaitTime >= patrolWaitTime)
{
Vector3 randomDirection = Random.insideUnitSphere * patrolRadius;
randomDirection += startPosition;
Vector3 randomDest = startPosition + Random.insideUnitSphere * patrolRadius;
NavMeshHit hit;
if (NavMesh.SamplePosition(randomDirection, out hit, patrolRadius, 1))
{
agent.SetDestination(hit.position);
}
if (NavMesh.SamplePosition(randomDest, out hit, patrolRadius, 1)) agent.SetDestination(hit.position);
currentWaitTime = 0f;
}
}
return NodeState.Running;
}
private NodeState ActionChasePlayer()
{
isPanicking = false;
agent.isStopped = false;
agent.speed = moveSpeed;
agent.SetDestination(player.position);
@@ -334,99 +457,59 @@ public class EnemyAI : MonoBehaviour
agent.isStopped = false;
agent.speed = moveSpeed * 0.7f;
agent.SetDestination(fov.lastKnownPlayerPosition);
if (Vector3.Distance(transform.position, fov.lastKnownPlayerPosition) < 1.5f)
{
currentWaitTime += Time.deltaTime;
if (currentWaitTime > 3f)
{
fov.lastKnownPlayerPosition = Vector3.zero;
suspicionLevel *= 0.5f;
return NodeState.Success;
}
if (currentWaitTime > 3f) { fov.lastKnownPlayerPosition = Vector3.zero; return NodeState.Success; }
}
return NodeState.Running;
}
private NodeState ActionFocusAndShoot()
{
isPanicking = false;
if (player == null) return NodeState.Failure;
if (agent.hasPath) agent.ResetPath();
agent.isStopped = false;
// CẢI TIẾN: Xác định mục tiêu linh hoạt để tránh Wallhack.
Vector3 targetPos = player.position; // Mặc định khóa chặt người chơi
// Nếu không cầm Artifact và cũng chưa bị nhìn thấy, AI chỉ nhắm vào MỐC ÂM THANH
Vector3 targetPos = player.position;
if (!playerHasArtifact && fov != null && !fov.canSeePlayer && fov.lastKnownPlayerPosition != Vector3.zero)
{
targetPos = fov.lastKnownPlayerPosition;
// Nếu AI tiến hành áp sát và xả đạn vào nơi phát ra tiếng mà không thấy ai, ngưng bắn
if (Vector3.Distance(transform.position, targetPos) < 2f)
{
isAggroedBySound = false;
suspicionLevel *= 0.5f;
return NodeState.Success;
}
}
// 1. XOAY THÂN THEO TRỤC NGANG HƯỚNG VỀ MỤC TIÊU (Người chơi hoặc Tiếng động)
Vector3 bodyDir = targetPos - transform.position;
bodyDir.y = 0f;
Vector3 bodyDirNormal = bodyDir.normalized;
Vector3 bodyDir = (targetPos - transform.position);
bodyDir.y = 0f;
if (bodyDir != Vector3.zero)
{
Quaternion targetRotation = Quaternion.LookRotation(bodyDirNormal);
transform.rotation = Quaternion.Slerp(transform.rotation, targetRotation, rotateSpeed * Time.deltaTime);
}
transform.rotation = Quaternion.Slerp(transform.rotation, Quaternion.LookRotation(bodyDir), rotateSpeed * Time.deltaTime);
// 2. RANDOM THỜI GIAN/KHOẢNG CÁCH DUY TRÌ HƯỚNG DI CHUYỂN
if (Time.time >= nextStrafeChangeTime)
{
int[] choices = { -1, 1, 0 }; // Trái, Phải, Đứng yên bắn
strafeDirectionSign = choices[Random.Range(0, choices.Length)];
strafeDirectionSign = new int[] { -1, 1, 0 }[Random.Range(0, 3)];
nextStrafeChangeTime = Time.time + Random.Range(minStrafeDuration, maxStrafeDuration);
}
// 3. TÍNH TOÁN TRỘN VECTOR: CHỈ TIẾN LÊN KHI ĐANG ĐI NGANG TRÁI/PHẢI
Vector3 finalMovementVector = Vector3.zero;
Vector3 moveDir = Vector3.zero;
if (strafeDirectionSign != 0 && bodyDir != Vector3.zero)
{
finalMovementVector = new Vector3(-bodyDirNormal.z, 0, bodyDirNormal.x) * strafeDirectionSign;
float currentDistance = Vector3.Distance(transform.position, targetPos);
if (currentDistance > minCombatDistance)
{
finalMovementVector += bodyDirNormal * approachWeight;
}
Vector3 normal = bodyDir.normalized;
moveDir = new Vector3(-normal.z, 0, normal.x) * strafeDirectionSign * personalStrafeIntensity;
float dist = Vector3.Distance(transform.position, targetPos);
if (dist > personalMinCombatDistance) moveDir += normal * personalApproachWeight;
}
if (finalMovementVector != Vector3.zero)
if (moveDir != Vector3.zero)
{
finalMovementVector.Normalize();
agent.speed = moveSpeed * 0.75f;
agent.Move(finalMovementVector * agent.speed * Time.deltaTime);
agent.speed = moveSpeed * (isEnraged ? 1f : 0.75f);
agent.Move(moveDir.normalized * agent.speed * Time.deltaTime);
}
// 4. XOAY HỌNG SÚNG TRỤC DỌC NHẮM VÀO MỤC TIÊU
if (firePoint != null)
{
Vector3 targetCenter = targetPos + Vector3.up * 1f;
Vector3 aimDir = targetCenter - firePoint.position;
if (aimDir != Vector3.zero)
{
firePoint.rotation = Quaternion.LookRotation(aimDir);
}
}
firePoint.rotation = Quaternion.LookRotation((targetPos + Vector3.up * 1f) - firePoint.position);
// 5. RANDOM SỐ ĐẠN & DELAY GIỮA CÁC ĐỢT BẮN
if (Time.time >= nextShootTime && !isShootingBurst)
{
int randomBulletCount = Random.Range(1, 4);
StartCoroutine(ShootBurstRoutine(randomBulletCount));
int burstCount = Random.Range(1, (int)personalBurstMax + (isEnraged ? 2 : 0));
StartCoroutine(ShootBurstRoutine(burstCount));
nextShootTime = Time.time + Random.Range(minShootDelay, maxShootDelay);
}
@@ -436,31 +519,17 @@ public class EnemyAI : MonoBehaviour
private IEnumerator ShootBurstRoutine(int bulletCount)
{
isShootingBurst = true;
for (int i = 0; i < bulletCount; i++)
{
if (laserPrefab == null || firePoint == null) break;
float randomX = Random.Range(-maxSpreadAngle, maxSpreadAngle);
float randomY = Random.Range(-maxSpreadAngle, maxSpreadAngle);
Quaternion spreadRotation = Quaternion.Euler(randomX, randomY, 0f);
Quaternion finalBulletRotation = firePoint.rotation * spreadRotation;
Instantiate(laserPrefab, firePoint.position, finalBulletRotation);
Debug.Log($"<color=cyan>[AI Burst]</color> Viên thứ {i + 1}/{bulletCount} | Độ lệch X:{randomX:F1}, Y:{randomY:F1}");
if (i < bulletCount - 1)
{
yield return new WaitForSeconds(burstInterval);
}
float spread = isEnraged ? maxSpreadAngle * 0.5f : maxSpreadAngle;
Quaternion rot = firePoint.rotation * Quaternion.Euler(Random.Range(-spread, spread), Random.Range(-spread, spread), 0f);
Instantiate(laserPrefab, firePoint.position, rot);
yield return new WaitForSeconds(isEnraged ? burstInterval * 0.7f : burstInterval);
}
isShootingBurst = false;
}
private void ShootLaser() { }
private NodeState ActionDodge()
{
if (!isDodging) StartCoroutine(DodgeRollRoutine());
@@ -472,16 +541,50 @@ public class EnemyAI : MonoBehaviour
isDodging = true;
agent.enabled = false;
rb.isKinematic = false;
if (mainCollider != null) mainCollider.enabled = true;
Vector3 dir = (player.position - transform.position).normalized;
Vector3 perp = new Vector3(-dir.z, 0, dir.x);
rb.AddForce((Random.value > 0.5f ? perp : -perp) * dodgeForce, ForceMode.Impulse);
Vector3 perp = new Vector3(-dir.z, 0, dir.x) * (Random.value > 0.5f ? 1 : -1);
rb.AddForce(perp * (isEnraged ? dodgeForce * 1.3f : dodgeForce), ForceMode.Impulse);
yield return new WaitForSeconds(dodgeDuration);
rb.linearVelocity = Vector3.zero;
rb.isKinematic = true;
agent.enabled = true;
nextDodgeTime = Time.time + (isEnraged ? dodgeCooldown * 0.6f : dodgeCooldown);
isDodging = false;
}
public void ProcessDialogueResult(string json)
{
try
{
DialogueResult result = JsonUtility.FromJson<DialogueResult>(json);
if (chatBubble != null) chatBubble.Show(result.text);
// Áp dụng modifiers từ Gemini
moveSpeed = Mathf.Clamp(moveSpeed + result.speedMod, 1f, 8f);
suspicionLevel = Mathf.Clamp(suspicionLevel + result.suspicionMod, 0, 100);
// Modifier hung hãn: giảm delay bắn (max 50%)
minShootDelay = Mathf.Clamp(minShootDelay * (1f - result.aggressionMod), 0.5f, 5f);
maxShootDelay = Mathf.Clamp(maxShootDelay * (1f - result.aggressionMod), 1f, 10f);
// Modifier can đảm: thay đổi ngưỡng panic
panicHealthThreshold = Mathf.Clamp(panicHealthThreshold - result.braveryMod, 0, 80);
// Modifier máu
if (result.healthMod != 0)
{
health.AddHealth((int)result.healthMod);
}
lastTalkTime = Time.time;
Debug.Log($"[AI {npcName}] Gemini influence: Speed:{result.speedMod}, Aggro:{result.aggressionMod}, Bravery:{result.braveryMod}");
}
catch { if (chatBubble != null) chatBubble.Show(json); }
}
public void SetTalkingPartner(EnemyAI partner) { talkingPartner = partner; }
public void FaceTarget(Vector3 pos)
{
@@ -494,13 +597,7 @@ public class EnemyAI : MonoBehaviour
private void OnDrawGizmos()
{
Gizmos.color = Color.green;
Gizmos.DrawWireSphere(transform.position, talkRange);
if (isTalking && talkingPartner != null)
{
Gizmos.color = Color.yellow;
Gizmos.DrawLine(transform.position + Vector3.up, talkingPartner.transform.position + Vector3.up);
}
Gizmos.color = isEnraged ? Color.red : Color.green;
Gizmos.DrawWireSphere(transform.position, alertRange);
}
}

View File

@@ -31,10 +31,10 @@ namespace Hallucinate.AI
private float nextRequestTime = 0f;
private string[] fallbackDialogues = {
"{ \"text\": \"Nice weather, isn't it?\", \"speedMod\": 0.0, \"suspicionMod\": -5.0 }",
"{ \"text\": \"Did you hear something? Probably just a rat.\", \"speedMod\": 0.0, \"suspicionMod\": 2.0 }",
"{ \"text\": \"I'm so tired of this shift.\", \"speedMod\": -0.1, \"suspicionMod\": 0.0 }",
"{ \"text\": \"Don't forget the coffee break later.\", \"speedMod\": 0.0, \"suspicionMod\": -2.0 }"
"{ \"text\": \"Nice weather, isn't it?\", \"speedMod\": 0.0, \"suspicionMod\": -5.0, \"aggressionMod\": 0.0, \"braveryMod\": 0.0, \"healthMod\": 0.0 }",
"{ \"text\": \"Did you hear something? Probably just a rat.\", \"speedMod\": 0.0, \"suspicionMod\": 2.0, \"aggressionMod\": 0.1, \"braveryMod\": -5.0, \"healthMod\": 0.0 }",
"{ \"text\": \"I'm so tired of this shift.\", \"speedMod\": -0.2, \"suspicionMod\": 0.0, \"aggressionMod\": -0.1, \"braveryMod\": 5.0, \"healthMod\": 0.0 }",
"{ \"text\": \"You looks strong, I should be careful.\", \"speedMod\": 0.1, \"suspicionMod\": 5.0, \"aggressionMod\": -0.2, \"braveryMod\": 10.0, \"healthMod\": 0.0 }"
};
private void Awake()
@@ -72,7 +72,15 @@ namespace Hallucinate.AI
{
activeRequests++;
string jsonInstruction = " Respond ONLY with a JSON object: { 'text': 'your dialogue', 'speedMod': 0.0, 'suspicionMod': 0.0 }.";
string jsonInstruction = " Respond ONLY with a JSON object: { " +
"'text': 'dialogue content', " +
"'speedMod': 0.0 (change movement speed), " +
"'suspicionMod': 0.0 (change suspicion level), " +
"'aggressionMod': 0.0 (0.1 to 0.5 makes NPC shoot faster, negative makes them slower), " +
"'braveryMod': 0.0 (positive makes them less likely to panic, negative makes them scared), " +
"'healthMod': 0.0 (positive heals NPC, negative damages them) " +
"}. Keep values realistic.";
string escapedPersona = persona.Replace("\"", "\\\"");
string escapedPrompt = prompt.Replace("\"", "\\\"");
@@ -80,8 +88,8 @@ namespace Hallucinate.AI
""systemInstruction"": {{""parts"": [{{ ""text"": ""{escapedPersona} {jsonInstruction}"" }}]}},
""contents"": [{{""parts"": [{{ ""text"": ""{escapedPrompt}"" }}]}}],
""generationConfig"": {{
""maxOutputTokens"": 100,
""temperature"": 0.7,
""maxOutputTokens"": 150,
""temperature"": 0.8,
""responseMimeType"": ""application/json""
}}
}}";
@@ -110,8 +118,7 @@ namespace Hallucinate.AI
Debug.LogError($"[Gemini] API Error: {request.error}");
if (request.responseCode == 429)
{
nextRequestTime = Time.time + 60f; // Lock API for 1 minute
Debug.LogWarning("Quota Exceeded. API locked for 60s. Using fallback.");
nextRequestTime = Time.time + 60f;
}
onComplete?.Invoke(fallbackDialogues[UnityEngine.Random.Range(0, fallbackDialogues.Length)]);
}

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;

View File

@@ -1,3 +1,4 @@
using System;
using UnityEngine;
using Hallucinate.Audio;
using Invector;
@@ -45,7 +46,18 @@ public class LaserProjectile : MonoBehaviour
return;
}
// KIỂM TRA LAYER "GROUND"
if (other.gameObject.layer == LayerMask.NameToLayer("Ground"))
{
Debug.Log("<color=yellow>Laser hit GROUND layer.</color>");
Impact();
return;
}
// Phá hủy đạn nếu trúng tường, sàn nhà (mọi thứ không phải trigger khác)
// 2. Phá hủy đạn nếu trúng Ground, Tường, hoặc bất kỳ vật thể đặc nào (không phải Trigger)
if (!other.isTrigger)
{
Debug.Log($"Laser hit solid object: {other.name} (Ground/Obstacle). Destroying.");
@@ -53,6 +65,15 @@ public class LaserProjectile : MonoBehaviour
}
}
private void OnCollisionEnter(Collision other)
{
if (other.gameObject.layer == LayerMask.NameToLayer("Ground") || other.gameObject.tag == "Ground")
{
Impact();
return;
}
}
private void Impact()
{
// Chạy âm thanh

View File

@@ -1,16 +0,0 @@
using UnityEngine;
public class RagNPC : MonoBehaviour
{
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}

View File

@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 30cdc86fe97fa95428a4b31052cfb22f

View File

@@ -1,44 +1,53 @@
using UnityEngine;
using UnityEngine.SceneManagement;
using System.Collections;
using Hallucinate.Audio; // Import namespace for AudioManager
using Hallucinate.Audio;
public class FinishGate : MonoBehaviour
{
[Header("Cài đặt UI Chính")]
public GameObject winPanel;
public GameObject warningUI; // Thông báo "Bạn chưa nhặt rương nào!"
public GameObject losePanel; // Bảng Lose
public GameObject welcomeUI; // THÔNG BÁO 1: "Chào mừng!"
public GameObject warningUI; // THÔNG BÁO 2: "Bạn chưa nhặt rương nào!"
[Header("Cài đặt Sao trên HUD (Giao diện chính)")]
[Header("Cài đặt Sao trên HUD")]
public GameObject hudStar1;
public GameObject hudStar2;
public GameObject hudStar3;
[Header("Cài đặt Sao trên Bảng Win (Kết thúc)")]
[Header("Cài đặt Sao trên Bảng Win")]
public GameObject winStar1;
public GameObject winStar2;
public GameObject winStar3;
[Header("Cài đặt Âm thanh")]
public string winSound = "UI_Win";
public string loseSound = "UI_Lose"; // Âm thanh thua
public string warningSound = "UI_Warning";
public string clickSound = "UI_Click";
[Header("Cấu hình Tag")]
public string playerTag = "Player";
private bool hasEnteredOnce = false; // Theo dõi lần chạm cổng đầu tiên
private void Start()
{
Time.timeScale = 1f;
if (winPanel != null) winPanel.SetActive(false);
if (losePanel != null) losePanel.SetActive(false);
if (welcomeUI != null) welcomeUI.SetActive(false);
if (warningUI != null) warningUI.SetActive(false);
// Ẩn tất cả sao lúc bắt đầu
UpdateStarsUI(0);
UpdateWinStarsUI(0);
}
private void OnTriggerEnter(Collider other)
{
if (other.CompareTag("Check"))
if (other.CompareTag(playerTag))
{
PlayerInventory player = other.GetComponentInChildren<PlayerInventory>();
if (player == null) player = other.GetComponentInParent<PlayerInventory>();
@@ -47,55 +56,81 @@ public class FinishGate : MonoBehaviour
{
if (player.treasuresCollected > 0)
{
Debug.Log($"<color=green>[Gate]</color> VỀ ĐÍCH! Kết thúc màn chơi với {player.treasuresCollected} sao.");
WinGame(player.treasuresCollected);
}
else
{
Debug.Log("<color=yellow>[Gate]</color> Bạn chưa nhặt rương nào, hãy đi tìm rương trước khi về.");
StopAllCoroutines();
StartCoroutine(ShowTempUI(warningUI));
// Nếu là lần đầu tiên -> Hiện Welcome. Nếu là lần sau -> Hiện Warning.
if (!hasEnteredOnce)
{
hasEnteredOnce = true;
StartCoroutine(ShowTempUI(welcomeUI));
}
else
{
StartCoroutine(ShowTempUI(warningUI));
}
}
}
}
}
// Hàm public để TreasureItem có thể gọi cập nhật HUD ngay khi nhặt
public void UpdateStarsUI(int count)
{
if (hudStar1) hudStar1.SetActive(count >= 1);
if (hudStar2) hudStar2.SetActive(count >= 2);
if (hudStar3) hudStar3.SetActive(count >= 3);
if (hudStar1 != null) hudStar1.SetActive(count >= 1);
if (hudStar2 != null) hudStar2.SetActive(count >= 2);
if (hudStar3 != null) hudStar3.SetActive(count >= 3);
}
void UpdateWinStarsUI(int count)
private void UpdateWinStarsUI(int count)
{
if (winStar1) winStar1.SetActive(count >= 1);
if (winStar2) winStar2.SetActive(count >= 2);
if (winStar3) winStar3.SetActive(count >= 3);
if (winStar1 != null) winStar1.SetActive(count >= 1);
if (winStar2 != null) winStar2.SetActive(count >= 2);
if (winStar3 != null) winStar3.SetActive(count >= 3);
}
void WinGame(int count)
private void WinGame(int count)
{
if (winPanel != null)
{
winPanel.SetActive(true);
UpdateWinStarsUI(count); // Hiện số sao tương ứng trên bảng kết thúc
UpdateWinStarsUI(count);
}
AudioManager.PlayGlobal(winSound); // Chạy âm thanh thắng cuộc
AudioManager.PlayGlobal(winSound);
Time.timeScale = 0f;
Cursor.lockState = CursorLockMode.None;
Cursor.visible = true;
}
IEnumerator ShowTempUI(GameObject ui)
public void LoseGame()
{
if (losePanel != null)
{
losePanel.SetActive(true);
}
AudioManager.PlayGlobal(loseSound);
Time.timeScale = 0f;
Cursor.lockState = CursorLockMode.None;
Cursor.visible = true;
}
private IEnumerator ShowTempUI(GameObject ui)
{
if (ui == null) yield break;
// Tắt tất cả UI tạm thời khác trước khi bật cái mới để tránh đè chữ
if (welcomeUI != null) welcomeUI.SetActive(false);
if (warningUI != null) warningUI.SetActive(false);
ui.SetActive(true);
if (ui == warningUI) AudioManager.PlayGlobal(warningSound); // Chạy âm thanh cảnh báo
if (ui == warningUI)
{
AudioManager.PlayGlobal(warningSound);
}
yield return new WaitForSeconds(3f);
ui.SetActive(false);
@@ -103,17 +138,17 @@ public class FinishGate : MonoBehaviour
public void RestartGame()
{
AudioManager.PlayGlobal(clickSound); // Âm thanh click nút
AudioManager.PlayGlobal(clickSound);
Time.timeScale = 1f;
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
}
public void QuitGame()
{
AudioManager.PlayGlobal(clickSound); // Âm thanh click nút
AudioManager.PlayGlobal(clickSound);
Application.Quit();
#if UNITY_EDITOR
UnityEditor.EditorApplication.isPlaying = false;
#endif
}
}
}

View File

@@ -1,52 +1,55 @@
using UnityEngine;
using System.Collections;
using Hallucinate.Audio;
using Hallucinate.Audio;
public class TreasureItem : MonoBehaviour
{
[Header("Cài đặt UI thông báo")]
public GameObject notificationText; // Text "Đã nhặt Cổ vật"
[Tooltip("Kéo Text 'Đã nhặt được cổ vật hãy trốn thoát ra khỏi đây' vào đây")]
public GameObject notificationText;
[Header("Cài đặt Âm thanh")]
public string pickupSound = "Item_Pickup";
[Header("Cấu hình Tag")]
public string playerTag = "Player";
private bool isCollected = false;
private void Start()
{
if (notificationText != null)
{
notificationText.SetActive(false);
}
}
private void OnTriggerEnter(Collider other)
{
if (other.CompareTag("Player"))
if (!isCollected && other.CompareTag(playerTag))
{
PlayerInventory player = other.GetComponentInChildren<PlayerInventory>();
if (player == null) player = other.GetComponentInParent<PlayerInventory>();
if (player != null)
{
// 1. Tăng số lượng rương đang giữ
isCollected = true;
player.treasuresCollected++;
Debug.Log($"<color=cyan>[Chest]</color> NHẶT THÀNH CÔNG! Số rương hiện tại: {player.treasuresCollected}");
// 2. Cập nhật sao trên HUD ngay lập tức (Tìm FinishGate để mượn hàm update)
FinishGate gate = Object.FindAnyObjectByType<FinishGate>();
if (gate != null)
{
gate.UpdateStarsUI(player.treasuresCollected);
}
// 3. Kích hoạt trạng thái truy đuổi cho toàn bộ Enemy AI
SetEnemiesAlertState(true);
// 4. Chạy âm thanh nhặt đồ
if (AudioManager.Instance != null)
{
AudioManager.Instance.Play(pickupSound, position: transform.position);
}
if (notificationText != null)
{
StopAllCoroutines();
StartCoroutine(ShowNotification());
}
// Biến mất rương
gameObject.SetActive(false);
StartCoroutine(HandlePickupRoutine());
}
}
}
@@ -56,14 +59,38 @@ public class TreasureItem : MonoBehaviour
EnemyAI[] allEnemies = Object.FindObjectsByType<EnemyAI>(FindObjectsSortMode.None);
foreach (EnemyAI enemy in allEnemies)
{
enemy.playerHasArtifact = state;
if (enemy != null) enemy.playerHasArtifact = state;
}
}
IEnumerator ShowNotification()
private IEnumerator HandlePickupRoutine()
{
notificationText.SetActive(true);
yield return new WaitForSeconds(2f);
notificationText.SetActive(false);
HideTreasureModel();
if (notificationText != null)
{
notificationText.SetActive(true);
}
yield return new WaitForSeconds(3f); // Tăng lên 3s để người chơi kịp đọc dòng chữ dài
if (notificationText != null)
{
notificationText.SetActive(false);
}
gameObject.SetActive(false);
}
}
private void HideTreasureModel()
{
Collider col = GetComponent<Collider>();
if (col != null) col.enabled = false;
MeshRenderer[] renderers = GetComponentsInChildren<MeshRenderer>();
foreach (MeshRenderer r in renderers)
{
r.enabled = false;
}
}
}

View File

@@ -98,6 +98,13 @@ namespace Invector.vCharacterController
private void OnDead(GameObject arg0)
{
ShowText("You are Dead!");
// Gọi hàm LoseGame từ script FinishGate khi người chơi chết
FinishGate gate = Object.FindAnyObjectByType<FinishGate>();
if (gate != null)
{
gate.LoseGame();
}
}
public virtual void UpdateHUD(vThirdPersonController cc)

View File

@@ -115,7 +115,7 @@ Material:
- _ZWrite: 0
m_Colors:
- _CameraFadeParams: {r: 0, g: Infinity, b: 0, a: 0}
- _Color: {r: 1, g: 0.8260788, b: 0.08962262, a: 0.25}
- _Color: {r: 0.6132076, g: 0.1454958, b: 0.118592024, a: 0.1882353}
- _Emission: {r: 0, g: 0, b: 0, a: 0}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _Flip: {r: 1, g: 1, b: 1, a: 1}
@@ -123,6 +123,6 @@ Material:
- _SoftParticleFadeParams: {r: 0, g: 0, b: 0, a: 0}
- _SpecColor: {r: 0, g: 0, b: 0, a: 0}
- _Specular: {r: 1, g: 1, b: 1, a: 0}
- _TintColor: {r: 1, g: 0.8260788, b: 0.08962262, a: 0.25}
- _TintColor: {r: 0.6132076, g: 0.1454958, b: 0.118592024, a: 0.1882353}
m_BuildTextureStacks: []
m_AllowLocking: 1

View File

@@ -130,9 +130,11 @@ namespace Invector.vShooter
}
var rigb = hitInfo.collider.gameObject.GetComponent<Rigidbody>();
if (rigb)
if (rigb && !rigb.isKinematic)
{
rigb.AddForce(transform.forward * damage.damageValue * forceMultiplier, ForceMode.Impulse);
// GIẢM LỰC ĐẨY: Chỉ dùng 10% lực để NPC không bị bay quá xa
float realisticForce = (damage.damageValue * forceMultiplier) * 0.1f;
rigb.AddForce(transform.forward * realisticForce, ForceMode.Impulse);
}
startPosition = transform.position;
@@ -292,8 +294,20 @@ namespace Invector.vShooter
}
}
}
else
else
{
// DIAGNOSTIC X-RAY: Kiểm tra xem có trúng cái gì mà bị HitLayer cấm không?
RaycastHit diagHit;
if (Physics.Linecast(previousPosition, transform.position + transform.forward * 0.5f, out diagHit, ~0)) // ~0 là tất cả layer
{
if (diagHit.collider.CompareTag("Enemy") || diagHit.collider.name.Contains("Guard") || diagHit.collider.GetComponentInParent<EnemyAI>() != null)
{
Debug.LogError($"<color=red>LAYER BLOCK DETECTED!</color> Đạn vừa bay xuyên qua {diagHit.collider.name}. " +
$"Đối tượng này ở Layer: {LayerMask.LayerToName(diagHit.collider.gameObject.layer)} ({diagHit.collider.gameObject.layer}). " +
$"NHƯNG súng của bạn đang dùng HitLayer Mask: {hitLayer.value}, không bao gồm layer này!");
}
}
if (debugTrajetory)
{
Debug.DrawLine(transform.position, previousPosition, debugColor, 10f);
@@ -301,7 +315,8 @@ namespace Invector.vShooter
}
previousPosition = transform.position;
}

View File

@@ -242,6 +242,21 @@ namespace Invector.vShooter
#endregion
#region Protected Methods
protected virtual void Start()
{
// TỰ ĐỘNG SỬA LỖI LAYER: Đảm bảo súng luôn có thể bắn trúng Enemy
int enemyLayer = LayerMask.NameToLayer("Enemy");
if (enemyLayer != -1)
{
// Cưỡng bức thêm Layer Enemy vào mask (Dùng toán tử bit OR)
hitLayer.value |= (1 << enemyLayer);
Debug.Log($"<color=green>[WEAPON AUTO-FIX]</color> {gameObject.name} hiện đã có thể bắn trúng Layer 'Enemy' (Mask mới: {hitLayer.value}).");
}
else
{
Debug.LogError("<color=red>[WEAPON ERROR]</color> Bạn chưa tạo Layer tên là 'Enemy' trong Project Settings > Tags and Layers!");
}
}
protected virtual void OnDestroy()
{
@@ -256,6 +271,14 @@ namespace Invector.vShooter
{
ShootBullet(startPoint, endPoint);
ShotEffect();
// Gửi tín hiệu tiếng súng cho toàn bộ AI lân cận
var hitColliders = Physics.OverlapSphere(muzzle.position, 50f);
foreach (var hit in hitColliders)
{
var ai = hit.GetComponentInParent<EnemyAI>();
if (ai != null) ai.TriggerCombatAlert(muzzle.position);
}
}
public virtual Vector3 Dispersion(Vector3 aim, float dispersion)
{
@@ -297,11 +320,32 @@ namespace Invector.vShooter
protected virtual void ShootBullet(Vector3 startPoint, Vector3 endPoint)
{
// TỰ ĐỘNG SỬA LỖI LAYER (Cưỡng bức mỗi khi bắn):
int enemyLayer = LayerMask.NameToLayer("Enemy");
if (enemyLayer != -1)
{
// Ép thêm Layer Enemy vào mask nếu nó bị thiếu
if ((hitLayer.value & (1 << enemyLayer)) == 0)
{
hitLayer.value |= (1 << enemyLayer);
Debug.Log($"<color=orange>[WEAPON FORCE-FIX]</color> Đã cưỡng bức thêm Layer 'Enemy' vào {gameObject.name} khi bắn.");
}
}
var dir = endPoint - startPoint;
//StartCoroutine(DebugDispersion(startPoint, endPoint));
var rotation = Quaternion.LookRotation(dir);
GameObject bulletObject = null;
var velocityChanged = 0f;
if (projectile == null)
{
Debug.LogError($"<color=red>WEAPON ERROR:</color> No Projectile Prefab assigned to {gameObject.name}!");
return;
}
Debug.Log($"<color=white>WEAPON SHOOT:</color> Spawning projectile. HitLayer: {hitLayer.value}");
if (dispersion > 0 && projectile)
{
for (int i = 0; i < projectilesPerShot; i++)
@@ -311,6 +355,12 @@ namespace Invector.vShooter
bulletObject = Instantiate(projectile, startPoint, spreadRotation);
var pCtrl = bulletObject.GetComponent<vProjectileControl>();
if (pCtrl == null)
{
Debug.LogError($"<color=red>PROJECTILE ERROR:</color> {projectile.name} does not have vProjectileControl script!");
continue;
}
if (pCtrl.debugTrajetory && i == 0)
{
startPoint.DebugPoint(Color.red, 10, 0.1f);
@@ -338,6 +388,13 @@ namespace Invector.vShooter
{
bulletObject = Instantiate(projectile, startPoint, rotation);
var pCtrl = bulletObject.GetComponent<vProjectileControl>();
if (pCtrl == null)
{
Debug.LogError($"<color=red>PROJECTILE ERROR:</color> {projectile.name} does not have vProjectileControl script!");
return;
}
if (pCtrl.debugTrajetory)
{
startPoint.DebugPoint(Color.red, 10, 0.1f);

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 MiB

View File

@@ -0,0 +1,130 @@
fileFormatVersion: 2
guid: f6c8ebeb4fbe2954ba666fb8de1138f1
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 0
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 16384
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because one or more lines are too long

View File

@@ -31,6 +31,7 @@ TagManager:
- Interactable
- AIAction
- Check
- Ground
layers:
- Default
- TransparentFX