added bomb, added capture ability. fixes

This commit is contained in:
dddushesss 2022-01-19 20:56:48 +03:00
parent dbcc62d965
commit 8e35a15691
30 changed files with 470 additions and 226 deletions

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d9a547e8a3df9a3bf32dd0baede1ba4884e2a6ffea5a57ba1860eda8ec4fb78f
size 2190819
oid sha256:f41e6134daef2d77e52bf440ee35e2a71d3808b404fdc8a1ac578efd65565fcf
size 7307994

View File

@ -429,55 +429,55 @@ AnimatorController:
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 0}
m_Controller: {fileID: 9100000}
- m_Name: BackToIdle
m_Type: 9
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 0}
m_Controller: {fileID: 9100000}
- m_Name: Build
m_Type: 9
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 0}
m_Controller: {fileID: 9100000}
- m_Name: TreeAttack
m_Type: 9
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 0}
m_Controller: {fileID: 9100000}
- m_Name: Move
m_Type: 9
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 0}
m_Controller: {fileID: 9100000}
- m_Name: SuperJump
m_Type: 9
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 0}
m_Controller: {fileID: 9100000}
- m_Name: Frozen
m_Type: 9
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 0}
m_Controller: {fileID: 9100000}
- m_Name: isMoving
m_Type: 4
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 0}
m_Controller: {fileID: 9100000}
- m_Name: Death
m_Type: 9
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 0}
m_Controller: {fileID: 9100000}
m_AnimatorLayers:
- serializedVersion: 5
m_Name: Base Layer
@ -763,7 +763,7 @@ AnimatorState:
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 7400000, guid: 097363ae0f4e1f447b1b623e24b9cd2e, type: 2}
m_Motion: {fileID: 7400000, guid: 46c2b6df43404d447aace3726bf397e3, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:

View File

@ -4738,6 +4738,7 @@ GameObject:
- component: {fileID: 6736513976124970964}
- component: {fileID: 6736513976126722542}
- component: {fileID: 6736513976104981120}
- component: {fileID: 254311947008733808}
m_Layer: 0
m_Name: Bomb
m_TagString: Untagged
@ -9562,6 +9563,21 @@ AudioSource:
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 0
--- !u!114 &254311947008733808
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6736513976106828952}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: bfb2f14a56c34dcb80031c2336b24f1b, type: 3}
m_Name:
m_EditorClassIdentifier:
damage: 100
hit: {fileID: 2307028534112872116, guid: 79d768bf87aadec478a5722da8c6d516, type: 3}
timeHit: 1.8
--- !u!1 &6736513976106878902
GameObject:
m_ObjectHideFlags: 0

View File

