Attack VFX, fixed some AI bugs

This commit is contained in:
AlexMamontow 2021-08-17 18:50:32 +03:00
parent 7faeb7ef42
commit 9f0458ce3d
29 changed files with 2134 additions and 653 deletions

View File

@ -101,7 +101,7 @@ AnimatorState:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Attack
m_Speed: 1
m_Speed: 1.5
m_CycleOffset: 0
m_Transitions:
- {fileID: -7332425835987097042}
@ -162,19 +162,19 @@ 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_AnimatorLayers:
- serializedVersion: 5
m_Name: Base Layer

View File

@ -38,7 +38,7 @@ RenderSettings:
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 705507994}
m_IndirectSpecularColor: {r: 0.44657844, g: 0.49641222, b: 0.57481694, a: 1}
m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
@ -449,8 +449,8 @@ Transform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 963194225}
m_LocalRotation: {x: 0.20519553, y: 0.41571057, z: -0.09685282, w: 0.88073784}
m_LocalPosition: {x: 465.2216, y: 241.85352, z: 4.794298}
m_LocalRotation: {x: 0.4342283, y: 0.061518036, z: -0.029702172, w: 0.8982088}
m_LocalPosition: {x: -1.3266919, y: 2.8500364, z: -2.2343285}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

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

View File

@ -24096,7 +24096,7 @@ ParticleSystem:
serializedVersion: 7
lengthInSec: 1
simulationSpeed: 1
stopAction: 0
stopAction: 2
cullingMode: 3
ringBufferMode: 0
ringBufferLoopRange: {x: 0, y: 1}

View File

@ -19197,7 +19197,7 @@ Transform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8619867339336636724}
m_LocalRotation: {x: -0.7071068, y: 0, z: 0, w: 0.7071067}
m_LocalRotation: {x: -0.7069834, y: 0, z: 0, w: 0.7072302}
m_LocalPosition: {x: 0, y: 0.01, z: 0}
m_LocalScale: {x: 0.7, y: 0.7, z: 0.7}
m_Children:
@ -19207,7 +19207,7 @@ Transform:
- {fileID: 8619867339336380802}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: -89.980194, y: 0, z: 0}
m_LocalEulerAnglesHint: {x: -89.98, y: 0, z: 0}
--- !u!198 &8619867339351544610
ParticleSystem:
m_ObjectHideFlags: 0
@ -19218,7 +19218,7 @@ ParticleSystem:
serializedVersion: 7
lengthInSec: 1
simulationSpeed: 1
stopAction: 0
stopAction: 2
cullingMode: 3
ringBufferMode: 0
ringBufferLoopRange: {x: 0, y: 1}

View File

@ -4937,7 +4937,7 @@ ParticleSystem:
serializedVersion: 7
lengthInSec: 5
simulationSpeed: 1
stopAction: 0
stopAction: 2
cullingMode: 1
ringBufferMode: 0
ringBufferLoopRange: {x: 0, y: 1}

View File

