Compare commits

2 Commits

Author SHA1 Message Date
af2713a00e Complete Update NPC AI 2026-06-06 02:03:22 +07:00
316a3f7760 Update 2026-06-06 00:54:47 +07:00
13 changed files with 705 additions and 209 deletions

View File

@@ -7,9 +7,15 @@
<list default="true" id="f9183c68-daf0-43b8-be4c-fad79983f91b" name="Changes" comment="">
<change beforePath="$PROJECT_DIR$/.idea/.idea.HALLUCINATE/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.HALLUCINATE/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Prefabs/NPC/xNPC.prefab" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Prefabs/NPC/xNPC.prefab" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Prefabs/Shooter/Player/vShooterMelee_Inventory.prefab" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Prefabs/Shooter/Player/vShooterMelee_Inventory.prefab" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Scripts/AI NPC/AnimatorAI.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/AI NPC/AnimatorAI.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Scripts/AI NPC/KamikazeAI.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/AI NPC/KamikazeAI.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Prefabs/Shooter/Weapon/_weapons_WITHOUT_Inventory/_weaponsPrefabs/vAssaultRifle_NO_Inventory_v2 Variant.prefab" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Prefabs/Shooter/Weapon/_weapons_WITHOUT_Inventory/_weaponsPrefabs/vAssaultRifle_NO_Inventory_v2 Variant.prefab" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Prefabs/Shooter/Weapon/_weapons_WITHOUT_Inventory/_weaponsPrefabs/vHandgun_NO_Inventory Variant.prefab" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Prefabs/Shooter/Weapon/_weapons_WITHOUT_Inventory/_weaponsPrefabs/vHandgun_NO_Inventory Variant.prefab" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Prefabs/Shooter/Weapon/_weapons_WITH_Inventory/_collectables/vCollectableHandgun.prefab" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Prefabs/Shooter/Weapon/_weapons_WITH_Inventory/_collectables/vCollectableHandgun.prefab" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Scenes/Cho môn AI/Only AI.unity" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scenes/Cho môn AI/Only AI.unity" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Scripts/AI NPC/EnemyAI.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/AI NPC/EnemyAI.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Scripts/AI NPC/GeminiService.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/AI NPC/GeminiService.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Scripts/Player/Weapon/vProjectileControl.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/Player/Weapon/vProjectileControl.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Scripts/Player/Weapon/vShooterWeaponBase.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/Player/Weapon/vShooterWeaponBase.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Third Parties/TextMesh Pro/Resources/Fonts &amp; Materials/LiberationSans SDF - Fallback.asset" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Third Parties/TextMesh Pro/Resources/Fonts &amp; Materials/LiberationSans SDF - Fallback.asset" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -103,7 +109,7 @@
<option name="MIXED_MODE_DEBUG" value="0" />
<method v="2" />
</configuration>
<configuration name="Attach to Unity Editor" type="UNITY_DEBUG_RUN_CONFIGURATION" factoryName="Unity Debug" show_console_on_std_err="false" show_console_on_std_out="false" port="50000" address="localhost">
<configuration name="Attach to Unity Editor" type="UNITY_DEBUG_RUN_CONFIGURATION" factoryName="Unity Debug" show_console_on_std_err="false" show_console_on_std_out="false" port="50000" address="localhost" useMixedMode="false">
<option name="allowRunningInParallel" value="false" />
<option name="listenPortForConnections" value="false" />
<option name="pid" />
@@ -114,7 +120,6 @@
<option name="selectedOptions">
<list />
</option>
<option name="useMixedMode" value="false" />
<method v="2" />
</configuration>
<configuration name="Attach to" type="UnityDevicePlayer" factoryName="UnityAttachToDevicePlayer">

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

@@ -225,7 +225,7 @@ GameObject:
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: []
@@ -471,6 +471,8 @@ GameObject:
- component: {fileID: 8239948856752686218}
- component: {fileID: 6469822191588635990}
- component: {fileID: 9027690817715396964}
- component: {fileID: 2252266660326254214}
- component: {fileID: 4329414276869835007}
m_Layer: 0
m_Name: xNPC
m_TagString: Enemy
@@ -509,23 +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.5
patrolRadius: 12
patrolSpeed: 2
patrolRadius: 100
playerHasArtifact: 0
isAggroedBySound: 0
laserPrefab: {fileID: 3965388737199864462, guid: fbec2b501d70daa4c9cb481ba53fc0b8, type: 3}
firePoint: {fileID: 5863061020199015852}
minShootDelay: 1
maxShootDelay: 3
dodgeForce: 8
maxShootDelay: 5
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
@@ -643,10 +650,66 @@ 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}
m_Center: {x: 0, y: 0.92911196, z: 0.11156863}
--- !u!114 &2252266660326254214
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7522161431095319480}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f56a83ea88140fa4f869bb2f7ffdb184, type: 3}
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::Invector.vHealthController
openCloseEvents: 0
openCloseWindow: 1
selectedToolbar: 0
_isDead: 1
_currentHealth: 0
isImmortal: 0
fillHealthOnStart: 1
_maxHealth: 100
_healthRecovery: 0
_healthRecoveryDelay: 0
checkHealthEvents: []
_onStartReceiveDamage:
m_PersistentCalls:
m_Calls: []
_onReceiveDamage:
m_PersistentCalls:
m_Calls: []
_onDead:
m_PersistentCalls:
m_Calls: []
onChangeHealth:
m_PersistentCalls:
m_Calls: []
onResetHealth:
m_PersistentCalls:
m_Calls: []
--- !u!114 &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

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_IsTrigger: 1
m_Enabled: 1
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: 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_IsTrigger: 1
m_Enabled: 1
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: 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