@ -1,5 +1,30 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1101 &-546070858855015587
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions:
- m_ConditionMode: 1
m_ConditionEvent: Explode
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 1102293829521826198}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.25
m_TransitionOffset: 0
m_ExitTime: 0.625
m_HasExitTime: 1
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!91 &9100000
AnimatorController:
m_ObjectHideFlags: 0
@ -8,7 +33,13 @@ AnimatorController:
m_PrefabAsset: {fileID: 0}
m_Name: Bomb
serializedVersion: 5
m_AnimatorParameters: []
m_AnimatorParameters:
- m_Name: Explode
m_Type: 9
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 0}
m_AnimatorLayers:
- serializedVersion: 5
m_Name: Base Layer
@ -24,7 +55,7 @@ AnimatorController:
m_Controller: {fileID: 9100000}
--- !u!1101 &1101016393745526072
AnimatorStateTransition:
m_ObjectHideFlags: 3
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
@ -376,7 +407,7 @@ AnimatorStateTransition:
m_CanTransitionToSelf: 1
--- !u!1101 &1101570748783259436
AnimatorStateTransition:
m_ObjectHideFlags: 3
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
@ -442,7 +473,7 @@ AnimatorStateTransition:
m_CanTransitionToSelf: 1
--- !u!1101 &1101628936160979654
AnimatorStateTransition:
m_ObjectHideFlags: 3
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
@ -640,7 +671,7 @@ AnimatorStateTransition:
m_CanTransitionToSelf: 1
--- !u!1101 &1101999127345121280
AnimatorStateTransition:
m_ObjectHideFlags: 3
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
@ -662,7 +693,7 @@ AnimatorStateTransition:
m_CanTransitionToSelf: 1
--- !u!1102 &1102017953835933110
AnimatorState:
serializedVersion: 5
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
@ -689,8 +720,8 @@ AnimatorState:
m_TimeParameter:
--- !u!1102 &1102026339988270548
AnimatorState:
serializedVersion: 5
m_ObjectHideFlags: 3
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
@ -716,8 +747,8 @@ AnimatorState:
m_TimeParameter:
--- !u!1102 &1102119963568475716
AnimatorState:
serializedVersion: 5
m_ObjectHideFlags: 3
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
@ -743,7 +774,7 @@ AnimatorState:
m_TimeParameter:
--- !u!1102 &1102290600603978840
AnimatorState:
serializedVersion: 5
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
@ -770,7 +801,7 @@ AnimatorState:
m_TimeParameter:
--- !u!1102 &1102293829521826198
AnimatorState:
serializedVersion: 5
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
@ -797,8 +828,8 @@ AnimatorState:
m_TimeParameter:
--- !u!1102 &1102300038324231582
AnimatorState:
serializedVersion: 5
m_ObjectHideFlags: 3
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
@ -824,8 +855,8 @@ AnimatorState:
m_TimeParameter:
--- !u!1102 &1102342943334615508
AnimatorState:
serializedVersion: 5
m_ObjectHideFlags: 3
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
@ -851,7 +882,7 @@ AnimatorState:
m_TimeParameter:
--- !u!1102 &1102349128289543252
AnimatorState:
serializedVersion: 5
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
@ -878,7 +909,7 @@ AnimatorState:
m_TimeParameter:
--- !u!1102 &1102468043089081518
AnimatorState:
serializedVersion: 5
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
@ -905,7 +936,7 @@ AnimatorState:
m_TimeParameter:
--- !u!1102 &1102469734140886672
AnimatorState:
serializedVersion: 5
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
@ -932,8 +963,8 @@ AnimatorState:
m_TimeParameter:
--- !u!1102 &1102478560215277762
AnimatorState:
serializedVersion: 5
m_ObjectHideFlags: 3
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
@ -959,8 +990,8 @@ AnimatorState:
m_TimeParameter:
--- !u!1102 &1102500793846982196
AnimatorState:
serializedVersion: 5
m_ObjectHideFlags: 3
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
@ -986,7 +1017,7 @@ AnimatorState:
m_TimeParameter:
--- !u!1102 &1102509494326483986
AnimatorState:
serializedVersion: 5
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
@ -996,6 +1027,7 @@ AnimatorState:
m_CycleOffset: 0
m_Transitions:
- {fileID: 1101652252861656132}
- {fileID: -546070858855015587}
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
@ -1013,7 +1045,7 @@ AnimatorState:
m_TimeParameter:
--- !u!1102 &1102560292473526350
AnimatorState:
serializedVersion: 5
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
@ -1040,8 +1072,8 @@ AnimatorState:
m_TimeParameter:
--- !u!1102 &1102573938536894438
AnimatorState:
serializedVersion: 5
m_ObjectHideFlags: 3
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
@ -1067,8 +1099,8 @@ AnimatorState:
m_TimeParameter:
--- !u!1102 &1102643678307240484
AnimatorState:
serializedVersion: 5
m_ObjectHideFlags: 3
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
@ -1094,8 +1126,8 @@ AnimatorState:
m_TimeParameter:
--- !u!1102 &1102655925780863650
AnimatorState:
serializedVersion: 5
m_ObjectHideFlags: 3
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
@ -1121,8 +1153,8 @@ AnimatorState:
m_TimeParameter:
--- !u!1102 &1102678162120579112
AnimatorState:
serializedVersion: 5
m_ObjectHideFlags: 3
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
@ -1148,8 +1180,8 @@ AnimatorState:
m_TimeParameter:
--- !u!1102 &1102707637426974368
AnimatorState:
serializedVersion: 5
m_ObjectHideFlags: 3
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
@ -1175,8 +1207,8 @@ AnimatorState:
m_TimeParameter:
--- !u!1102 &1102827492225288746
AnimatorState:
serializedVersion: 5
m_ObjectHideFlags: 3
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
@ -1202,7 +1234,7 @@ AnimatorState:
m_TimeParameter:
--- !u!1102 &1102855442037948304
AnimatorState:
serializedVersion: 5
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
@ -1229,7 +1261,7 @@ AnimatorState:
m_TimeParameter:
--- !u!1102 &1102867912869228568
AnimatorState:
serializedVersion: 5
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
@ -1256,8 +1288,8 @@ AnimatorState:
m_TimeParameter:
--- !u!1102 &1102878787506406972
AnimatorState:
serializedVersion: 5
m_ObjectHideFlags: 3
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
@ -1283,7 +1315,7 @@ AnimatorState:
m_TimeParameter:
--- !u!1102 &1102884043357014408
AnimatorState:
serializedVersion: 5
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
@ -1310,7 +1342,7 @@ AnimatorState:
m_TimeParameter:
--- !u!1102 &1102892898970591168
AnimatorState:
serializedVersion: 5
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
@ -1336,7 +1368,7 @@ AnimatorState:
m_TimeParameter:
--- !u!1102 &1102903792119357532
AnimatorState:
serializedVersion: 5
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
@ -1363,7 +1395,7 @@ AnimatorState:
m_TimeParameter:
--- !u!1107 &1107240124866355324
AnimatorStateMachine:
serializedVersion: 5
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
@ -1378,7 +1410,7 @@ AnimatorStateMachine:
m_Position: {x: 156, y: -108, z: 0}
- serializedVersion: 1
m_State: {fileID: 1102855442037948304}
m_Position: {x: 444, y: -108, z: 0}
m_Position: {x: 440, y: -110, z: 0}
- serializedVersion: 1
m_State: {fileID: 1102878787506406972}
m_Position: {x: 444, y: -204, z: 0}
@ -1420,7 +1452,7 @@ AnimatorStateMachine:
m_Position: {x: 768, y: 348, z: 0}
- serializedVersion: 1
m_State: {fileID: 1102293829521826198}
m_Position: {x: 768, y: 240, z: 0}
m_Position: {x: 770, y: 240, z: 0}
- serializedVersion: 1
m_State: {fileID: 1102469734140886672}
m_Position: {x: 768, y: 432, z: 0}

View File

