Finished AI , fixed bugs

This commit is contained in:
AlexMamontow 2021-08-08 22:39:13 +03:00
parent b2fb27b639
commit 3ce46a72f1
7 changed files with 561 additions and 439 deletions

View File

@ -685,6 +685,36 @@ MonoBehaviour:
tileOwnerIndex: 0
whoCanEasyGetTile: 0
isBorderTile: 0
--- !u!1 &76720597
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 76720598}
m_Layer: 0
m_Name: ProgressUI_Target
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &76720598
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 76720597}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 3, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1657916562}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &86572945
PrefabInstance:
m_ObjectHideFlags: 0
@ -1032,7 +1062,7 @@ PrefabInstance:
- target: {fileID: 5048506557351598633, guid: 8df6337a574cdad4bb6ec66cc50c6c2b,
type: 3}
propertyPath: m_RootOrder
value: 15
value: 14
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 8df6337a574cdad4bb6ec66cc50c6c2b, type: 3}
@ -1640,7 +1670,7 @@ PrefabInstance:
- target: {fileID: 8972792315067895909, guid: cda7125c8e1c54f4381462bc1f17d4f2,
type: 3}
propertyPath: m_RootOrder
value: 6
value: 5
objectReference: {fileID: 0}
- target: {fileID: 8972792315067895909, guid: cda7125c8e1c54f4381462bc1f17d4f2,
type: 3}
@ -1874,7 +1904,7 @@ Transform:
m_Children:
- {fileID: 526352758}
m_Father: {fileID: 0}
m_RootOrder: 24
m_RootOrder: 23
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &185995048
MonoBehaviour:
@ -3641,7 +3671,7 @@ PrefabInstance:
- target: {fileID: 8298710706611081709, guid: 60480c1f7fb543e4b9144e972e469275,
type: 3}
propertyPath: m_RootOrder
value: 14
value: 13
objectReference: {fileID: 0}
- target: {fileID: 8298710706611081709, guid: 60480c1f7fb543e4b9144e972e469275,
type: 3}
@ -3959,7 +3989,7 @@ PrefabInstance:
- target: {fileID: 3517096866996221093, guid: f873683fcfd25ff4990dd0725fd40b04,
type: 3}
propertyPath: m_RootOrder
value: 12
value: 11
objectReference: {fileID: 0}
- target: {fileID: 3517096866996221093, guid: f873683fcfd25ff4990dd0725fd40b04,
type: 3}
@ -4786,7 +4816,7 @@ PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_TransformParent: {fileID: 1657916562}
m_Modifications:
- target: {fileID: -4568693640035559416, guid: f102085e8bc4cad4992d43b84dee1055,
type: 3}
@ -4801,12 +4831,12 @@ PrefabInstance:
- target: {fileID: 7150739129758644021, guid: f102085e8bc4cad4992d43b84dee1055,
type: 3}
propertyPath: m_RootOrder
value: 3
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7150739129758644021, guid: f102085e8bc4cad4992d43b84dee1055,
type: 3}
propertyPath: m_LocalPosition.x
value: 3.74
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7150739129758644021, guid: f102085e8bc4cad4992d43b84dee1055,
type: 3}
@ -4821,7 +4851,7 @@ PrefabInstance:
- target: {fileID: 7150739129758644021, guid: f102085e8bc4cad4992d43b84dee1055,
type: 3}
propertyPath: m_LocalRotation.w
value: 0.9659258
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7150739129758644021, guid: f102085e8bc4cad4992d43b84dee1055,
type: 3}
@ -4831,7 +4861,7 @@ PrefabInstance:
- target: {fileID: 7150739129758644021, guid: f102085e8bc4cad4992d43b84dee1055,
type: 3}
propertyPath: m_LocalRotation.y
value: 0.2588191
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7150739129758644021, guid: f102085e8bc4cad4992d43b84dee1055,
type: 3}
@ -4846,7 +4876,7 @@ PrefabInstance:
- target: {fileID: 7150739129758644021, guid: f102085e8bc4cad4992d43b84dee1055,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 30
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7150739129758644021, guid: f102085e8bc4cad4992d43b84dee1055,
type: 3}
@ -4861,7 +4891,7 @@ PrefabInstance:
- target: {fileID: 7527582019267571087, guid: f102085e8bc4cad4992d43b84dee1055,
type: 3}
propertyPath: m_IsActive
value: 0
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: f102085e8bc4cad4992d43b84dee1055, type: 3}
@ -5185,7 +5215,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 25
m_RootOrder: 24
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &466374034
PrefabInstance:
@ -5997,7 +6027,7 @@ Transform:
m_LocalScale: {x: 8, y: 8, z: 8}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 16
m_RootOrder: 15
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &508187713
PrefabInstance:
@ -6166,7 +6196,7 @@ MonoBehaviour:
canBeAttacked: 1
canBuildHere: 1
buildingOnTile: {fileID: 0}
tileOwnerIndex: 0
tileOwnerIndex: 4
whoCanEasyGetTile: 0
isBorderTile: 0
--- !u!1 &526352757
@ -6213,7 +6243,7 @@ PrefabInstance:
- target: {fileID: 4105471131721419270, guid: 24fe481d133791942ad235ac6f948de1,
type: 3}
propertyPath: m_RootOrder
value: 5
value: 4
objectReference: {fileID: 0}
- target: {fileID: 4105471131721419270, guid: 24fe481d133791942ad235ac6f948de1,
type: 3}
@ -6322,7 +6352,7 @@ MonoBehaviour:
canBeAttacked: 1
canBuildHere: 1
buildingOnTile: {fileID: 0}
tileOwnerIndex: 0
tileOwnerIndex: 4
whoCanEasyGetTile: 0
isBorderTile: 0
--- !u!1001 &539454218
@ -7056,6 +7086,105 @@ MonoBehaviour:
tileOwnerIndex: 0
whoCanEasyGetTile: 0
isBorderTile: 0
--- !u!1 &571651558
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 571651559}
- component: {fileID: 571651562}
- component: {fileID: 571651561}
- component: {fileID: 571651560}
m_Layer: 0
m_Name: PlayerInfoCanvas
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &571651559
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 571651558}
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_Children: []
m_Father: {fileID: 1657916562}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 2160, y: 1080}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &571651560
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 571651558}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3}
m_Name:
m_EditorClassIdentifier:
m_IgnoreReversedGraphics: 1
m_BlockingObjects: 0
m_BlockingMask:
serializedVersion: 2
m_Bits: 4294967295
--- !u!114 &571651561
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 571651558}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
m_Name:
m_EditorClassIdentifier:
m_UiScaleMode: 0
m_ReferencePixelsPerUnit: 100
m_ScaleFactor: 1
m_ReferenceResolution: {x: 800, y: 600}
m_ScreenMatchMode: 0
m_MatchWidthOrHeight: 0
m_PhysicalUnit: 3
m_FallbackScreenDPI: 96
m_DefaultSpriteDPI: 96
m_DynamicPixelsPerUnit: 1
m_PresetInfoIsWorld: 1
--- !u!223 &571651562
Canvas:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 571651558}
m_Enabled: 1
serializedVersion: 3
m_RenderMode: 2
m_Camera: {fileID: 1923264935}
m_PlaneDistance: 100
m_PixelPerfect: 0
m_ReceivesEvents: 1
m_OverrideSorting: 0
m_OverridePixelPerfect: 0
m_SortingBucketNormalizedSize: 0
m_AdditionalShaderChannelsFlag: 25
m_SortingLayerID: 0
m_SortingOrder: 0
m_TargetDisplay: 0
--- !u!1 &572316721 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 4991598031878838981, guid: fa5ecf8ffbe22c7459c44494cee176d9,
@ -7294,7 +7423,7 @@ PrefabInstance:
- target: {fileID: 8133904133623688993, guid: 792d79bc559b59f4991d2347b491c743,
type: 3}
propertyPath: m_RootOrder
value: 7
value: 6
objectReference: {fileID: 0}
- target: {fileID: 8133904133623688993, guid: 792d79bc559b59f4991d2347b491c743,
type: 3}
@ -7602,7 +7731,7 @@ PrefabInstance:
- target: {fileID: 3412993055349026426, guid: d3e11f6c636bf1a498f07abd9e0bd885,
type: 3}
propertyPath: m_RootOrder
value: 11
value: 10
objectReference: {fileID: 0}
- target: {fileID: 3412993055349026426, guid: d3e11f6c636bf1a498f07abd9e0bd885,
type: 3}
@ -9074,7 +9203,7 @@ Transform:
- {fileID: 272588901}
- {fileID: 1605217076}
m_Father: {fileID: 0}
m_RootOrder: 21
m_RootOrder: 20
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &747264115
MonoBehaviour:
@ -9640,7 +9769,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 19
m_RootOrder: 18
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &807330786
PrefabInstance:
@ -10159,7 +10288,7 @@ PrefabInstance:
- target: {fileID: 5433028802341862917, guid: 93c05c92bf8823547a10c203ca6a651b,
type: 3}
propertyPath: m_RootOrder
value: 10
value: 9
objectReference: {fileID: 0}
- target: {fileID: 5433028802341862917, guid: 93c05c92bf8823547a10c203ca6a651b,
type: 3}
@ -10696,7 +10825,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 17
m_RootOrder: 16
m_LocalEulerAnglesHint: {x: 135, y: 89.99999, z: 0}
--- !u!1 &868827590 stripped
GameObject:
@ -10975,7 +11104,7 @@ Transform:
m_Children:
- {fileID: 1946816076}
m_Father: {fileID: 0}
m_RootOrder: 23
m_RootOrder: 22
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &913312418 stripped
GameObject:
@ -11427,7 +11556,7 @@ PrefabInstance:
- target: {fileID: 2519293579217985853, guid: b2345bf39a87f434fbdb5a2642b36287,
type: 3}
propertyPath: m_RootOrder
value: 8
value: 7
objectReference: {fileID: 0}
- target: {fileID: 2519293579217985853, guid: b2345bf39a87f434fbdb5a2642b36287,
type: 3}
@ -11838,7 +11967,7 @@ Transform:
m_Children:
- {fileID: 1923264932}
m_Father: {fileID: 0}
m_RootOrder: 18
m_RootOrder: 17
m_LocalEulerAnglesHint: {x: 70, y: 45.000004, z: 0}
--- !u!1001 &965368894
PrefabInstance:
@ -13697,7 +13826,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 20
m_RootOrder: 19
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1102420989
MonoBehaviour:
@ -14968,7 +15097,7 @@ MonoBehaviour:
canBeAttacked: 1
canBuildHere: 1
buildingOnTile: {fileID: 0}
tileOwnerIndex: 0
tileOwnerIndex: 4
whoCanEasyGetTile: 0
isBorderTile: 0
--- !u!1001 &1194815668
@ -15342,7 +15471,7 @@ MonoBehaviour:
canBeAttacked: 1
canBuildHere: 1
buildingOnTile: {fileID: 0}
tileOwnerIndex: 0
tileOwnerIndex: 4
whoCanEasyGetTile: 0
isBorderTile: 0
--- !u!1001 &1234201878
@ -16473,7 +16602,7 @@ MonoBehaviour:
canBeAttacked: 1
canBuildHere: 1
buildingOnTile: {fileID: 0}
tileOwnerIndex: 0
tileOwnerIndex: 4
whoCanEasyGetTile: 0
isBorderTile: 0
--- !u!1 &1333118045 stripped
@ -19056,6 +19185,37 @@ PrefabInstance:
objectReference: {fileID: 2100000, guid: 592213770db2d80419af5780e2a1d20c, type: 2}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: fa5ecf8ffbe22c7459c44494cee176d9, type: 3}
--- !u!1 &1541558860
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1541558861}
m_Layer: 0
m_Name: AttackUI
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1541558861
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1541558860}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0.07, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 2113441893}
m_Father: {fileID: 1657916562}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1552424296 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 4991598031878838981, guid: fa5ecf8ffbe22c7459c44494cee176d9,
@ -20045,6 +20205,12 @@ MonoBehaviour:
tileOwnerIndex: 0
whoCanEasyGetTile: 0
isBorderTile: 1
--- !u!4 &1583925737 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 7150739129758644021, guid: f102085e8bc4cad4992d43b84dee1055,
type: 3}
m_PrefabInstance: {fileID: 427422206}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &1589279167
PrefabInstance:
m_ObjectHideFlags: 0
@ -20983,6 +21149,170 @@ PrefabInstance:
objectReference: {fileID: 2100000, guid: 592213770db2d80419af5780e2a1d20c, type: 2}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: fa5ecf8ffbe22c7459c44494cee176d9, type: 3}
--- !u!1 &1657916561
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1657916562}
- component: {fileID: 1657916570}
- component: {fileID: 1657916569}
- component: {fileID: 1657916568}
- component: {fileID: 1657916567}
- component: {fileID: 1657916566}
- component: {fileID: 1657916565}
- component: {fileID: 1657916564}
- component: {fileID: 1657916563}
m_Layer: 0
m_Name: Enemy_2_Container
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1657916562
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1657916561}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 8.39619, y: 0, z: 8.0791}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 1583925737}
- {fileID: 76720598}
- {fileID: 1541558861}
- {fileID: 571651559}
m_Father: {fileID: 1904687149}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1657916563
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1657916561}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 910a443bbcb74e44cb5ccf12a169accb, type: 3}
m_Name:
m_EditorClassIdentifier:
botState: 0
leftInput: {x: 0, y: 0}
rightInput: {x: 0, y: 0}
agressiveTime: 5
attackTime: 2
enemies: []
_currentEnemy: {fileID: 0}
--- !u!114 &1657916564
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1657916561}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c7a3ec3edb9d17a41810ebf997c51426, type: 3}
m_Name:
m_EditorClassIdentifier:
UIPrefab: {fileID: 853825489494233644, guid: d8e5752261f42474c9e7aa2ed04c75ac, type: 3}
target: {fileID: 76720598}
updateStepInSec: 0.05
--- !u!114 &1657916565
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1657916561}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ff581aacfa68c4645bb27277b1a0dd23, type: 3}
m_Name:
m_EditorClassIdentifier:
_attackUI: {fileID: 1541558861}
_buildUI: {fileID: 526352758}
--- !u!114 &1657916566
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1657916561}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0b1e558538e66434b894cbb9a74b1ff6, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &1657916567
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1657916561}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4b3c4882af86905429c1c42aabf068c1, type: 3}
m_Name:
m_EditorClassIdentifier:
neutralCaptureTime: 1
enemyCaptureTime: 2
fastCaptureTime: 0
_playerState: {fileID: 0}
--- !u!114 &1657916568
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1657916561}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 79c2003192ca6ff43842a1068aa67998, type: 3}
m_Name:
m_EditorClassIdentifier:
attackAction: {fileID: 185995049}
buildAction: {fileID: 185995050}
--- !u!114 &1657916569
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1657916561}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f701310aaea215a4d9e0c8646d3e1ecd, type: 3}
m_Name:
m_EditorClassIdentifier:
nextTileMoveTime: 0.5
moveDistance: 1
--- !u!114 &1657916570
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1657916561}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 87be083c521172a4392e6aeb23c1976c, type: 3}
m_Name:
m_EditorClassIdentifier:
currentState: 0
ownerIndex: 4
currentAction: 0
controlType: 1
currentTile: {fileID: 0}
_selectionTool: {fileID: 185995048}
--- !u!1001 &1659488779
PrefabInstance:
m_ObjectHideFlags: 0
@ -21115,7 +21445,7 @@ PrefabInstance:
- target: {fileID: 1759658675031315366, guid: 0c236e4d8a47b184483f286677455225,
type: 3}
propertyPath: m_RootOrder
value: 9
value: 8
objectReference: {fileID: 0}
- target: {fileID: 1759658675031315366, guid: 0c236e4d8a47b184483f286677455225,
type: 3}
@ -22089,7 +22419,7 @@ MonoBehaviour:
canBeAttacked: 1
canBuildHere: 1
buildingOnTile: {fileID: 0}
tileOwnerIndex: 0
tileOwnerIndex: 4
whoCanEasyGetTile: 0
isBorderTile: 0
--- !u!1 &1753032967 stripped
@ -22198,7 +22528,7 @@ PrefabInstance:
- target: {fileID: 7076342009220790268, guid: 60c19b408bf8a4648b07c7694619d3ff,
type: 3}
propertyPath: m_RootOrder
value: 13
value: 12
objectReference: {fileID: 0}
- target: {fileID: 7076342009220790268, guid: 60c19b408bf8a4648b07c7694619d3ff,
type: 3}
@ -22892,7 +23222,7 @@ RectTransform:
- {fileID: 1467082132}
- {fileID: 1036492595}
m_Father: {fileID: 0}
m_RootOrder: 22
m_RootOrder: 21
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
@ -22988,7 +23318,7 @@ PrefabInstance:
- target: {fileID: 6849494767014095798, guid: 30aaa36462358ce4aaf0d4b514031627,
type: 3}
propertyPath: m_RootOrder
value: 4
value: 3
objectReference: {fileID: 0}
- target: {fileID: 6849494767014095798, guid: 30aaa36462358ce4aaf0d4b514031627,
type: 3}
@ -23257,9 +23587,13 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 910a443bbcb74e44cb5ccf12a169accb, type: 3}
m_Name:
m_EditorClassIdentifier:
botState: 0
leftInput: {x: 0, y: 0}
rightInput: {x: 0, y: 0}
_currentFollowingPath: []
agressiveTime: 5
attackTime: 2
enemies: []
_currentEnemy: {fileID: 0}
--- !u!1 &1826148571 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 4991598031878838981, guid: fa5ecf8ffbe22c7459c44494cee176d9,
@ -24482,8 +24816,9 @@ Transform:
m_Children:
- {fileID: 1801060022}
- {fileID: 1819395262}
- {fileID: 1657916562}
m_Father: {fileID: 0}
m_RootOrder: 26
m_RootOrder: 25
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1911590196
PrefabInstance:
@ -28087,6 +28422,88 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2113031275}
m_CullTransparentMesh: 1
--- !u!1 &2113441892
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2113441893}
- component: {fileID: 2113441894}
m_Layer: 0
m_Name: AttackDirectionSprite
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2113441893
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2113441892}
m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068}
m_LocalPosition: {x: 0, y: 0, z: 1.33}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1541558861}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
--- !u!212 &2113441894
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2113441892}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 0
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: 4c2fb6072e730cd4ab0b39b50aadb418, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 0.33333334}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 9.8, y: 9.7}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!1001 &2118135397
PrefabInstance:
m_ObjectHideFlags: 0