@@ -90393,6 +90393,10 @@ PrefabInstance:
propertyPath: npcName
value: bob
objectReference: {fileID: 0}
- target: {fileID: 8272839718325411334, guid: 15df559ce497e104a81254e0adf3107e, type: 3}
propertyPath: patrolRadius
value: 20
objectReference: {fileID: 0}
- target: {fileID: 8272839718325411334, guid: 15df559ce497e104a81254e0adf3107e, type: 3}
propertyPath: patrolWaypoints.Array.size
value: 2
@@ -90405,6 +90409,10 @@ PrefabInstance:
propertyPath: 'patrolWaypoints.Array.data[1]'
value:
objectReference: {fileID: 665174409}
- target: {fileID: 9027690817715396964, guid: 15df559ce497e104a81254e0adf3107e, type: 3}
propertyPath: m_IsTrigger
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
@@ -90948,6 +90956,14 @@ PrefabInstance:
propertyPath: npcName
value: Guard4
objectReference: {fileID: 0}
- target: {fileID: 8272839718325411334, guid: 15df559ce497e104a81254e0adf3107e, type: 3}
propertyPath: patrolRadius
value: 20
objectReference: {fileID: 0}
- target: {fileID: 9027690817715396964, guid: 15df559ce497e104a81254e0adf3107e, type: 3}
propertyPath: m_IsTrigger
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
@@ -94472,6 +94488,10 @@ PrefabInstance:
propertyPath: npcName
value: Guard1
objectReference: {fileID: 0}
- target: {fileID: 8272839718325411334, guid: 15df559ce497e104a81254e0adf3107e, type: 3}
propertyPath: patrolRadius
value: 20
objectReference: {fileID: 0}
- target: {fileID: 8272839718325411334, guid: 15df559ce497e104a81254e0adf3107e, type: 3}
propertyPath: patrolWaypoints.Array.size
value: 2
@@ -108892,6 +108912,14 @@ PrefabInstance:
propertyPath: npcName
value: Guard3
objectReference: {fileID: 0}
- target: {fileID: 8272839718325411334, guid: 15df559ce497e104a81254e0adf3107e, type: 3}
propertyPath: patrolRadius
value: 20
objectReference: {fileID: 0}
- target: {fileID: 9027690817715396964, guid: 15df559ce497e104a81254e0adf3107e, type: 3}
propertyPath: m_IsTrigger
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
@@ -152418,6 +152446,14 @@ PrefabInstance:
propertyPath: npcName
value: Guard2
objectReference: {fileID: 0}
- target: {fileID: 8272839718325411334, guid: 15df559ce497e104a81254e0adf3107e, type: 3}
propertyPath: patrolRadius
value: 20
objectReference: {fileID: 0}
- target: {fileID: 9027690817715396964, guid: 15df559ce497e104a81254e0adf3107e, type: 3}
propertyPath: m_IsTrigger
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []

View File