@ -552,73 +552,59 @@ PrefabInstance:
m_Modification:
m_TransformParent: {fileID: 1175122412763087250}
m_Modifications:
- target: {fileID: 2591572350827275293, guid: 2e78e06fcf30c0a4993cde911703d443,
type: 3}
- target: {fileID: 2591572350827275293, guid: 2e78e06fcf30c0a4993cde911703d443, type: 3}
propertyPath: m_Materials.Array.size
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2591572351042154496, guid: 2e78e06fcf30c0a4993cde911703d443,
type: 3}
- target: {fileID: 2591572351042154496, guid: 2e78e06fcf30c0a4993cde911703d443, type: 3}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2591572351042154496, guid: 2e78e06fcf30c0a4993cde911703d443,
type: 3}
- target: {fileID: 2591572351042154496, guid: 2e78e06fcf30c0a4993cde911703d443, type: 3}
propertyPath: m_LocalPosition.x
value: -0.083
objectReference: {fileID: 0}
- target: {fileID: 2591572351042154496, guid: 2e78e06fcf30c0a4993cde911703d443,
type: 3}
- target: {fileID: 2591572351042154496, guid: 2e78e06fcf30c0a4993cde911703d443, type: 3}
propertyPath: m_LocalPosition.y
value: 0.023
objectReference: {fileID: 0}
- target: {fileID: 2591572351042154496, guid: 2e78e06fcf30c0a4993cde911703d443,
type: 3}
- target: {fileID: 2591572351042154496, guid: 2e78e06fcf30c0a4993cde911703d443, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2591572351042154496, guid: 2e78e06fcf30c0a4993cde911703d443,
type: 3}
- target: {fileID: 2591572351042154496, guid: 2e78e06fcf30c0a4993cde911703d443, type: 3}
propertyPath: m_LocalRotation.w
value: -0.26092538
objectReference: {fileID: 0}
- target: {fileID: 2591572351042154496, guid: 2e78e06fcf30c0a4993cde911703d443,
type: 3}
- target: {fileID: 2591572351042154496, guid: 2e78e06fcf30c0a4993cde911703d443, type: 3}
propertyPath: m_LocalRotation.x
value: -0.32429546
objectReference: {fileID: 0}
- target: {fileID: 2591572351042154496, guid: 2e78e06fcf30c0a4993cde911703d443,
type: 3}
- target: {fileID: 2591572351042154496, guid: 2e78e06fcf30c0a4993cde911703d443, type: 3}
propertyPath: m_LocalRotation.y
value: 0.029789386
objectReference: {fileID: 0}
- target: {fileID: 2591572351042154496, guid: 2e78e06fcf30c0a4993cde911703d443,
type: 3}
- target: {fileID: 2591572351042154496, guid: 2e78e06fcf30c0a4993cde911703d443, type: 3}
propertyPath: m_LocalRotation.z
value: 0.9087701
objectReference: {fileID: 0}
- target: {fileID: 2591572351042154496, guid: 2e78e06fcf30c0a4993cde911703d443,
type: 3}
- target: {fileID: 2591572351042154496, guid: 2e78e06fcf30c0a4993cde911703d443, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2591572351042154496, guid: 2e78e06fcf30c0a4993cde911703d443,
type: 3}
- target: {fileID: 2591572351042154496, guid: 2e78e06fcf30c0a4993cde911703d443, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2591572351042154496, guid: 2e78e06fcf30c0a4993cde911703d443,
type: 3}
- target: {fileID: 2591572351042154496, guid: 2e78e06fcf30c0a4993cde911703d443, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2591572351042154498, guid: 2e78e06fcf30c0a4993cde911703d443,
type: 3}
- target: {fileID: 2591572351042154498, guid: 2e78e06fcf30c0a4993cde911703d443, type: 3}
propertyPath: m_Materials.Array.size
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2591572351042154621, guid: 2e78e06fcf30c0a4993cde911703d443,
type: 3}
- target: {fileID: 2591572351042154621, guid: 2e78e06fcf30c0a4993cde911703d443, type: 3}
propertyPath: m_Name
value: FX Spark
objectReference: {fileID: 0}
@ -626,8 +612,7 @@ PrefabInstance:
m_SourcePrefab: {fileID: 100100000, guid: 2e78e06fcf30c0a4993cde911703d443, type: 3}
--- !u!4 &3727224336371197390 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 2591572351042154496, guid: 2e78e06fcf30c0a4993cde911703d443,
type: 3}
m_CorrespondingSourceObject: {fileID: 2591572351042154496, guid: 2e78e06fcf30c0a4993cde911703d443, type: 3}
m_PrefabInstance: {fileID: 1175122413194565070}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &8207300010845384218
@ -637,138 +622,111 @@ PrefabInstance:
m_Modification:
m_TransformParent: {fileID: 1175122412763087232}
m_Modifications:
- target: {fileID: 594306107324874188, guid: ef48e21b8db1e4c42bf5cad1512c98d4,
type: 3}
- target: {fileID: 594306107324874188, guid: ef48e21b8db1e4c42bf5cad1512c98d4, type: 3}
propertyPath: EmissionModule.rateOverTime.scalar
value: 5
objectReference: {fileID: 0}
- target: {fileID: 594306107324874188, guid: ef48e21b8db1e4c42bf5cad1512c98d4,
type: 3}
- target: {fileID: 594306107324874188, guid: ef48e21b8db1e4c42bf5cad1512c98d4, type: 3}
propertyPath: InitialModule.startSize.minMaxState
value: 0
objectReference: {fileID: 0}
- target: {fileID: 594306107324874188, guid: ef48e21b8db1e4c42bf5cad1512c98d4,
type: 3}
- target: {fileID: 594306107324874188, guid: ef48e21b8db1e4c42bf5cad1512c98d4, type: 3}
propertyPath: InitialModule.startSizeY.minMaxState
value: 0
objectReference: {fileID: 0}
- target: {fileID: 594306107324874188, guid: ef48e21b8db1e4c42bf5cad1512c98d4,
type: 3}
- target: {fileID: 594306107324874188, guid: ef48e21b8db1e4c42bf5cad1512c98d4, type: 3}
propertyPath: InitialModule.startSizeZ.minMaxState
value: 0
objectReference: {fileID: 0}
- target: {fileID: 594306107324874188, guid: ef48e21b8db1e4c42bf5cad1512c98d4,
type: 3}
- target: {fileID: 594306107324874188, guid: ef48e21b8db1e4c42bf5cad1512c98d4, type: 3}
propertyPath: EmissionModule.m_Bursts.Array.data[0].countCurve.maxCurve.m_Curve.Array.data[0].inWeight
value: 0.33333334
objectReference: {fileID: 0}
- target: {fileID: 594306107324874188, guid: ef48e21b8db1e4c42bf5cad1512c98d4,
type: 3}
- target: {fileID: 594306107324874188, guid: ef48e21b8db1e4c42bf5cad1512c98d4, type: 3}
propertyPath: EmissionModule.m_Bursts.Array.data[0].countCurve.maxCurve.m_Curve.Array.data[1].inWeight
value: 0.33333334
objectReference: {fileID: 0}
- target: {fileID: 594306107324874188, guid: ef48e21b8db1e4c42bf5cad1512c98d4,
type: 3}
- target: {fileID: 594306107324874188, guid: ef48e21b8db1e4c42bf5cad1512c98d4, type: 3}
propertyPath: EmissionModule.m_Bursts.Array.data[0].countCurve.minCurve.m_Curve.Array.data[0].inWeight
value: 0.33333334
objectReference: {fileID: 0}
- target: {fileID: 594306107324874188, guid: ef48e21b8db1e4c42bf5cad1512c98d4,
type: 3}
- target: {fileID: 594306107324874188, guid: ef48e21b8db1e4c42bf5cad1512c98d4, type: 3}
propertyPath: EmissionModule.m_Bursts.Array.data[0].countCurve.minCurve.m_Curve.Array.data[1].inWeight
value: 0.33333334
objectReference: {fileID: 0}
- target: {fileID: 594306107324874188, guid: ef48e21b8db1e4c42bf5cad1512c98d4,
type: 3}
- target: {fileID: 594306107324874188, guid: ef48e21b8db1e4c42bf5cad1512c98d4, type: 3}
propertyPath: EmissionModule.m_Bursts.Array.data[0].countCurve.maxCurve.m_Curve.Array.data[0].outWeight
value: 0.33333334
objectReference: {fileID: 0}
- target: {fileID: 594306107324874188, guid: ef48e21b8db1e4c42bf5cad1512c98d4,
type: 3}
- target: {fileID: 594306107324874188, guid: ef48e21b8db1e4c42bf5cad1512c98d4, type: 3}
propertyPath: EmissionModule.m_Bursts.Array.data[0].countCurve.maxCurve.m_Curve.Array.data[1].outWeight
value: 0.33333334
objectReference: {fileID: 0}
- target: {fileID: 594306107324874188, guid: ef48e21b8db1e4c42bf5cad1512c98d4,
type: 3}
- target: {fileID: 594306107324874188, guid: ef48e21b8db1e4c42bf5cad1512c98d4, type: 3}
propertyPath: EmissionModule.m_Bursts.Array.data[0].countCurve.minCurve.m_Curve.Array.data[0].outWeight
value: 0.33333334
objectReference: {fileID: 0}
- target: {fileID: 594306107324874188, guid: ef48e21b8db1e4c42bf5cad1512c98d4,
type: 3}
- target: {fileID: 594306107324874188, guid: ef48e21b8db1e4c42bf5cad1512c98d4, type: 3}
propertyPath: EmissionModule.m_Bursts.Array.data[0].countCurve.minCurve.m_Curve.Array.data[1].outWeight
value: 0.33333334
objectReference: {fileID: 0}
- target: {fileID: 594306107339981724, guid: ef48e21b8db1e4c42bf5cad1512c98d4,
type: 3}
- target: {fileID: 594306107339981724, guid: ef48e21b8db1e4c42bf5cad1512c98d4, type: 3}
propertyPath: m_RootOrder
value: 9
objectReference: {fileID: 0}
- target: {fileID: 594306107339981724, guid: ef48e21b8db1e4c42bf5cad1512c98d4,
type: 3}
- target: {fileID: 594306107339981724, guid: ef48e21b8db1e4c42bf5cad1512c98d4, type: 3}
propertyPath: m_LocalScale.x
value: 0.37205154
objectReference: {fileID: 0}
- target: {fileID: 594306107339981724, guid: ef48e21b8db1e4c42bf5cad1512c98d4,
type: 3}
- target: {fileID: 594306107339981724, guid: ef48e21b8db1e4c42bf5cad1512c98d4, type: 3}
propertyPath: m_LocalScale.y
value: 0.37205148
objectReference: {fileID: 0}
- target: {fileID: 594306107339981724, guid: ef48e21b8db1e4c42bf5cad1512c98d4,
type: 3}
- target: {fileID: 594306107339981724, guid: ef48e21b8db1e4c42bf5cad1512c98d4, type: 3}
propertyPath: m_LocalScale.z
value: 0.37205154
objectReference: {fileID: 0}
- target: {fileID: 594306107339981724, guid: ef48e21b8db1e4c42bf5cad1512c98d4,
type: 3}
- target: {fileID: 594306107339981724, guid: ef48e21b8db1e4c42bf5cad1512c98d4, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 594306107339981724, guid: ef48e21b8db1e4c42bf5cad1512c98d4,
type: 3}
- target: {fileID: 594306107339981724, guid: ef48e21b8db1e4c42bf5cad1512c98d4, type: 3}
propertyPath: m_LocalPosition.y
value: 0.01
objectReference: {fileID: 0}
- target: {fileID: 594306107339981724, guid: ef48e21b8db1e4c42bf5cad1512c98d4,
type: 3}
- target: {fileID: 594306107339981724, guid: ef48e21b8db1e4c42bf5cad1512c98d4, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 594306107339981724, guid: ef48e21b8db1e4c42bf5cad1512c98d4,
type: 3}
- target: {fileID: 594306107339981724, guid: ef48e21b8db1e4c42bf5cad1512c98d4, type: 3}
propertyPath: m_LocalRotation.w
value: -0.006930769
objectReference: {fileID: 0}
- target: {fileID: 594306107339981724, guid: ef48e21b8db1e4c42bf5cad1512c98d4,
type: 3}
- target: {fileID: 594306107339981724, guid: ef48e21b8db1e4c42bf5cad1512c98d4, type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 594306107339981724, guid: ef48e21b8db1e4c42bf5cad1512c98d4,
type: 3}
- target: {fileID: 594306107339981724, guid: ef48e21b8db1e4c42bf5cad1512c98d4, type: 3}
propertyPath: m_LocalRotation.y
value: 0.999976
objectReference: {fileID: 0}
- target: {fileID: 594306107339981724, guid: ef48e21b8db1e4c42bf5cad1512c98d4,
type: 3}
- target: {fileID: 594306107339981724, guid: ef48e21b8db1e4c42bf5cad1512c98d4, type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 594306107339981724, guid: ef48e21b8db1e4c42bf5cad1512c98d4,
type: 3}
- target: {fileID: 594306107339981724, guid: ef48e21b8db1e4c42bf5cad1512c98d4, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 594306107339981724, guid: ef48e21b8db1e4c42bf5cad1512c98d4,
type: 3}
- target: {fileID: 594306107339981724, guid: ef48e21b8db1e4c42bf5cad1512c98d4, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 594306107339981724, guid: ef48e21b8db1e4c42bf5cad1512c98d4,
type: 3}
- target: {fileID: 594306107339981724, guid: ef48e21b8db1e4c42bf5cad1512c98d4, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 594306107340321050, guid: ef48e21b8db1e4c42bf5cad1512c98d4,
type: 3}
- target: {fileID: 594306107340321050, guid: ef48e21b8db1e4c42bf5cad1512c98d4, type: 3}
propertyPath: m_Name
value: MonsterAura
objectReference: {fileID: 0}
@ -776,7 +734,6 @@ PrefabInstance:
m_SourcePrefab: {fileID: 100100000, guid: ef48e21b8db1e4c42bf5cad1512c98d4, type: 3}
--- !u!4 &8780129905727237510 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 594306107339981724, guid: ef48e21b8db1e4c42bf5cad1512c98d4,
type: 3}
m_CorrespondingSourceObject: {fileID: 594306107339981724, guid: ef48e21b8db1e4c42bf5cad1512c98d4, type: 3}
m_PrefabInstance: {fileID: 8207300010845384218}
m_PrefabAsset: {fileID: 0}