@ -0,0 +1,155 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &8121987183708165570
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8121987183708165574}
- component: {fileID: 8121987183708165575}
- component: {fileID: 8121987183708165572}
- component: {fileID: 7753954604400329794}
m_Layer: 0
m_Name: StandartAttackProjectile
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &8121987183708165574
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8121987183708165570}
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:
- {fileID: 3560900723245820978}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!135 &8121987183708165575
SphereCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8121987183708165570}
m_Material: {fileID: 0}
m_IsTrigger: 1
m_Enabled: 1
serializedVersion: 2
m_Radius: 0.3
m_Center: {x: 0, y: 1, z: 0}
--- !u!54 &8121987183708165572
Rigidbody:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8121987183708165570}
serializedVersion: 2
m_Mass: 1
m_Drag: 0
m_AngularDrag: 0
m_UseGravity: 0
m_IsKinematic: 0
m_Interpolate: 0
m_Constraints: 0
m_CollisionDetection: 0
--- !u!114 &7753954604400329794
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8121987183708165570}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 11daef240d16b1c48838d56466e57228, type: 3}
m_Name:
m_EditorClassIdentifier:
owner: 0
velocity: 10
damage: 500
--- !u!1001 &8121987183007887425
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 8121987183708165574}
m_Modifications:
- target: {fileID: 4746165193703840883, guid: 4e7523811a052fd46acf941fc69c8c98,
type: 3}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4746165193703840883, guid: 4e7523811a052fd46acf941fc69c8c98,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4746165193703840883, guid: 4e7523811a052fd46acf941fc69c8c98,
type: 3}
propertyPath: m_LocalPosition.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4746165193703840883, guid: 4e7523811a052fd46acf941fc69c8c98,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4746165193703840883, guid: 4e7523811a052fd46acf941fc69c8c98,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4746165193703840883, guid: 4e7523811a052fd46acf941fc69c8c98,
type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4746165193703840883, guid: 4e7523811a052fd46acf941fc69c8c98,
type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4746165193703840883, guid: 4e7523811a052fd46acf941fc69c8c98,
type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4746165193703840883, guid: 4e7523811a052fd46acf941fc69c8c98,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4746165193703840883, guid: 4e7523811a052fd46acf941fc69c8c98,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4746165193703840883, guid: 4e7523811a052fd46acf941fc69c8c98,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4746165193704193263, guid: 4e7523811a052fd46acf941fc69c8c98,
type: 3}
propertyPath: m_Name
value: StandartAttack
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 4e7523811a052fd46acf941fc69c8c98, type: 3}
--- !u!4 &3560900723245820978 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 4746165193703840883, guid: 4e7523811a052fd46acf941fc69c8c98,
type: 3}
m_PrefabInstance: {fileID: 8121987183007887425}
m_PrefabAsset: {fileID: 0}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: a69f2bfc3db12bf429b2420ae3b5ca1d
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,340 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &6574093770988502005
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6574093770988502006}
- component: {fileID: 6574093770988502000}
- component: {fileID: 6574093770988502007}
m_Layer: 0
m_Name: Slider
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &6574093770988502006
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6574093770988502005}
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: 6574093771858033032}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 150, y: 10}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &6574093770988502000
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6574093770988502005}
m_CullTransparentMesh: 1
--- !u!114 &6574093770988502007
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6574093770988502005}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.31999665, g: 1, b: 0.023584902, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: 3a005f0b85cb35a4b80f78f133592569, type: 3}
m_Type: 3
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 0
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &6574093771786895448
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6574093771786895449}
- component: {fileID: 962935407416420353}
m_Layer: 0
m_Name: UI_Health
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &6574093771786895449
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6574093771786895448}
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:
- {fileID: 6574093772248246965}
- {fileID: 6574093771858033032}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &962935407416420353
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6574093771786895448}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: cebe8e1376b6b2c47a1679181730a908, type: 3}
m_Name:
m_EditorClassIdentifier:
_progressSlider: {fileID: 6574093770988502007}
--- !u!1 &6574093771858033039
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6574093771858033032}
- component: {fileID: 6574093771858033034}
- component: {fileID: 6574093771858033033}
m_Layer: 0
m_Name: Bar
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &6574093771858033032
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6574093771858033039}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.01, y: 0.01, z: 0.01}
m_Children:
- {fileID: 6574093770988502006}
m_Father: {fileID: 6574093771786895449}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 150, y: 10}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &6574093771858033034
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6574093771858033039}
m_CullTransparentMesh: 1
--- !u!114 &6574093771858033033
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6574093771858033039}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.745283, g: 0, b: 0, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: 3a005f0b85cb35a4b80f78f133592569, type: 3}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &6574093772248246964
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6574093772248246965}
- component: {fileID: 6574093772248246967}
- component: {fileID: 6574093772248246966}
m_Layer: 0
m_Name: Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &6574093772248246965
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6574093772248246964}
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: 6574093771786895449}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0.51}
m_SizeDelta: {x: 200, y: 50}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &6574093772248246967
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6574093772248246964}
m_CullTransparentMesh: 1
--- !u!114 &6574093772248246966
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6574093772248246964}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
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:
m_Calls: []
m_text: '
'
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 0161d805a3764c089bef00bfe00793f5, type: 2}
m_sharedMaterial: {fileID: 2147374, guid: 0161d805a3764c089bef00bfe00793f5, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 0.39
m_fontSizeBase: 0.39
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_HorizontalAlignment: 2
m_VerticalAlignment: 512
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 91362a5819664c44393acb2d057ad719
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -38,7 +38,6 @@ public class AI_Input : MonoBehaviour
_actionManager.OnActionSuccess += BackToPatrol;
_actionManager.OnActionStart += OnActionStart;
//_tileMovement.OnFinishMovement += CheckState;
_tileMovement.OnStartMovement += StopJoystick;
_playerState.OnInitializied += StartPatrolBehaviour;
@ -46,8 +45,6 @@ public class AI_Input : MonoBehaviour
_playerState.OnDeath += StopAllActions;
//_captureController.OnCaptureEnd += SetNewTarget;
_startBotPoint = transform.position;
//Debug.Log(_startBotPoint);
@ -60,8 +57,9 @@ public class AI_Input : MonoBehaviour
private void StopAllActions()
{
botState = BotState.Patrol;
StopAllCoroutines();
CancelInvoke();
//CancelInvoke();
}
private void Start()
@ -84,7 +82,7 @@ public class AI_Input : MonoBehaviour
{
//Debug.Log("bot " + gameObject.name + " started");
//InvokeRepeating("CheckState", UnityEngine.Random.Range(0.5f, 1f), updateBehaviourIn); //to make not the same start
StartCoroutine(CheckBotState(updateBehaviourIn));
StartCoroutine(CheckBotState(updateBehaviourIn));
}
private void OnActionStart(ActionType arg1, CharacterState arg2)
@ -94,8 +92,7 @@ public class AI_Input : MonoBehaviour
private void BackToPatrol()
{
Debug.Log("attack ended");
StopCoroutine(_attackCoroutine);
Debug.Log("back to patrol");
StartPatrolBehaviour();
//StartCoroutine(CheckBotState(updateBehaviourIn));
}
@ -116,6 +113,7 @@ public class AI_Input : MonoBehaviour
private void StartPatrolBehaviour()
{
//Debug.Log("start Patrol");
_currentEnemy = null;
botState = BotState.Patrol;
//TileInfo targetTile = TileManagment.GetRandomOtherTile(_playerState.ownerIndex);
@ -133,23 +131,33 @@ public class AI_Input : MonoBehaviour
private void CheckState(/*ActionType newType, CharacterState newState*/)
{
//Debug.Log("Check state");
if (_playerState.currentState == CharacterState.Dead)
return;
foreach (PlayerState enemy in _playerState.enemies)
{
if (Vector3.Distance(enemy.transform.position, transform.position) <= TileManagment.tileOffset*1.1f)
{
//Debug.Log("attack state");
botState = BotState.Attack;
_currentEnemy = enemy;
break;
}
}
if (botState == BotState.Patrol)
/*if (botState.currentState == CharacterState.Dead)
return;*/
if (botState != BotState.Attack)
{
foreach (PlayerState enemy in _playerState.enemies)
{
{
if (!enemy.gameObject.activeSelf)
{
continue;
}
if (Vector3.Distance(enemy.transform.position, transform.position) <= TileManagment.tileOffset * 1.1f)
{
//Debug.Log("attack state");
botState = BotState.Attack;
_currentEnemy = enemy;
break;
}
}
}
if (botState == BotState.Patrol)
{
foreach (PlayerState enemy in _playerState.enemies)
{
if (!enemy.gameObject.activeSelf)
{
continue;
}
foreach (TileInfo tile in TileManagment.charTiles[(int)_playerState.ownerIndex])
{
if ((enemy.transform.position - tile.tilePosition).magnitude < Mathf.Epsilon)
@ -169,6 +177,7 @@ public class AI_Input : MonoBehaviour
}
if (_currentEnemy != null)
{
//Debug.Log("found enemy");
break;
}
}
@ -196,11 +205,15 @@ public class AI_Input : MonoBehaviour
private void AttackEnemy(PlayerState currentEnemy)
{
//Debug.Log("attacking");
leftInput = Vector2.zero;
_currentFollowingPath.Clear();
_attackCoroutine = TryToAttack(0.2f);
StartCoroutine(_attackCoroutine);
if (currentEnemy)
{
//Debug.Log("startAttack");
leftInput = Vector2.zero;
_currentFollowingPath.Clear();
//_attackCoroutine = TryToAttack(0.2f);
//StartCoroutine(_attackCoroutine);
_actionManager.AttackEnemyOnTile(_currentEnemy.currentTile);
}
}
private void MoveToEnemy(PlayerState currentEnemy)
@ -234,7 +247,7 @@ public class AI_Input : MonoBehaviour
private void MoveToNextPoint()
{
Debug.Log("try to move next point");
//Debug.Log("try to move next point");
if (_currentFollowingPath != null) //when stop movement, calculating path that begins from target tile
{
if (_playerState.currentTile.tileOwnerIndex == _playerState.ownerIndex)
@ -256,7 +269,7 @@ public class AI_Input : MonoBehaviour
_currentFollowingPath.Clear();
_currentFollowingPath = Pathfinding.FindPath(currentTile, endTile, TileManagment.levelTiles, TileManagment.tileOffset);
MoveTo(_currentFollowingPath[1]);
Debug.Log("moving");
//Debug.Log("moving");
}
}
@ -277,16 +290,11 @@ public class AI_Input : MonoBehaviour
private IEnumerator TryToAttack(float attackCoolDown)
{
while (_currentEnemy && Vector3.Distance(_currentEnemy.transform.position, transform.position) <= TileManagment.tileOffset * 1.1f)
{
//Debug.Log("try attack");
if (_currentEnemy.currentState != CharacterState.Dead)
{
_actionManager.AttackEnemyOnTile(_currentEnemy.currentTile);
yield return new WaitForSeconds(attackCoolDown);
}
}
_actionManager.AttackEnemyOnTile(_currentEnemy.currentTile);
yield return new WaitForSeconds(attackCoolDown);
BackToPatrol();
StopCoroutine(_attackCoroutine);
_attackCoroutine = null;
//StopAllCoroutines();
}

View File

@ -4,6 +4,8 @@ using UnityEngine;
public class Attack : PlayerAction
{
public GameObject standartAttackPref;
public GameObject standartAttackGroundImpact;
public override bool IsActionAllowed(TileInfo targetTile, PlayerState playerState)
{
if (!targetTile)
@ -12,4 +14,19 @@ public class Attack : PlayerAction
permission = permission && targetTile.canBeAttacked;
return permission;
}
public override void Impact(TileInfo targetTile, TileInfo currentTile, TileOwner owner)
{
base.Impact(targetTile, currentTile, owner);
Vector3 direction = targetTile.tilePosition - currentTile.tilePosition;
InitAttack(currentTile.tilePosition, direction, owner);
}
private void InitAttack(Vector3 startPosition, Vector3 direction, TileOwner projOwner)
{
var currentProjectile = Instantiate(standartAttackPref, startPosition, standartAttackPref.transform.rotation).GetComponent<ProjectileController>();
currentProjectile.SetinitialParams(projOwner, direction, TileManagment.tileOffset);
Instantiate(standartAttackGroundImpact, startPosition, standartAttackGroundImpact.transform.rotation);
}
}

View File

@ -21,4 +21,5 @@ public class Build : PlayerAction
var spawnedTower = Instantiate(selectedPref, targetTile.tilePosition, selectedPref.transform.rotation);
TileManagment.AssignBuildingToTile(targetTile, spawnedTower);
}
}

View File

@ -0,0 +1,43 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class HealthController : MonoBehaviour
{
public float startHealth = 2000f;
public float currentHealth;
[SerializeField]
private UI_Health healthUI;
public GameObject playerImpactVFX, groundImpactVFX;
private void OnEnable()
{
currentHealth = startHealth;
healthUI.UpdateHealthBar(currentHealth, startHealth);
}
public void TakeDamage(float amount)
{
if (currentHealth < 0)
return;
currentHealth -= amount;
healthUI.UpdateHealthBar(currentHealth, startHealth);
Instantiate(playerImpactVFX, transform.position, playerImpactVFX.transform.rotation);
Instantiate(groundImpactVFX, transform.position, groundImpactVFX.transform.rotation);
if (currentHealth <= 0)
{
Die();
}
}
private void Die()
{
PlayerState playerState = GetComponent<PlayerState>();
PlayerDeathController deathController = FindObjectOfType<PlayerDeathController>();
deathController.MakeDead(playerState);
}
}

View File

@ -0,0 +1,16 @@
fileFormatVersion: 2
guid: 64add3e878d8428479aa2da3e467b1b7
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences:
- healthUI: {instanceID: 0}
- playerImpactVFX: {fileID: 2957420090356197408, guid: 5d1244f7b80cadd428a70173a01ce889,
type: 3}
- groundImpactVFX: {fileID: 6794377120831721188, guid: 2e8dc25f6c4c6264e95bc99e5bffa3e5,
type: 3}
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -21,7 +21,12 @@ public class PlayerAction : MonoBehaviour
public virtual void StartActionOperations(TileInfo targetTile)
{
}
}
public virtual void Impact(TileInfo targetTile, TileInfo currentTile, TileOwner owner)
{
}

View File

@ -122,10 +122,16 @@ public class PlayerActionManager : MonoBehaviour
{
//Debug.Log("started cor");
float time = action.duration;
bool actionImpact = false;
_actionProgress = 0f;
float timer = 0f;
while (_actionProgress < 1f)
{
if (_actionProgress > 0.7f && !actionImpact)
{
actionImpact = true;
action.Impact(_target, _playerState.currentTile, _playerState.ownerIndex);
}
timer += Time.fixedDeltaTime;
_actionProgress = timer / time;
yield return new WaitForFixedUpdate();
@ -138,7 +144,7 @@ public class PlayerActionManager : MonoBehaviour
}
private void FinalActionOperations(PlayerAction action)
{
{
OnActionEnd?.Invoke(ActionType.Attack, CharacterState.Idle);
OnActionSuccess?.Invoke();
_target = null;

View File

@ -76,7 +76,7 @@ public class PlayerDeathController : MonoBehaviour
}
}
private void MakeDead(PlayerState player)
public void MakeDead(PlayerState player)
{
int playerIndex = players.IndexOf(player);
lastDeadTime[playerIndex] = Time.time;
@ -121,7 +121,7 @@ public class PlayerDeathController : MonoBehaviour
Instantiate(deathParticles, player.transform.position, deathParticles.transform.rotation);
}
//player.SetNewState(ActionType.Attack, CharacterState.Dead);
player.SetNewState(ActionType.Attack, CharacterState.Dead);
player.OnDeathActions();
List<TileInfo> playerTiles = TileManagment.charTiles[(int)player.ownerIndex];
TileInfo currentTile = TileManagment.GetTile(player.transform.position);
@ -134,7 +134,7 @@ public class PlayerDeathController : MonoBehaviour
}
}
player.gameObject.SetActive(false);
Debug.Log("player " + player.name + " dead");
//Debug.Log("player " + player.name + " dead");
}
private void PlayerResActions(PlayerState player)
@ -148,14 +148,14 @@ public class PlayerDeathController : MonoBehaviour
}
player.gameObject.SetActive(true);
//player.SetNewState(ActionType.Attack, CharacterState.Idle);
player.SetNewState(ActionType.Attack, CharacterState.Idle);
player.currentTile = GetAvailableResPos(player, playerTiles);
player.transform.position = player.currentTile.tilePosition;
player.currentTile.canMove = false;
//player.transform.position = TileManagment.GetRandomOtherTile(player.ownerIndex).tilePosition;
//player.SetStartParams();
Debug.Log("player " + player.name + " res");
//Debug.Log("player " + player.name + " res");
if (resParticles)
{

View File

@ -119,7 +119,7 @@ public class PlayerState : MonoBehaviour
public void OnDeathActions()
{
OnDeath?.Invoke();
OnDeath?.Invoke();
}
}