View File

@ -11,12 +11,11 @@ public class AI_Input : MonoBehaviour
public float agressiveTime = 5f;
public float attackTime = 2f;
public Action OnTouchDown, OnTouchUp;
public Action OnCurrentPathFinished;
public Action OnCurrentPathFinished, OnAttack;
public List<PlayerState> enemies;
public PlayerState _currentEnemy;
private List<TileInfo> _currentFollowingPath;
//public List<TileInfo> _testPath;
private PlayerState _playerState;
private TileMovement _tileMovement;
@ -28,9 +27,9 @@ public class AI_Input : MonoBehaviour
_tileMovement = GetComponent<TileMovement>();
_actionManager = GetComponent<PlayerActionManager>();
_actionManager.OnActionEnd += BackToPatrol;
_actionManager.OnActionSuccess += BackToPatrol;
_actionManager.OnActionStart += OnActionStart;
//_playerState.OnCharStateChanged += RecalculatePath;
_tileMovement.OnFinishMovement += CheckState;
_tileMovement.OnStartMovement += StopJoystick;
_playerState.OnInitializied += StartPatrolBehaviour;
@ -40,8 +39,15 @@ public class AI_Input : MonoBehaviour
SetEnemies();
}
private void BackToPatrol(ActionType arg1, CharacterState arg2)
private void OnActionStart(ActionType arg1, CharacterState arg2)
{
_currentEnemy = null;
}
private void BackToPatrol()
{
Debug.Log("attack ended");
StopAllCoroutines();
StartPatrolBehaviour();
}
@ -55,7 +61,6 @@ public class AI_Input : MonoBehaviour
enemies.Add(player);
}
}
//Debug.Log("added " + enemies.Count);
}
private void StopJoystick(ActionType arg1, CharacterState arg2)
@ -67,55 +72,24 @@ public class AI_Input : MonoBehaviour
{
if (_currentFollowingPath.Count > 0)
{
leftInput = TileManagment.GetJoystickDirection(_playerState.currentTile, tile);
leftInput = TileManagment.GetDirection(_playerState.currentTile, tile);
}
}
private void StartPatrolBehaviour()
{
_currentEnemy = null;
botState = BotState.Patrol;
TileInfo targetTile = TileManagment.GetRandomOtherTile(_playerState.ownerIndex);
//Debug.Log("move to " + targetTile.name);
var startTile = _playerState.currentTile;
_currentFollowingPath = Pathfinding.FindPath(startTile, targetTile, TileManagment.levelTiles, TileManagment.tileOffset);
Pathfinding.FindPath(_playerState.currentTile, TileManagment.GetTile(enemies[0].transform.position), TileManagment.levelTiles, TileManagment.tileOffset);
if (_currentFollowingPath == null)
{
StartPatrolBehaviour();
}
MoveTo(_currentFollowingPath[1]);
}
private IEnumerator CalmDown(float time)
{
yield return new WaitForSeconds(time);
_currentEnemy = null;
StartPatrolBehaviour();
StopAllCoroutines();
}
private IEnumerator TryToAttack(float attackCoolDown)
{
while (_currentEnemy)
{
_actionManager.AttackEnemyOnTile(_currentEnemy.currentTile);
yield return new WaitForSeconds(attackCoolDown);
}
}
private void SetBehaviour(BotState state)
{
switch (state)
{
case BotState.Patrol:
MoveToNextPoint();
break;
case BotState.Agressive:
MoveToEnemy(_currentEnemy);
break;
case BotState.Attack:
AttackEnemy(_currentEnemy);
break;
}
}
private void CheckState(ActionType newType, CharacterState newState)
{
foreach (PlayerState enemy in enemies)
@ -151,13 +125,30 @@ public class AI_Input : MonoBehaviour
SetBehaviour(botState);
}
private void SetBehaviour(BotState state)
{
switch (state)
{
case BotState.Patrol:
MoveToNextPoint();
break;
case BotState.Agressive:
MoveToEnemy(_currentEnemy);
break;
case BotState.Attack:
AttackEnemy(_currentEnemy);
break;
}
}
private void AttackEnemy(PlayerState currentEnemy)
{
Debug.Log("attacking");
leftInput = Vector2.zero;
_currentFollowingPath.Clear();
//_actionManager.AttackEnemyOnTile(currentEnemy.currentTile);
StartCoroutine(TryToAttack(0.2f));
StartCoroutine(CalmDown(attackTime));
//StartCoroutine(CalmDown(attackTime));
}
private void MoveToEnemy(PlayerState currentEnemy)
@ -173,7 +164,7 @@ public class AI_Input : MonoBehaviour
}
}
TileInfo currentPos = TileManagment.GetTile(transform.position);
Debug.Log(adjacentTarget);
//Debug.Log(adjacentTarget);
RecalculatePath(currentPos, adjacentTarget);
if (_currentFollowingPath == null)
{
@ -210,9 +201,31 @@ public class AI_Input : MonoBehaviour
_currentFollowingPath = Pathfinding.FindPath(currentTile, endTile, TileManagment.levelTiles, TileManagment.tileOffset);
MoveTo(_currentFollowingPath[1]);
}
else
{
OnCurrentPathFinished?.Invoke();
}
}
private IEnumerator CalmDown(float time)
{
yield return new WaitForSeconds(time);
_currentEnemy = null;
StartPatrolBehaviour();
StopAllCoroutines();
}
private IEnumerator TryToAttack(float attackCoolDown)
{
while (_currentEnemy)
{
Debug.Log("try attack");
_actionManager.AttackEnemyOnTile(_currentEnemy.currentTile);
yield return new WaitForSeconds(attackCoolDown);
}
}
public enum BotState
{
Patrol,

View File

@ -11,7 +11,7 @@ public class PlayerActionManager : MonoBehaviour
public Action<ActionType, CharacterState> OnActionStart, OnActionEnd;
public Action<TileInfo, ActionType> OnFoundTarget;
public Action OnLostTarget;
public Action OnLostTarget, OnActionSuccess;
private PlayerState _playerState;
private PlayerAction _currentAction;
@ -103,6 +103,7 @@ public class PlayerActionManager : MonoBehaviour
}
else
{
Debug.Log("failed attack");
OnActionEnd?.Invoke(ActionType.Attack, _playerState.currentState);
}
}
@ -139,6 +140,7 @@ public class PlayerActionManager : MonoBehaviour
private void FinalActionOperations(PlayerAction action)
{
OnActionEnd?.Invoke(ActionType.Attack, CharacterState.Idle);
OnActionSuccess?.Invoke();
_target = null;
Debug.Log(action.actionType + " ended");
}