@@ -10,9 +10,16 @@ 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ị bắn) --> Panic (Thấp máu) --> Bắn hạ (Chiến đấu) --> Đuổi theo --> Điều tra --> Nói chuyện --> Đi tuần
[RequireComponent(typeof(NavMeshAgent))]
[RequireComponent(typeof(Rigidbody))]
[RequireComponent(typeof(vHealthController))]
@@ -42,30 +49,36 @@ public class EnemyAI : MonoBehaviour
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("Advanced AI States (New)")]
[Header("Advanced AI States")]
public bool isPanicking = false;
public bool isEnraged = false;
public float panicHealthThreshold = 40f; // Dưới 40% máu sẽ panic
public float regenRate = 2f; // Hồi 2 máu mỗi giây
public float regenDelay = 5f; // Cần 5s không nhận dame để bắt đầu hồi
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;
@@ -79,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;
@@ -91,7 +104,7 @@ public class EnemyAI : MonoBehaviour
public float suspicionLevel = 0f;
public float investigationThreshold = 30f;
public float alertNeighborsThreshold = 70f;
public float alertRange = 25f; // Tăng tầm gọi hội
public float alertRange = 30f;
public Node rootNode;
@@ -104,13 +117,28 @@ public class EnemyAI : MonoBehaviour
mainCollider = GetComponent<Collider>();
health = GetComponent<vHealthController>();
// Thiết lập Invector Health
// 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);
// Tự động gán Layer Enemy
if (gameObject.layer == LayerMask.NameToLayer("Default"))
gameObject.layer = LayerMask.NameToLayer("Enemy");
{
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;
@@ -127,16 +155,9 @@ public class EnemyAI : MonoBehaviour
void InitTree()
{
// 1. Phản xạ tức thì (Dodge)
var dodgeSequence = new Sequence(new List<Node> { new TaskNode(CheckDodgeConditions), new TaskNode(ActionDodge) });
// 2. Hoảng loạn (Panic)
var panicSequence = new Sequence(new List<Node> { new TaskNode(CheckPanicConditions), new TaskNode(ActionPanic) });
// 3. Tấn công (Laser)
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) });
// 4. Các hành vi khác
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) });
@@ -158,13 +179,11 @@ public class EnemyAI : MonoBehaviour
{
if (player == null || health.isDead) return;
// Đảm bảo Collider luôn bật
if (mainCollider != null && !mainCollider.enabled) mainCollider.enabled = true;
HandleHealthRegen();
suspicionLevel = Mathf.Max(0, suspicionLevel - Time.deltaTime * 0.5f);
if (suspicionLevel <= 0f && !isEnraged) isAggroedBySound = false;
if (!isTalking && !isDodging && !isPanicking && agent.isStopped)
@@ -177,7 +196,16 @@ public class EnemyAI : MonoBehaviour
{
if (Time.time > lastDamageTime + regenDelay && health.currentHealth < health.maxHealth)
{
health.AddHealth((int)(regenRate * Time.deltaTime));
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));
}
}
@@ -190,17 +218,20 @@ public class EnemyAI : MonoBehaviour
suspicionLevel = 100f;
StopConversation();
// Gọi hội ngay khi bị bắn
// PHẢN ỨNG TỨC THÌ: Alert toàn bộ lân cận
AlertNeighbors(damage.hitPosition);
// Né đòn ngay lập tức khi bị trúng dame (phản xạ Elden Ring)
if (Time.time > nextDodgeTime && !isDodging)
// 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());
}
// Kiểm tra Enrage (Phase 2)
if (health.currentHealth < health.maxHealth * 0.5f && !isEnraged)
// 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();
}
@@ -209,7 +240,12 @@ public class EnemyAI : MonoBehaviour
private void OnDead(GameObject killer)
{
Debug.Log($"<color=black>[AI {npcName}] DIED.</color>");
// Khi chết, làm những con xung quanh Enraged gắt hơn
// 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)
{
@@ -217,7 +253,9 @@ public class EnemyAI : MonoBehaviour
if (ally != null && ally != this) ally.EnterEnrageMode();
}
agent.enabled = false;
// 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;
}
@@ -225,18 +263,13 @@ public class EnemyAI : MonoBehaviour
{
if (isEnraged) return;
isEnraged = true;
isPanicking = false; // Hết sợ, chuyển sang liều mạng
isPanicking = false;
// Buff stats mạnh mẽ như Elden Ring boss phase 2
moveSpeed *= 1.5f;
minShootDelay *= 0.5f;
maxShootDelay *= 0.5f;
maxSpreadAngle *= 0.6f; // Bắn chính xác hơn
approachWeight = 0.8f; // Áp sát cực gắt
minCombatDistance = 2.0f; // Đứng sát mặt Player để bắn
moveSpeed *= 1.3f; // Giảm nhẹ buff speed
minShootDelay *= 0.6f;
maxShootDelay *= 0.6f;
if (chatBubble != null) chatBubble.Show("FOR THE BROTHERHOOD! DIE!", 3f);
Debug.Log($"<color=red>[AI {npcName}] ENRAGED!</color> Stats boosted.");
if (chatBubble != null) chatBubble.Show("I'LL TAKE YOU DOWN WITH ME!", 2f);
}
#endregion
@@ -246,7 +279,7 @@ public class EnemyAI : MonoBehaviour
private NodeState CheckDodgeConditions()
{
if (isDodging) return NodeState.Success;
// Tự né khi thấy Player click chuột trái (đang bắn)
// 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;
@@ -254,11 +287,15 @@ public class EnemyAI : MonoBehaviour
private NodeState CheckPanicConditions()
{
if (isEnraged) return NodeState.Failure; // Đang điên thì không sợ
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;
}
@@ -312,7 +349,7 @@ public class EnemyAI : MonoBehaviour
public void HearNoise(Vector3 location, float volume)
{
suspicionLevel += volume * 15f;
suspicionLevel += volume * 20f;
if (fov != null) fov.lastKnownPlayerPosition = location;
if (suspicionLevel >= investigationThreshold) isAggroedBySound = true;
if (suspicionLevel >= alertNeighborsThreshold) AlertNeighbors(location);
@@ -341,23 +378,34 @@ public class EnemyAI : MonoBehaviour
StopConversation();
}
private NodeState ActionPanic()
// Hành động tháo chạy khi máu thấp
private NodeState ActionRetreat()
{
isPanicking = true;
agent.speed = moveSpeed * 1.3f;
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;
// Chạy trốn khỏi Player đến một điểm ngẫu nhiên xa Player
if (!agent.pathPending && agent.remainingDistance < 1f)
{
Vector3 runDir = (transform.position - player.position).normalized;
Vector3 escapePoint = transform.position + runDir * 10f + Random.insideUnitSphere * 5f;
NavMeshHit hit;
if (NavMesh.SamplePosition(escapePoint, out hit, 10f, 1))
if (NavMesh.SamplePosition(targetPos, out hit, 10f, 1))
{
agent.SetDestination(hit.position);
}
}
if (chatBubble != null && Random.value < 0.01f) chatBubble.Show("HELP! HE'S KILLING US!", 1f);
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;
}
@@ -428,13 +476,11 @@ public class EnemyAI : MonoBehaviour
if (!playerHasArtifact && fov != null && !fov.canSeePlayer && fov.lastKnownPlayerPosition != Vector3.zero)
targetPos = fov.lastKnownPlayerPosition;
// Xoay về phía mục tiêu
Vector3 bodyDir = (targetPos - transform.position);
bodyDir.y = 0f;
if (bodyDir != Vector3.zero)
transform.rotation = Quaternion.Slerp(transform.rotation, Quaternion.LookRotation(bodyDir), rotateSpeed * Time.deltaTime);
// Strafe di chuyển linh hoạt
if (Time.time >= nextStrafeChangeTime)
{
strafeDirectionSign = new int[] { -1, 1, 0 }[Random.Range(0, 3)];
@@ -445,8 +491,10 @@ public class EnemyAI : MonoBehaviour
if (strafeDirectionSign != 0 && bodyDir != Vector3.zero)
{
Vector3 normal = bodyDir.normalized;
moveDir = new Vector3(-normal.z, 0, normal.x) * strafeDirectionSign;
if (Vector3.Distance(transform.position, targetPos) > minCombatDistance) moveDir += normal * approachWeight;
moveDir = new Vector3(-normal.z, 0, normal.x) * strafeDirectionSign * personalStrafeIntensity;
float dist = Vector3.Distance(transform.position, targetPos);
if (dist > personalMinCombatDistance) moveDir += normal * personalApproachWeight;
}
if (moveDir != Vector3.zero)
@@ -460,7 +508,8 @@ public class EnemyAI : MonoBehaviour
if (Time.time >= nextShootTime && !isShootingBurst)
{
StartCoroutine(ShootBurstRoutine(Random.Range(1, isEnraged ? 6 : 4)));
int burstCount = Random.Range(1, (int)personalBurstMax + (isEnraged ? 2 : 0));
StartCoroutine(ShootBurstRoutine(burstCount));
nextShootTime = Time.time + Random.Range(minShootDelay, maxShootDelay);
}
@@ -496,13 +545,13 @@ public class EnemyAI : MonoBehaviour
Vector3 dir = (player.position - transform.position).normalized;
Vector3 perp = new Vector3(-dir.z, 0, dir.x) * (Random.value > 0.5f ? 1 : -1);
rb.AddForce(perp * (isEnraged ? dodgeForce * 1.5f : dodgeForce), ForceMode.Impulse);
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.5f : dodgeCooldown);
nextDodgeTime = Time.time + (isEnraged ? dodgeCooldown * 0.6f : dodgeCooldown);
isDodging = false;
}
@@ -513,9 +562,25 @@ public class EnemyAI : MonoBehaviour
DialogueResult result = JsonUtility.FromJson<DialogueResult>(json);
if (chatBubble != null) chatBubble.Show(result.text);
moveSpeed += result.speedMod;
// Á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); }
}

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

@@ -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;
@@ -294,6 +296,18 @@ namespace Invector.vShooter
}
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);
@@ -303,6 +317,7 @@ namespace Invector.vShooter
previousPosition = transform.position;
}
private void AddTrailPosition()

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,6 +320,18 @@ 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);