View File

@ -14,12 +14,16 @@ MonoBehaviour:
m_EditorClassIdentifier:
items:
- item: {fileID: 11400000, guid: e7adbedb55c5db341a823370b696f709, type: 2}
_spawnChance: 0.486
_spawnChance: 0.48
- item: {fileID: 11400000, guid: 62849ddbcd32e834887aac5eb3d98db0, type: 2}
_spawnChance: 0.766
_spawnChance: 0.846
- item: {fileID: 11400000, guid: ef628c3158b0ea34bb919ca105507009, type: 2}
_spawnChance: 0.918
- item: {fileID: 11400000, guid: ef628c3158b0ea34bb919ca105507009, type: 2}
_spawnChance: 0.918
_spawnChance: 0.721
- item: {fileID: 11400000, guid: f824f23273de8df429d37f10b51f9a6f, type: 2}
_spawnChance: 0.83
- item: {fileID: 11400000, guid: 133e523fdd159754e8bf8927faec5b0f, type: 2}
_spawnChance: 0.75
- item: {fileID: 11400000, guid: 133e523fdd159754e8bf8927faec5b0f, type: 2}
_spawnChance: 0.756
fromTimeSpawn: 2.93
toTimeSpawn: 10

View File

@ -0,0 +1,17 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
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: f23a091c5733400f8f0092a4c0f33c6e, type: 3}
m_Name: Bomb
m_EditorClassIdentifier:
iconPrefab: {fileID: 8639522512577941448, guid: 7b6a7f64e52da514d88aa97ad8f863df, type: 3}
icon: {fileID: 21300000, guid: 5a80ac41b33ef3f43945efa70e6dfdb0, type: 3}
buildingPrefab: {fileID: 6736513976106828952, guid: 18fb35664a7886842aa1702160b555a8, type: 3}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: f824f23273de8df429d37f10b51f9a6f
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -12,6 +12,8 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 461496314fe84e509ae72dd06538b62c, type: 3}
m_Name: CaptureTAbility
m_EditorClassIdentifier:
iconPrefab: {fileID: 0}
icon: {fileID: 0}
AimCanvas: {fileID: 0}
iconPrefab: {fileID: 3197816592181874056, guid: 2704c4f795b0d7748a3e3fa53be4d893, type: 3}
icon: {fileID: 21300000, guid: 543c4732bd2d47a41bdbbf2156eb358c, type: 3}
aimCanvas: {fileID: 2273039178377770117, guid: 09a0317cbdff9fa479a18c9e20743a8e, type: 3}
itterationMove: 000000000000000000000000040000000500000001000000
animName: SuperJump