View File

@ -69,10 +69,12 @@ public class TileManagment : MonoBehaviour
public void ChangeTileOwner(TileInfo tile, TileOwner ownerIndex)
{
TileOwner oldOwner = tile.tileOwnerIndex;
tile.tileOwnerIndex = ownerIndex;
tile.GetComponent<Renderer>().material = tileMaterials[(int)tile.tileOwnerIndex];
charTiles[(int)ownerIndex].Add(tile);
charTiles[(int)oldOwner].Remove(tile);
//Debug.Log(GetOtherTiles(tile).Count);
CheckSurroundedTiles(levelTiles, ownerIndex, tile);
@ -134,13 +136,13 @@ public class TileManagment : MonoBehaviour
return otherTiles;
}
public static Vector2 GetJoystickDirection(TileInfo currentTile, TileInfo adjacentTile)
public static Vector2 GetDirection(TileInfo currentTile, TileInfo adjacentTile)
{
if (!currentTile || !adjacentTile)
return Vector2.zero;
Vector3 dir3 = adjacentTile.tilePosition - currentTile.tilePosition;
Vector2 dir2 = new Vector2(dir3.x, dir3.z);
return dir2;
return dir2.normalized;
}
public static List<TileInfo> GetAllAdjacentTiles(TileInfo currentTile)
@ -159,6 +161,22 @@ public class TileManagment : MonoBehaviour
return allTiles;
}
public static List<TileInfo> GetAllAdjacentTiles(TileInfo currentTile, TileOwner ownerIndex)
{
List<TileInfo> allTiles = new List<TileInfo>();
//int notMyTiles = 0;
foreach (Vector3 dir in basicDirections)
{
var tile = GetTile(currentTile.tilePosition + dir * tileOffset);
if (tile && ownerIndex == tile.tileOwnerIndex)
{
allTiles.Add(tile);
}
}
//Debug.Log("We have " + notMyTiles + " not my tiles around " + currentTile.name);
return allTiles;
}
public static TileInfo GetRandomOtherTile(TileOwner owner)
{
int randomIndex = UnityEngine.Random.Range(0, levelTiles.Count - 1);

View File

@ -47,7 +47,9 @@ public class UI_ProgressBar : MonoBehaviour
_captureController.OnCaptureFailed += OnCaptureFailed;
_playerActions.OnActionStart += OnActionStart;
_playerActions.OnActionEnd += OnActionStop;
_playerActions.OnActionSuccess += OnActionStop;
}
@ -55,11 +57,12 @@ public class UI_ProgressBar : MonoBehaviour
{
if (_isCaptureUIUpdating)
{
_isCaptureUIUpdating = false;
StopUpdate();
}
}
private void OnActionStop(ActionType action, CharacterState arg2)
private void OnActionStop()
{
StopUpdate();
}
@ -96,9 +99,12 @@ public class UI_ProgressBar : MonoBehaviour
private void OnStartUpdate()
{
_ui.gameObject.SetActive(true);
if (_currentCoroutine == null)
{
_currentCoroutine = Updating(updateStepInSec);
StartCoroutine(_currentCoroutine);
}
}
private IEnumerator Updating(float timeInterval)
{

File diff suppressed because one or more lines are too long