View File

@ -0,0 +1,80 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ProjectileController : MonoBehaviour
{
public TileOwner owner = TileOwner.Neutral;
public float velocity = 10f;
public float damage = 100f;
private Rigidbody _rb;
private bool _isMoving = false;
private float _tileOffset;
private TileOwner _enemy = TileOwner.Neutral;
private void Awake()
{
_rb = GetComponent<Rigidbody>();
}
private void FixedUpdate()
{
if (!_isMoving)
return;
CheckProjectileState();
}
private void CheckProjectileState()
{
var currentTile = TileManagment.GetTile(transform.position);
if (!currentTile)
return;
var currentTileOwnerIndex = currentTile.tileOwnerIndex;
if (currentTileOwnerIndex != owner)
{
if (currentTileOwnerIndex == TileOwner.Neutral)
{
Destroy(gameObject);
}
else
{
if (_enemy == TileOwner.Neutral)
{
_enemy = currentTileOwnerIndex;
//Debug.Log(_enemy);
}
if (currentTileOwnerIndex != _enemy)
{
//Debug.Log("another tile");
Destroy(gameObject);
}
}
}
}
public void SetinitialParams(TileOwner owner, Vector3 direction, float tileOffset)
{
_isMoving = true;
_rb.velocity = direction.normalized * velocity;
_tileOffset = tileOffset;
this.owner = owner;
transform.LookAt(direction);
}
private void OnTriggerEnter(Collider other)
{
//Debug.Log("collision");
var healthController = other.gameObject.GetComponent<HealthController>();
var playerState = other.gameObject.GetComponent<PlayerState>();
if (healthController && owner!=playerState.ownerIndex)
{
healthController.TakeDamage(damage);
//Destroy(gameObject);
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 11daef240d16b1c48838d56466e57228
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,45 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ProjectileInfo : MonoBehaviour
{
public TileOwner owner = TileOwner.Neutral;
public float velocity = 10f;
public float damage = 100f;
public GameObject playerImpactVFX, groundImpactVFX;
private Rigidbody _rb;
private bool _isMoving = false;
private float _tileOffset;
private void Awake()
{
_rb = GetComponent<Rigidbody>();
}
private void Update()
{
if (!_isMoving)
return;
CheckProjectileState();
}
private void CheckProjectileState()
{
//check if need delete;
}
public void SetinitialParams(TileOwner owner, Vector3 direction, float tileOffset)
{
_isMoving = true;
_rb.velocity = direction.normalized * velocity;
_tileOffset = tileOffset;
this.owner = owner;
transform.LookAt(direction);
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c095979014abc8f408c5e5addf9ebd5d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -240,67 +240,36 @@ public class TileManagment : MonoBehaviour
public static void CheckSurroundedTiles(List<TileInfo> tiles, TileOwner ownerIndex, TileInfo capTile)
{
//List<TileInfo> firstAdjacentTiles = GetOtherTiles(startTile, ownerIndex);
//List<TileInfo> firstAllAdjacentTiles = GetAllAdjacentTiles(startTile);
//List<TileOwner> differentOwners = new List<TileOwner>();
/*foreach (TileInfo tile in firstAllAdjacentTiles)
{
if (!differentOwners.Contains(tile.tileOwnerIndex) && tile.tileOwnerIndex != TileOwner.Neutral)
{
differentOwners.Add(tile.tileOwnerIndex);
}
}*/
//Debug.Log(differentOwners.Count);
/*foreach (var tileOwnerIndex in differentOwners)
{
foreach (TileInfo tile in firstAllAdjacentTiles)
{
if (tile.tileOwnerIndex != tileOwnerIndex)
{
SetSurroundedTiles(tiles, tileOwnerIndex, tile);
}
}
}*/
/*foreach (TileInfo tile in firstAdjacentTiles)
{
SetSurroundedTiles(tiles, ownerIndex, tile);
}*/
List<TileOwner> checkingOwners = new List<TileOwner>();
checkingOwners.Add(capTile.tileOwnerIndex);
checkingOwners.Add(ownerIndex);
//List<TileOwner> checkingOwners = new List<TileOwner>();
//checkingOwners.Add(capTile.tileOwnerIndex);
//checkingOwners.Add(ownerIndex);
//Debug.Log(checkingOwners[0]);
//Debug.Log(checkingOwners[1]);
foreach (TileInfo tile in levelTiles)
{
/*tile.checkedFor.Clear();
tile.easyCaptureFor.Clear();*/
foreach (TileOwner owner in checkingOwners)
tile.checkedFor.Remove(ownerIndex);
tile.easyCaptureFor.Remove(ownerIndex);
/*foreach (TileOwner owner in checkingOwners)
{
tile.checkedFor.Remove(owner);
tile.easyCaptureFor.Remove(owner);
}
} */
}
foreach (TileInfo tile in levelTiles)
{
if (!tile.isBorderTile)
{
/*foreach (var player in players)
{
if ((!tile.checkedFor.Contains(ownerIndex)) && (tile.tileOwnerIndex != ownerIndex))
{
if ((!tile.checkedFor.Contains(player.ownerIndex)) && (tile.tileOwnerIndex!= player.ownerIndex))
{
CheckIfSurroundedByOwner(tiles, player.ownerIndex, tile);
}
}*/
foreach (TileOwner owner in checkingOwners)
CheckIfSurroundedByOwner(tiles, ownerIndex, tile);
}
/*foreach (TileOwner owner in checkingOwners)
{
if ((!tile.checkedFor.Contains(owner)) && (tile.tileOwnerIndex != owner))
{
CheckIfSurroundedByOwner(tiles, owner, tile);
}
}
}*/
}
}

View File

@ -0,0 +1,28 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class UI_Health : MonoBehaviour
{
[SerializeField]
private Image _progressSlider;
private Transform _mainCam;
private void Start()
{
_mainCam = Camera.main.transform;
}
private void LateUpdate()
{
transform.forward = _mainCam.forward;
}
public void UpdateHealthBar(float currnetHealth, float maxHealth)
{
_progressSlider.fillAmount = currnetHealth / maxHealth;
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: cebe8e1376b6b2c47a1679181730a908
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because one or more lines are too long