View File

@ -68,7 +68,7 @@ namespace Controller
controllers.Add(enemyController);
units.Add(enemy);
AIAgent agent = new AIAgent(unit, enemy);
controllers.Add(agent);
enemy.onPlayerSpawned += x => controllers.Add(agent);
enemy.OnDeath += x => { controllers.Remove(agent); };
enemy.OnDeath += paintedController.PaintOnDeath;
}

View File

@ -11,7 +11,8 @@ namespace GameUI
[SerializeField] private GameObject item;
[SerializeField] private GameObject grid;
public Action<Building> OnBuildingInvoked;
public Action<Item> OnBuildingInvoked;
private List<Button> _buttons;
private Button[] _freeButtons;
@ -38,7 +39,6 @@ namespace GameUI
private void SwitchButton(Button button)
{
var item = _dictionary[button];
button.gameObject.SetActive(false);
for (int i = 0; i < _freeButtons.Length; i++)
@ -69,10 +69,10 @@ namespace GameUI
{
switch (item)
{
case Bonus _bonus:
case Bonus bonus:
{
button.onClick.RemoveAllListeners();
_bonus.Invoke();
bonus.Invoke();
for (int i = 0; i < _freeButtons.Length; i++)
{
if (_freeButtons[i] != null) continue;
@ -83,10 +83,13 @@ namespace GameUI
button.gameObject.SetActive(false);
break;
}
case Building _building:
_building.Invoke(() => SwitchButton(button));
OnBuildingInvoked?.Invoke(_building);
case Building building:
building.Invoke(() => SwitchButton(button));
OnBuildingInvoked?.Invoke(building);
break;
case CaptureAbility ability:
ability.Invoke(() => SwitchButton(button));
OnBuildingInvoked?.Invoke(ability);
break;
}
});

View File

@ -72,7 +72,7 @@ namespace HexFiled
public void SetNeighbor(HexDirection direction, HexCell cell)
{
neighbors[(int)direction] = cell;
cell.neighbors[(int)direction.Opposite()] = this;
cell.neighbors[(int)direction.Back()] = this;
}
public void PaintHex(UnitColor color)

View File

@ -1,25 +1,66 @@
namespace HexFiled
{
public enum HexDirection {
NE, E, SE, SW, W, NW
public enum HexDirection
{
NE,
E,
SE,
SW,
W,
NW
}
public static class HexDirectionExtensions
{
public static HexDirection Opposite(this HexDirection direction)
public static HexDirection Back(this HexDirection direction)
{
return (int)direction < 3 ? (direction + 3) : (direction - 3);
}
public static HexDirection PlusSixtyDeg(this HexDirection direction)
{
return (int) direction < 5? (direction + 1) : (HexDirection)0;
return (int)direction < 5 ? (direction + 1) : (HexDirection)0;
}
public static HexDirection MinusSixtyDeg(this HexDirection direction)
{
return (int)direction > 0 ? (direction - 1) : (HexDirection)5;
}
public static HexDirection Plus120Deg(this HexDirection direction)
{
if ((int)direction < 4)
{
direction = direction + 2;
}
else if ((int)direction == 4)
{
direction = (HexDirection)0;
}
else
{
direction = (HexDirection)1;
}
return direction;
}
public static HexDirection Minus120Deg(this HexDirection direction)
{
if ((int)direction > 1)
{
direction = (direction - 2);
}
else if ((int)direction == 1)
{
direction = (HexDirection)5;
}
else
{
direction = (HexDirection)4;
}
return direction;
}
}
}

View File

@ -18,7 +18,11 @@ namespace HexFiled
public static void GetNearestDifferCell(UnitColor color, Queue<HexDirection> path)
{
HexCell end = UnitCurrentCell[color].cell;
if (!UnitCurrentCell.TryGetValue(color, out var unit))
{
return;
}
HexCell end = unit.cell;
var itters = 0;
var neighbours = end.GetListNeighbours().Where(cell => cell != null && cell.Color != color).ToList();
if (neighbours.Any())
@ -49,17 +53,24 @@ namespace HexFiled
}
public static void PaintHexList(List<HexCell> field, UnitColor color)
public static void PaintHexList(List<HexCell> field, UnitColor color, float time)
{
List<Action<UnitColor>> actions = new List<Action<UnitColor>>();
field.ForEach(x => actions.Add(x.PaintHex));
TimerHelper.Instance.StartTimer(actions, 0.01f, color);
TimerHelper.Instance.StartTimer(actions, time, color);
}
public static void PaintHexList(List<HexCell> field, UnitColor color)
{
List<HexCell> cells = new List<HexCell>();
cells.AddRange(field);
cells.ForEach(x => x.PaintHex(color));
}
}
}

View File

@ -2,7 +2,9 @@ using System;
using System.Collections.Generic;
using System.Linq;
using Units;
using UnityEditor.SearchService;
using UnityEngine;
using UnityEngine.SceneManagement;
using Object = UnityEngine.Object;
using Random = UnityEngine.Random;
@ -20,12 +22,11 @@ namespace HexFiled
public void PaintOnDeath(Unit unit)
{
for (var i = 0; i < HexManager.CellByColor[unit.Color].Count; i++)
HexManager.PaintHexList(HexManager.CellByColor[unit.Color], UnitColor.GREY);
if (HexManager.UnitCurrentCell.Count == 1)
{
HexManager.CellByColor[unit.Color][i].PaintHex(UnitColor.GREY);
SceneManager.LoadScene(1);
}
HexManager.CellByColor.Remove(unit.Color);
}
public void CheckDeathOrDestroy(HexCell cell)
{
@ -45,8 +46,6 @@ namespace HexFiled
{
_cell = cell;
var hexByColorDict = DifferentHexByColor(cell.GetListNeighbours());
foreach (var item in hexByColorDict)
@ -61,7 +60,7 @@ namespace HexFiled
{
var path = Round(x, null);
if(!path.hasPath)
HexManager.PaintHexList(path.field, cell.Color);
HexManager.PaintHexList(path.field, cell.Color, 0.05f);
}
});
}
@ -70,6 +69,10 @@ namespace HexFiled
{
item.Value.ForEach(neighbour =>
{
if (!HexManager.UnitCurrentCell.TryGetValue(neighbour.Color, out var value))
{
return;
}
var (hasPath, field) = HasPath(neighbour, HexManager.UnitCurrentCell[neighbour.Color].cell);
if (!hasPath)
{

View File

@ -22,7 +22,8 @@ namespace Items
{
Unit.UseItem(this);
var obj = SpawnHelper.Spawn(buildingPrefab, cell.transform.position + buildingPrefab.transform.position);
obj.GetComponent<TowerView>().SetUp(Unit.Color);
obj.GetComponent<TowerView>()?.SetUp(Unit.Color);
obj.GetComponent<BombView>()?.SetUp(Unit);
cell.Building = obj.GetComponent<TowerView>();
OnItemUsed?.Invoke();
}

View File

@ -1,37 +1,91 @@
using System;
using System.Collections.Generic;
using DefaultNamespace;
using HexFiled;
using UnityEditor;
using UnityEngine;
using UnityEngine.UI;
using Object = UnityEngine.Object;
namespace Items
{
enum Angls
{
FORWARD,
PLUS60,
MINUS60,
PLUS120,
MINUS120,
BACK
}
[CreateAssetMenu(fileName = "CaptureAbility", menuName = "Item/Ability")]
public class CaptureAbility : Item
{
[SerializeField] private GameObject AimCanvas;
[SerializeField] private GameObject aimCanvas;
[SerializeField] private List<Angls> itterationMove;
[SerializeField] private string animName;
private GameObject _aimInstance;
private HexDirection _direction;
public void Invoke(Action action)
{
OnItemUsed += action;
_aimInstance = SpawnHelper.Spawn(AimCanvas, Vector3.zero, Unit.Instance);
if(_aimInstance == null)
_aimInstance = Object.Instantiate(aimCanvas, Unit.Instance.transform);
else
{
_aimInstance.SetActive(true);
}
}
public void Aim(Vector2 direction)
public void Aim(HexDirection direction)
{
_aimInstance.transform.LookAt(HexManager.UnitCurrentCell[Unit.Color].cell
.GetNeighbor(DirectionHelper.VectorToDirection(direction)).transform);
.GetNeighbor(direction).transform);
_direction = direction;
}
private void DoPaint()
{
Unit.UseItem(this);
var cell = HexManager.UnitCurrentCell[Unit.Color].cell.GetNeighbor(_direction);
cell.PaintHex(Unit.Color);
bool keepGoing = true;
itterationMove.ForEach(dir =>
{
if (!keepGoing) return;
_direction = dir switch
{
Angls.FORWARD => _direction,
Angls.PLUS60 => _direction.PlusSixtyDeg(),
Angls.MINUS60 => _direction.MinusSixtyDeg(),
Angls.PLUS120 => _direction.Plus120Deg(),
Angls.MINUS120 => _direction.Minus120Deg(),
Angls.BACK => _direction.Back(),
_ => throw new ArgumentOutOfRangeException(nameof(dir), dir, null)
};
if (cell.GetNeighbor(_direction) == null)
{
keepGoing = false;
return;
}
cell = cell.GetNeighbor(_direction);
cell.PaintHex(Unit.Color);
});
OnItemUsed?.Invoke();
Unit.UnitView.AnimActionDic[animName] -= DoPaint;
}
public void UseAbility()
{
Unit.UseItem(this);
OnItemUsed?.Invoke();
var cell = HexManager.UnitCurrentCell[Unit.Color].cell.GetNeighbor(_direction);
Unit.RotateUnit(new Vector2((cell.transform.position - Unit.Instance.transform.position).normalized.x,
(cell.transform.position - Unit.Instance.transform.position).normalized.z));
Unit.Animator.SetTrigger(animName);
_aimInstance.SetActive(false);
Unit.UnitView.AnimActionDic[animName] += DoPaint;
}
}
}

View File

@ -20,7 +20,6 @@ namespace Items
protected Unit Unit;
protected Action OnItemUsed;
public UnitColor Color => Unit.Color;

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 471b9b036ae349278ddad4fd6037d281
timeCreated: 1642608267

View File

@ -0,0 +1,36 @@
using System;
using DefaultNamespace;
using HexFiled;
using Units;
using UnityEngine;
namespace Items
{
public class BombView : MonoBehaviour
{
[SerializeField] private int damage;
[SerializeField] private GameObject hit;
[SerializeField] private float timeHit;
private Unit _unit;
public void SetUp(Unit unit)
{
_unit = unit;
gameObject.AddComponent<CapsuleCollider>().radius = HexGrid.HexDistance;
}
private void OnCollisionEnter(Collision collision)
{
var enemy = collision.gameObject.GetComponent<UnitView>();
if (enemy != null && enemy.Color == _unit.Color)
{
var vfx = VFXController.Instance.PlayEffect(hit, transform.position, Quaternion.identity);
vfx.GetComponent<VFXView>().OnTimeInvoke(timeHit, () => enemy.OnHit?.Invoke(damage));
Destroy(gameObject);
}
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: bfb2f14a56c34dcb80031c2336b24f1b
timeCreated: 1642608299

View File

@ -13,5 +13,13 @@ namespace DefaultNamespace
{
return Object.Instantiate(gameObject, pos, Quaternion.identity, parrant.transform);
}
public static GameObject Spawn(GameObject gameObject, GameObject parrant)
{
return Object.Instantiate(gameObject, parrant.transform);
}
public static void Destroy(GameObject obj){
Object.Destroy(obj);
}
}
}

View File

@ -1,4 +1,5 @@
using System;
using System.Diagnostics;
using Controller;
using Data;
using DefaultNamespace;
@ -21,11 +22,10 @@ namespace Chars
private Joystick _placeJoystick;
private Camera _camera;
private Vector2 _attackDircetion;
private HexDirection _placeDirection;
private PlayerInventoryView _inventoryView;
private Building _itemToPlace;
private Item _itemToPlace;
private HexCell _cellToPlace;
public PlayerControl(Unit unit, PlayerControlView joyView, PlayerInventoryView inventoryView)
@ -36,51 +36,60 @@ namespace Chars
_placeJoystick = joyView.PlaceJoystick;
_placeJoystick.gameObject.SetActive(false);
_camera = Camera.main;
_attackJoystick.OnTouchUp += DoAttack;
_attackJoystick.OnDrug += AimCanvas;
inventoryView.SetUpUI(unit.InventoryCapacity);
_unit.OnItemPickUp += PickUp;
_inventoryView = inventoryView;
inventoryView.OnBuildingInvoked += AimPlaceItem;
_placeJoystick.OnDrug += PlaceItemAim;
_placeJoystick.OnTouchUp += PlaceItem;
}
private void AimPlaceItem(Building item)
private void AimPlaceItem(Item item)
{
if (!_unit.IsBusy)
{
_placeJoystick.gameObject.SetActive(true);
_itemToPlace = item;
}
if (_unit.IsBusy) return;
_attackJoystick.gameObject.SetActive(false);
_placeJoystick.gameObject.SetActive(true);
_itemToPlace = item;
}
private void PlaceItem()
{
_unit.UnitView.AimCanvas.SetActive(false);
_placeJoystick.gameObject.SetActive(false);
if (_cellToPlace == null)
switch (_itemToPlace)
{
return;
case Building building:
_unit.UnitView.AimCanvas.SetActive(false);
_placeJoystick.gameObject.SetActive(false);
if (_cellToPlace == null)
{
return;
}
building.PlaceItem(_cellToPlace);
break;
case CaptureAbility ability:
ability.UseAbility();
_placeJoystick.gameObject.SetActive(false);
break;
}
_itemToPlace.PlaceItem(_cellToPlace);
_attackJoystick.gameObject.SetActive(true);
}
private void PickUp(Item item)
{
_inventoryView.PickUpItem(item);
}
private void DoAttack()
{
_unit.UnitView.AimCanvas.SetActive(false);
_unit.StartAttack();
}
private void AimCanvas(Vector2 attackDir)
{
if (!_unit.IsBusy)
@ -92,24 +101,29 @@ namespace Chars
private void PlaceItemAim(Vector2 placeDir)
{
if (!_unit.IsBusy)
if (_unit.IsBusy) return;
switch (_itemToPlace)
{
_unit.UnitView.AimCanvas.SetActive(true);
_cellToPlace = _unit.PlaceItemAim(DirectionHelper.VectorToDirection(placeDir));
case Building building:
_unit.UnitView.AimCanvas.SetActive(true);
_cellToPlace = _unit.PlaceItemAim(DirectionHelper.VectorToDirection(placeDir));
break;
case CaptureAbility ability:
ability.Aim(DirectionHelper.VectorToDirection(placeDir));
break;
}
}
public void FixedExecute()
{
if (!_unit.IsBusy && _moveJoystick.Direction != Vector2.zero)
{
_placeJoystick.gameObject.SetActive(false);
_unit.Move(DirectionHelper.VectorToDirection(_moveJoystick.Direction.normalized));
}
}
}
}

View File

@ -63,6 +63,9 @@ namespace Units
public List<Item> Inventory => _inventory;
public Weapon Weapon => _weapon;
public Animator Animator => _animator;
public Unit(UnitInfo unitData, Weapon weapon, HexGrid hexGrid)
{
_camera = Camera.main;
@ -339,7 +342,7 @@ namespace Units
_animator.SetTrigger("Attack");
}
private void RotateUnit(Vector2 direction)
public void RotateUnit(Vector2 direction)
{
_unitView.transform.DOLookAt(new Vector3(direction.x, 0, direction.y) + _unitView.transform.position,
0.1f).onUpdate += () => BarCanvas.transform.LookAt(

View File

@ -1,6 +1,7 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using Data;
using DefaultNamespace;
using DG.Tweening;
@ -31,22 +32,27 @@ public class UnitView : MonoBehaviour
private Action _startRegen;
private Coroutine _previosRegen;
private Coroutine _previosReload;
private Dictionary<string, Action> animActionDic;
private int _mana;
private Action _capureHex;
private Sequence _sequence;
private AudioSource _audioSource;
private Unit _unit;
private float _hardCaptureTime;
private Action onSupperJump;
public BarCanvas BarCanvas => barCanvas;
public GameObject AimCanvas => aimCanvas;
public UnitColor Color => _unit.Color;
public int AvailableShots => _shootUIStack.Count;
public Dictionary<string, Action> AnimActionDic => animActionDic;
public void SetUp(Stack<ShotUIView> shots, Weapon weapon, Action regenMana, int manaRegen, Action captureHex,
Unit unit, float hardCaptureTime)
{
animActionDic = new Dictionary<string, Action> { { "SuperJump", onSupperJump } };
_shootUIStack = shots;
_weapon = weapon;
_toReloadStack = new Stack<ShotUIView>();
@ -125,6 +131,15 @@ public class UnitView : MonoBehaviour
OnAttack?.Invoke();
}
private void SuperAttack()
{
for (var i = 0; i < animActionDic.Count; i++)
{
var item = animActionDic.ElementAt(i);
item.Value?.Invoke();
}
}
private void OnTriggerEnter(Collider other)
{
WeaponView weaponView = other.GetComponent<WeaponView>();

View File

@ -1,5 +1,6 @@
using System;
using UnityEngine;
using UnityEngine.Rendering;
namespace DefaultNamespace
{
@ -7,6 +8,8 @@ namespace DefaultNamespace
{
private ParticleSystem _system;
public Action OnPlayEnd;
private Action OnTime;
private float timeInvoke;
private void Start()
{
@ -14,6 +17,12 @@ namespace DefaultNamespace
}
public void OnTimeInvoke(float time, Action action)
{
timeInvoke = time;
OnTime += action;
}
private void Update()
{
if (_system != null && !_system.IsAlive())
@ -22,6 +31,11 @@ namespace DefaultNamespace
OnPlayEnd?.Invoke();
Destroy(gameObject);
}
if (timeInvoke > 0f && Math.Abs(_system.time - timeInvoke) < Time.deltaTime)
{
OnTime?.Invoke();
}
}
}
}