Merge branch 'Prod'
# Conflicts: # Assets/Prefab/AimCanvas.prefab # Assets/Prefab/BarCAnvas.prefab # Assets/Resources/1/Character/Prefab/Asvald.prefab # Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_box_blur.png # Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_circle.png # Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_circle_blur 1.png # Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_circle_blur.png # Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_circle_glow.png # Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_circle_line_blue.png # Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_glow.png # Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_glow_small.png # Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_rotate_line.png # Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_rotate_line_small.png # Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_special_particle_blue.png # Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_special_particle_green.png # Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_special_particle_purple.png # Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_special_particle_red.png # Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_special_particle_white.png # Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_special_particle_yellow.png # Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_star_blue.png # Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_star_green.png # Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_star_light.png # Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_star_purple.png # Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_star_red.png # Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_star_white.png # Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_star_yellow.png # Assets/Resources/1/_NewSprites/Logo.png # Assets/Resources/1/_NewSprites/icon.png # Assets/Resources/Data/ItemData.asset # Assets/Scripts/Controller/GameInit.cs # Assets/Scripts/Items/ItemFabric.cs # Assets/Scripts/Units/Unit.cs # Assets/Scripts/Units/Views/UnitView.cs # Assets/TextMesh Pro/Documentation/TextMesh Pro User Guide 2016.pdf # Assets/TextMesh Pro/Fonts/LiberationSans.ttf # Assets/TextMesh Pro/Sprites/EmojiOne.png
This commit is contained in:
commit
e630b2f332
55
.vscode/launch.json
vendored
Normal file
55
.vscode/launch.json
vendored
Normal file
@ -0,0 +1,55 @@
|
||||
{
|
||||
// Use IntelliSense to learn about possible attributes.
|
||||
// Hover to view descriptions of existing attributes.
|
||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
|
||||
{
|
||||
"name": "Unity Editor",
|
||||
"type": "unity",
|
||||
"path": "/G:/Unity/Jump_And_Grub/Library/EditorInstance.json",
|
||||
"request": "launch"
|
||||
},
|
||||
{
|
||||
"name": "Windows Player",
|
||||
"type": "unity",
|
||||
"request": "launch"
|
||||
},
|
||||
{
|
||||
"name": "OSX Player",
|
||||
"type": "unity",
|
||||
"request": "launch"
|
||||
},
|
||||
{
|
||||
"name": "Linux Player",
|
||||
"type": "unity",
|
||||
"request": "launch"
|
||||
},
|
||||
{
|
||||
"name": "iOS Player",
|
||||
"type": "unity",
|
||||
"request": "launch"
|
||||
},
|
||||
{
|
||||
"name": "Android Player",
|
||||
"type": "unity",
|
||||
"request": "launch"
|
||||
},
|
||||
{
|
||||
"name": "Xbox One Player",
|
||||
"type": "unity",
|
||||
"request": "launch"
|
||||
},
|
||||
{
|
||||
"name": "PS4 Player",
|
||||
"type": "unity",
|
||||
"request": "launch"
|
||||
},
|
||||
{
|
||||
"name": "SwitchPlayer",
|
||||
"type": "unity",
|
||||
"request": "launch"
|
||||
}
|
||||
]
|
||||
}
|
42
.vscode/tasks.json
vendored
Normal file
42
.vscode/tasks.json
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"label": "build",
|
||||
"command": "dotnet",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"build",
|
||||
"${workspaceFolder}/Assembly-CSharp.csproj",
|
||||
"/property:GenerateFullPaths=true",
|
||||
"/consoleloggerparameters:NoSummary"
|
||||
],
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "publish",
|
||||
"command": "dotnet",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"publish",
|
||||
"${workspaceFolder}/Assembly-CSharp.csproj",
|
||||
"/property:GenerateFullPaths=true",
|
||||
"/consoleloggerparameters:NoSummary"
|
||||
],
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "watch",
|
||||
"command": "dotnet",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"watch",
|
||||
"run",
|
||||
"${workspaceFolder}/Assembly-CSharp.csproj",
|
||||
"/property:GenerateFullPaths=true",
|
||||
"/consoleloggerparameters:NoSummary"
|
||||
],
|
||||
"problemMatcher": "$msCompile"
|
||||
}
|
||||
]
|
||||
}
|
196
Assets/Prefab/AimCanvas.prefab
Normal file
196
Assets/Prefab/AimCanvas.prefab
Normal file
@ -0,0 +1,196 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &2273039178377770117
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 859777855380249073}
|
||||
- component: {fileID: 4155610655756139463}
|
||||
- component: {fileID: 3748583951425988394}
|
||||
- component: {fileID: 6763014501615571600}
|
||||
- component: {fileID: 5390111712102929048}
|
||||
m_Layer: 5
|
||||
m_Name: AimCanvas
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &859777855380249073
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2273039178377770117}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 0.5, y: 0.5, z: 0.5}
|
||||
m_Children:
|
||||
- {fileID: 1682201888086621645}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
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: 1080, y: 1920}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!223 &4155610655756139463
|
||||
Canvas:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2273039178377770117}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_RenderMode: 2
|
||||
m_Camera: {fileID: 0}
|
||||
m_PlaneDistance: 100
|
||||
m_PixelPerfect: 0
|
||||
m_ReceivesEvents: 1
|
||||
m_OverrideSorting: 0
|
||||
m_OverridePixelPerfect: 0
|
||||
m_SortingBucketNormalizedSize: 0
|
||||
m_AdditionalShaderChannelsFlag: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingOrder: 0
|
||||
m_TargetDisplay: 0
|
||||
--- !u!114 &3748583951425988394
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2273039178377770117}
|
||||
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!114 &6763014501615571600
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2273039178377770117}
|
||||
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 &5390111712102929048
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2273039178377770117}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 6650f022a8987a34e8da86d910b6e277, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
healthBar: {fileID: 0}
|
||||
manaBar: {fileID: 0}
|
||||
shotPrefab: {fileID: 9204531176590517796, guid: 74ba0f2e00eb74a4882dcf82bb66bb3f,
|
||||
type: 3}
|
||||
grid: {fileID: 0}
|
||||
--- !u!1 &4408587040574959135
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1682201888086621645}
|
||||
- component: {fileID: 4166681067140898453}
|
||||
- component: {fileID: 4289004574052349883}
|
||||
m_Layer: 5
|
||||
m_Name: Aim
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &1682201888086621645
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4408587040574959135}
|
||||
m_LocalRotation: {x: -0.5, y: -0.5, z: -0.5, w: 0.5}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 2.28}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 859777855380249073}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: -90, y: -90, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0.04, y: 0.3}
|
||||
m_SizeDelta: {x: 5, y: 1}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &4166681067140898453
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4408587040574959135}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &4289004574052349883
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4408587040574959135}
|
||||
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: 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_Sprite: {fileID: 4007780875627063171, guid: e816ecf82b202d0449267fe992da842e,
|
||||
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
|
574
Assets/Prefab/BarCAnvas.prefab
Normal file
574
Assets/Prefab/BarCAnvas.prefab
Normal file
@ -0,0 +1,574 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &3185331048183402439
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 5894909873554395549}
|
||||
- component: {fileID: 8174616228555596217}
|
||||
- component: {fileID: 6466448468551854656}
|
||||
m_Layer: 5
|
||||
m_Name: Shots
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &5894909873554395549
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3185331048183402439}
|
||||
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: 5156761560679623958}
|
||||
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.53}
|
||||
m_SizeDelta: {x: 3, y: 0.2}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &8174616228555596217
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3185331048183402439}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &6466448468551854656
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3185331048183402439}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 8a8695521f0d02e499659fee002a26c2, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Padding:
|
||||
m_Left: 0
|
||||
m_Right: 0
|
||||
m_Top: 0
|
||||
m_Bottom: 0
|
||||
m_ChildAlignment: 2
|
||||
m_StartCorner: 0
|
||||
m_StartAxis: 0
|
||||
m_CellSize: {x: 0.5, y: 0.2}
|
||||
m_Spacing: {x: 0, y: 0}
|
||||
m_Constraint: 0
|
||||
m_ConstraintCount: 1
|
||||
--- !u!1 &4564225513960759228
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 82951532315249996}
|
||||
- component: {fileID: 3314045166140750521}
|
||||
- component: {fileID: 1578129097074153488}
|
||||
m_Layer: 5
|
||||
m_Name: ManaBack
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &82951532315249996
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4564225513960759228}
|
||||
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: 6551948662265214362}
|
||||
m_Father: {fileID: 5156761560679623958}
|
||||
m_RootOrder: 3
|
||||
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: 2.08, y: 0.94}
|
||||
m_SizeDelta: {x: 1, y: 1}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &3314045166140750521
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4564225513960759228}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &1578129097074153488
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4564225513960759228}
|
||||
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: 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_Sprite: {fileID: -5455261514569519910, guid: bcfec907e0672ed45b69575096b4a1c2,
|
||||
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 &6049883652435591266
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 5156761560679623958}
|
||||
- component: {fileID: 8490769543284739872}
|
||||
- component: {fileID: 8681621801813709773}
|
||||
- component: {fileID: 1271697267505620599}
|
||||
- component: {fileID: 482855193181693567}
|
||||
m_Layer: 5
|
||||
m_Name: BarCAnvas
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &5156761560679623958
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6049883652435591266}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 0.5, y: 0.5, z: 0.5}
|
||||
m_Children:
|
||||
- {fileID: 6124438540769792862}
|
||||
- {fileID: 5894909873554395549}
|
||||
- {fileID: 7064199837503171822}
|
||||
- {fileID: 82951532315249996}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
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: 1.1485596}
|
||||
m_SizeDelta: {x: 10, y: 5.4055}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!223 &8490769543284739872
|
||||
Canvas:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6049883652435591266}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_RenderMode: 2
|
||||
m_Camera: {fileID: 0}
|
||||
m_PlaneDistance: 100
|
||||
m_PixelPerfect: 0
|
||||
m_ReceivesEvents: 1
|
||||
m_OverrideSorting: 0
|
||||
m_OverridePixelPerfect: 0
|
||||
m_SortingBucketNormalizedSize: 0
|
||||
m_AdditionalShaderChannelsFlag: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingOrder: 0
|
||||
m_TargetDisplay: 0
|
||||
--- !u!114 &8681621801813709773
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6049883652435591266}
|
||||
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: 0
|
||||
--- !u!114 &1271697267505620599
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6049883652435591266}
|
||||
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 &482855193181693567
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6049883652435591266}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 6650f022a8987a34e8da86d910b6e277, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
healthBar: {fileID: 7888535169076749686}
|
||||
manaBar: {fileID: 9185818537322146330}
|
||||
shotPrefab: {fileID: 9204531176590517796, guid: 74ba0f2e00eb74a4882dcf82bb66bb3f,
|
||||
type: 3}
|
||||
grid: {fileID: 3185331048183402439}
|
||||
--- !u!1 &6201783996967795459
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 7064199837503171822}
|
||||
- component: {fileID: 1357902011422320789}
|
||||
- component: {fileID: 2447735196939325693}
|
||||
m_Layer: 5
|
||||
m_Name: HealthBack
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &7064199837503171822
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6201783996967795459}
|
||||
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: 9025064510373730425}
|
||||
m_Father: {fileID: 5156761560679623958}
|
||||
m_RootOrder: 2
|
||||
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: 1.1899414}
|
||||
m_SizeDelta: {x: 3, y: 0.5}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &1357902011422320789
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6201783996967795459}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &2447735196939325693
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6201783996967795459}
|
||||
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: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 0
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: -8254845973784877126, guid: bcfec907e0672ed45b69575096b4a1c2,
|
||||
type: 3}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 0
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 1
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!1 &6720477436881757364
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 6124438540769792862}
|
||||
- component: {fileID: 3872739704401499897}
|
||||
- component: {fileID: 3692302203462554896}
|
||||
m_Layer: 5
|
||||
m_Name: CaptureBar
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 0
|
||||
--- !u!224 &6124438540769792862
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6720477436881757364}
|
||||
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: 5156761560679623958}
|
||||
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: 2}
|
||||
m_SizeDelta: {x: 3, y: 0.3}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &3872739704401499897
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6720477436881757364}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &3692302203462554896
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6720477436881757364}
|
||||
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: 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_Sprite: {fileID: -2685135706508046216, guid: bcfec907e0672ed45b69575096b4a1c2,
|
||||
type: 3}
|
||||
m_Type: 3
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 0
|
||||
m_FillAmount: 0
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 1
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!1 &7234977947494318781
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 6551948662265214362}
|
||||
- component: {fileID: 7108030091433613238}
|
||||
- component: {fileID: 9185818537322146330}
|
||||
m_Layer: 5
|
||||
m_Name: Mana
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &6551948662265214362
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7234977947494318781}
|
||||
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: 82951532315249996}
|
||||
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: 1, y: 1}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &7108030091433613238
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7234977947494318781}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &9185818537322146330
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7234977947494318781}
|
||||
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: 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_Sprite: {fileID: -7745828531039951331, guid: bcfec907e0672ed45b69575096b4a1c2,
|
||||
type: 3}
|
||||
m_Type: 3
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 1
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!1 &8978451512121849335
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 9025064510373730425}
|
||||
- component: {fileID: 5013792723321420898}
|
||||
- component: {fileID: 7888535169076749686}
|
||||
m_Layer: 5
|
||||
m_Name: Health
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &9025064510373730425
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8978451512121849335}
|
||||
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: 7064199837503171822}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &5013792723321420898
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8978451512121849335}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &7888535169076749686
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8978451512121849335}
|
||||
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: 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_Sprite: {fileID: -4039628871920856409, guid: bcfec907e0672ed45b69575096b4a1c2,
|
||||
type: 3}
|
||||
m_Type: 3
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 0
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 1
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
8
Assets/Prefab/Tests.meta
Normal file
8
Assets/Prefab/Tests.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dfc9988be09620a4798e070262bdf0c6
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
230
Assets/Prefab/Tests/Bullet.prefab
Normal file
230
Assets/Prefab/Tests/Bullet.prefab
Normal file
@ -0,0 +1,230 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &1508996612506205613
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1508996612506205614}
|
||||
- component: {fileID: 1508996612506205615}
|
||||
m_Layer: 0
|
||||
m_Name: Circle
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &1508996612506205614
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1508996612506205613}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0.5, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1508996612687079457}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!212 &1508996612506205615
|
||||
SpriteRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1508996612506205613}
|
||||
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: -2413806693520163455, guid: ebe73ca9363db456bacf42c025bb4847,
|
||||
type: 3}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_FlipX: 0
|
||||
m_FlipY: 0
|
||||
m_DrawMode: 0
|
||||
m_Size: {x: 1, y: 1}
|
||||
m_AdaptiveModeThreshold: 0.5
|
||||
m_SpriteTileMode: 0
|
||||
m_WasSpriteAssigned: 1
|
||||
m_MaskInteraction: 0
|
||||
m_SpriteSortPoint: 0
|
||||
--- !u!1 &1508996612687079456
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1508996612687079457}
|
||||
- component: {fileID: 1508996612687079458}
|
||||
m_Layer: 0
|
||||
m_Name: Square
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &1508996612687079457
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1508996612687079456}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: -0.5, z: 0}
|
||||
m_LocalScale: {x: 0.23946421, y: 0.53201, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 1508996612506205614}
|
||||
m_Father: {fileID: 1508996613087134754}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!212 &1508996612687079458
|
||||
SpriteRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1508996612687079456}
|
||||
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: 7482667652216324306, guid: 48e93eef0688c4a259cb0eddcd8661f7,
|
||||
type: 3}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_FlipX: 0
|
||||
m_FlipY: 0
|
||||
m_DrawMode: 0
|
||||
m_Size: {x: 1, y: 1}
|
||||
m_AdaptiveModeThreshold: 0.5
|
||||
m_SpriteTileMode: 0
|
||||
m_WasSpriteAssigned: 1
|
||||
m_MaskInteraction: 0
|
||||
m_SpriteSortPoint: 0
|
||||
--- !u!1 &1508996613087134753
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1508996613087134754}
|
||||
- component: {fileID: 8444853135865988787}
|
||||
- component: {fileID: 3509611387413288450}
|
||||
m_Layer: 0
|
||||
m_Name: Bullet
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &1508996613087134754
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1508996613087134753}
|
||||
m_LocalRotation: {x: 0.5, y: -0.5, z: -0.5, w: 0.5}
|
||||
m_LocalPosition: {x: 0, y: 0.5, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 1508996612687079457}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: -90, z: -90}
|
||||
--- !u!54 &8444853135865988787
|
||||
Rigidbody:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1508996613087134753}
|
||||
serializedVersion: 2
|
||||
m_Mass: 1
|
||||
m_Drag: 0
|
||||
m_AngularDrag: 0.05
|
||||
m_UseGravity: 0
|
||||
m_IsKinematic: 0
|
||||
m_Interpolate: 0
|
||||
m_Constraints: 0
|
||||
m_CollisionDetection: 0
|
||||
--- !u!114 &3509611387413288450
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1508996613087134753}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 7fd043b309962ec4ab2244e7b7257fe7, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
7
Assets/Prefab/Tests/Bullet.prefab.meta
Normal file
7
Assets/Prefab/Tests/Bullet.prefab.meta
Normal file
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 657111cb607c294479046ca0faef6c69
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
14
Assets/Prefab/Tests/DestroyBullet.cs
Normal file
14
Assets/Prefab/Tests/DestroyBullet.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class DestroyBullet : MonoBehaviour
|
||||
{
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
Destroy(gameObject, 2f);
|
||||
}
|
||||
|
||||
|
||||
}
|
11
Assets/Prefab/Tests/DestroyBullet.cs.meta
Normal file
11
Assets/Prefab/Tests/DestroyBullet.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7fd043b309962ec4ab2244e7b7257fe7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
59
Assets/Prefab/Tests/Fire.cs
Normal file
59
Assets/Prefab/Tests/Fire.cs
Normal file
@ -0,0 +1,59 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Fire : MonoBehaviour
|
||||
{
|
||||
public Transform barrel;
|
||||
public GameObject bulletPref;
|
||||
|
||||
public GameObject[] ammo;
|
||||
public Stack<GameObject> ammoStack = new Stack<GameObject>();
|
||||
|
||||
private int ammoAnount;
|
||||
|
||||
private void Start() {
|
||||
//ammo.Push(bulletPref);
|
||||
for(int i = 0; i <=2; i++)
|
||||
{
|
||||
ammoStack.Push(ammo[i]);
|
||||
ammo[i].SetActive(false);
|
||||
Debug.Log($"Should print out : {ammoStack.Peek()}");
|
||||
|
||||
}
|
||||
// foreach (var item in ammoStack)
|
||||
// {
|
||||
// item.SetActive(false);
|
||||
// }
|
||||
|
||||
// if(ammo.Length <= 3)
|
||||
// {
|
||||
// ammoStack.Pop().SetActive(false);
|
||||
// Debug.Log($"Should print out : {ammoStack.Peek().name}");
|
||||
|
||||
// }
|
||||
ammoAnount = 0;
|
||||
}
|
||||
|
||||
private void Update() {
|
||||
if(Input.GetButtonDown("Fire1") && ammoAnount > 0)
|
||||
{
|
||||
var spawnBullet = Instantiate(bulletPref, barrel.localPosition, barrel.rotation);
|
||||
//spawnBullet.GetComponent<Rigidbody>().
|
||||
spawnBullet.transform.Translate(Vector3.forward * Time.deltaTime * 10f);
|
||||
ammoAnount -= 1;
|
||||
ammoStack.Pop().SetActive(false);
|
||||
}
|
||||
|
||||
if(Input.GetKeyDown(KeyCode.R))
|
||||
{
|
||||
ammoAnount = 3;
|
||||
for (int i = 0; i <= 2; i++)
|
||||
{
|
||||
ammoStack.Push(ammo[i]);
|
||||
ammo[i].SetActive(true);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Prefab/Tests/Fire.cs.meta
Normal file
11
Assets/Prefab/Tests/Fire.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9f62e81b9dba43648bc3e2f3bcd1bc9e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
4105
Assets/Resources/1/Character/Prefab/Asvald.prefab
Normal file
4105
Assets/Resources/1/Character/Prefab/Asvald.prefab
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:05d2a1f6d618abaa053260f0d7ff75cc346ade340d6f540425ea82f1c3eab3a6
|
||||
size 22197
|
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:10b028ffeab226a3bd0c532206c4d5023db17094d2ea7f929001f4186ff30bcb
|
||||
size 4149
|
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:78b200496a0b39353dc039f96a9a962808168336beecc815ea4fc0ff8c7b81e7
|
||||
size 19498
|
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:687bd052f4b5e79c0c0693836047ddf1e02154480d407679fc895fc07cb82b19
|
||||
size 19117
|
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:99d4f3ca90d22f327d3d0e9fe5cc85f0fdba9db358b72d3639f8150e757fec86
|
||||
size 1623
|
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:6f6438921aea7498dd19c65a4f4f1a387905eb4355ee9a5096ef0fc46f6b4ef4
|
||||
size 39551
|
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:597e8cf3f16e124c58aee967cb6ab562753405c5f1e238afcf04d72cd65bd695
|
||||
size 240639
|
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:849617c4841adf23e36cafadf8eead1d4cf167a7c43856247c43ef1872b2dd72
|
||||
size 6793
|
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:f5a22d2b587a37e8c5b5b861596e3c9889b3a8d0b27be25ea9d397e9d9558526
|
||||
size 238066
|
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:5e21cfae534c4ffaf339b3d3151da766130569aefd26079660c371d4d54e9e23
|
||||
size 9395
|
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:cc25fa3d9f88a2878375fc6f7f01c3caec5d284b85383e9e9e16d8f93c432f37
|
||||
size 6455
|
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:6723c3813f4652c59fb2f78bad83ffe85fb8140eee783614dd6a6de7be583714
|
||||
size 5779
|
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:0ca56e6e181ea9892c1fc0d1ac02d2d6276d18ce9b3c549c96269d5e16e0191d
|
||||
size 5635
|
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:fe2abd46bd22af5982611b83865b54aae820a01a4285df833ea4b1d17c345be7
|
||||
size 6161
|
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:404b833398b90f034e7d566046f96eb4e5878f728b685f7fb3fb15bc2841f10e
|
||||
size 5928
|
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:f27a191ec9b53bd56f3e10cc463ef9af77fbf4e3fbc6dee3979e8cd39578018a
|
||||
size 6355
|
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:c7bc1b2dbde4dfc46ce01816272174ee2a752a7d2e3294b90d0765038c22a77f
|
||||
size 6280
|
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:fb62cf0ae8ef5a7f8eda527b9ae9cede2a120312c63e83b52543f2e973c5d898
|
||||
size 6403
|
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:08f6cc2ea52092ae1dcab4ed14d54d753f8b27c603c36a11f33ec0d15148b3ae
|
||||
size 27540
|
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:886efe770ef2209cf9f7a29eaf9caff55c91a6a072795f4fb4936922384f7854
|
||||
size 6757
|
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:6ba3ad4ca39ae48e8ca0176d012bcd82186f8e4836152c0b3989f2a3ccf18aaf
|
||||
size 6427
|
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:8fed535961369c2bfe1ca0ebafa26cea50b0abca7fdedf13cf9cd9f08d461c97
|
||||
size 6004
|
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:bdf18a73d39e8f467d221840252550e2b65038a05643b7cf949e49aa64fd5512
|
||||
size 6763
|
3
Assets/Resources/1/_NewSprites/Logo.png
Normal file
3
Assets/Resources/1/_NewSprites/Logo.png
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:fba96ce6554cdf19f7620585eacd3c7f09dc0e8c344dcfbeab3e481d72f45c0d
|
||||
size 40148
|
3
Assets/Resources/1/_NewSprites/icon.png
Normal file
3
Assets/Resources/1/_NewSprites/icon.png
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:01f3ffe1163c379afd78eb5514ac73c9c53537e423da7a3684df0d4af2dec155
|
||||
size 22793
|
41
Assets/Resources/Data/ItemData.asset
Normal file
41
Assets/Resources/Data/ItemData.asset
Normal file
@ -0,0 +1,41 @@
|
||||
%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: effbc11b6ae8444c8d20e929ce28183e, type: 3}
|
||||
m_Name: ItemData
|
||||
m_EditorClassIdentifier:
|
||||
itemInfos:
|
||||
- prefab: {fileID: 919132149155446097, guid: 4166c606d638610418dc9ead794d697b, type: 3}
|
||||
isInstantUse: 0
|
||||
type: Tower
|
||||
icon: {fileID: 21300000, guid: 543c4732bd2d47a41bdbbf2156eb358c, type: 3}
|
||||
spawnablePrefab: {fileID: 4774919592469818776, guid: 0dbed8f974ba44a42af9d8fcae504ce0,
|
||||
type: 3}
|
||||
values:
|
||||
spawnChance: 0.2
|
||||
- prefab: {fileID: 3197816592181874056, guid: 2704c4f795b0d7748a3e3fa53be4d893,
|
||||
type: 3}
|
||||
isInstantUse: 1
|
||||
type: AttackBonus
|
||||
icon: {fileID: 21300000, guid: caf8bc0311dd2fc4ca1528a82a063754, type: 3}
|
||||
spawnablePrefab: {fileID: 0}
|
||||
values: 030000000f000000
|
||||
spawnChance: 0.516
|
||||
- prefab: {fileID: 8639522512577941448, guid: 7b6a7f64e52da514d88aa97ad8f863df,
|
||||
type: 3}
|
||||
isInstantUse: 1
|
||||
type: DefenceBonus
|
||||
icon: {fileID: 21300000, guid: 35be128594dcdce48b5d8e5317b38ed9, type: 3}
|
||||
spawnablePrefab: {fileID: 0}
|
||||
values: 0a0000001e000000
|
||||
spawnChance: 0.797
|
||||
fromTimeSpawn: 3
|
||||
toTimeSpawn: 10
|
82
Assets/Scripts/Controller/GameInit.cs
Normal file
82
Assets/Scripts/Controller/GameInit.cs
Normal file
@ -0,0 +1,82 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Timers;
|
||||
using CamControl;
|
||||
using Chars;
|
||||
using DefaultNamespace;
|
||||
using GameUI;
|
||||
using HexFiled;
|
||||
using Items;
|
||||
using Units;
|
||||
using UnityEngine;
|
||||
using Weapons;
|
||||
using Object = UnityEngine.Object;
|
||||
using Random = UnityEngine.Random;
|
||||
|
||||
namespace Controller
|
||||
{
|
||||
internal sealed class GameInit
|
||||
{
|
||||
public GameInit(Controllers controllers, Data.Data data)
|
||||
{
|
||||
|
||||
new GameObject("Timer").AddComponent<TimerHelper>();
|
||||
|
||||
var hexGrid = new HexGrid(data.FieldData);
|
||||
new MusicController();
|
||||
MusicController.Instance.SetMusicData(data.MusicData);
|
||||
controllers.Add(hexGrid);
|
||||
|
||||
data.WeaponsData.WeaponsList.ForEach(x => x.SetModifiedDamage(0));
|
||||
|
||||
ItemFabric itemFabric = new ItemFabric(data.ItemsData, SetUpItems());
|
||||
controllers.Add(itemFabric);
|
||||
|
||||
UIController uiController = new UIController(data.UIData);
|
||||
uiController.Spawn(); //TODO при паузе Dotween ругается
|
||||
Unit player;
|
||||
List<Unit> units = new List<Unit>();
|
||||
data.UnitData.Units.ForEach(unit =>
|
||||
{
|
||||
if (unit.isPlayer)
|
||||
{
|
||||
var weapon = JsonUtility.FromJson<Weapon>(data.ChosenWeapon);
|
||||
weapon.SetModifiedDamage(0);
|
||||
player = new Unit(unit, weapon, hexGrid);
|
||||
PlayerControl playerControl = new PlayerControl(player, uiController.PlayerControlView,
|
||||
uiController.PlayerInventoryView);
|
||||
controllers.Add(playerControl);
|
||||
CameraControl cameraControl =
|
||||
new CameraControl(Camera.main, data.CameraData);
|
||||
controllers.Add(cameraControl);
|
||||
player.onPlayerSpawned += cameraControl.InitCameraControl;
|
||||
player.onPlayerSpawned += MusicController.Instance.AddAudioListener;
|
||||
units.Add(player);
|
||||
}
|
||||
else
|
||||
{
|
||||
var enemy = new Unit(unit,
|
||||
data.WeaponsData.WeaponsList[Random.Range(0, data.WeaponsData.WeaponsList.Count - 1)], hexGrid);
|
||||
var enemyController = new EnemyController(unit, enemy);
|
||||
controllers.Add(enemyController);
|
||||
units.Add(enemy);
|
||||
}
|
||||
});
|
||||
|
||||
var unitFactory = new UnitFactory(units);
|
||||
|
||||
hexGrid.OnGridLoaded += unitFactory.Spawn;
|
||||
|
||||
var paintedController = new PaintedController();
|
||||
|
||||
hexGrid.OnHexPainted += paintedController.SetHexColors;
|
||||
|
||||
hexGrid.OnHexPainted += itemFabric.UpdateCellToOpenList;
|
||||
}
|
||||
|
||||
private List<Type> SetUpItems()
|
||||
{
|
||||
return new List<Type>() { typeof(Tower), typeof(AttackBonus), typeof(DefenceBonus) };
|
||||
}
|
||||
}
|
||||
}
|
90
Assets/Scripts/Items/ItemFabric.cs
Normal file
90
Assets/Scripts/Items/ItemFabric.cs
Normal file
@ -0,0 +1,90 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Data;
|
||||
using HexFiled;
|
||||
using Runtime.Controller;
|
||||
using UnityEngine;
|
||||
using Object = UnityEngine.Object;
|
||||
using Random = UnityEngine.Random;
|
||||
|
||||
namespace Items
|
||||
{
|
||||
public class ItemFabric : IExecute
|
||||
{
|
||||
private ItemsData _data;
|
||||
private List<HexCell> _openList;
|
||||
private List<Type> _itemTypes;
|
||||
private Dictionary<string, ItemInfo> _itemInfos;
|
||||
private float _spawnTime;
|
||||
private float time;
|
||||
|
||||
public ItemFabric(ItemsData data, List<Type> dictionary)
|
||||
{
|
||||
_itemInfos = new Dictionary<string, ItemInfo>();
|
||||
data.ItemInfos.ForEach(info => { _itemInfos.Add(info.Type, info); });
|
||||
_itemTypes = dictionary;
|
||||
_data = data;
|
||||
_openList = new List<HexCell>();
|
||||
_spawnTime = Random.Range(data.SpawnTime.from, data.SpawnTime.to);
|
||||
}
|
||||
|
||||
public void UpdateCellToOpenList(HexCell cell)
|
||||
{
|
||||
if (cell.Color != UnitColor.GREY)
|
||||
{
|
||||
_openList.Add(cell);
|
||||
}
|
||||
else if (_openList.Contains(cell))
|
||||
{
|
||||
_openList.Remove(cell);
|
||||
}
|
||||
}
|
||||
|
||||
public void Execute()
|
||||
{
|
||||
if (Time.time - time >= _spawnTime)
|
||||
{
|
||||
List<HexCell> closedList = PaintedController.UnitCurrentCell.Select(unitCells => unitCells.Value.curent)
|
||||
.ToList();
|
||||
time = Time.time;
|
||||
var cell = _openList[Random.Range(0, _openList.Count - 1)];
|
||||
|
||||
while (closedList.Contains(cell) || cell.Item != null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var type = GetWeightedType();
|
||||
while (type == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
var info = _itemInfos[type.ToString().Replace("Items.", "")];
|
||||
var obj = (Item)Activator.CreateInstance(type, info);
|
||||
|
||||
var go = obj.Spawn(cell);
|
||||
go.AddComponent<CapsuleCollider>().isTrigger = true;
|
||||
var itemView = go.AddComponent<ItemView>();
|
||||
itemView.SetUp(obj);
|
||||
cell.SetItem(obj);
|
||||
_spawnTime = Random.Range(_data.SpawnTime.from, _data.SpawnTime.to);
|
||||
}
|
||||
}
|
||||
|
||||
private Type GetWeightedType()
|
||||
{
|
||||
float randomNum = Random.Range(1, 101)/100f;
|
||||
List<Type> possibleTypes = new List<Type>();
|
||||
|
||||
_itemTypes.ForEach(type =>
|
||||
{
|
||||
if (_itemInfos[type.ToString().Replace("Items.", "")].SpawnChance >= randomNum)
|
||||
{
|
||||
possibleTypes.Add(type);
|
||||
}
|
||||
});
|
||||
return possibleTypes.Count > 0 ? possibleTypes[Random.Range(0, possibleTypes.Count - 1)] : null;
|
||||
}
|
||||
}
|
||||
}
|
8
Assets/Scripts/States.meta
Normal file
8
Assets/Scripts/States.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4690d5b96a9971f4fa845f4b25440eba
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
65
Assets/Scripts/States/Gamelogic.cs
Normal file
65
Assets/Scripts/States/Gamelogic.cs
Normal file
@ -0,0 +1,65 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Gamelogic : MonoBehaviour
|
||||
{
|
||||
Mana manaSystem;
|
||||
|
||||
private void Start() {
|
||||
manaSystem = new Mana();
|
||||
}
|
||||
|
||||
private void Update() {
|
||||
Debug.Log("HP: " + manaSystem.Current_MP);
|
||||
|
||||
manaSystem.Update();
|
||||
}
|
||||
}
|
||||
public class Mana
|
||||
{
|
||||
public float Max_MP = 100;
|
||||
public float Current_MP = 1;
|
||||
List<ManaRegen> regenList;
|
||||
public Mana()
|
||||
{
|
||||
regenList = new List<ManaRegen>();
|
||||
}
|
||||
public Mana(float max, float current)
|
||||
{
|
||||
Max_MP = max;
|
||||
Current_MP = current;
|
||||
regenList = new List<ManaRegen>();
|
||||
}
|
||||
public void Update() {
|
||||
foreach (var regen in regenList.ToArray())
|
||||
{
|
||||
if(Current_MP < Max_MP && regen.fDuraton > 0)
|
||||
{
|
||||
Current_MP += regen.fManaPerSecond * Time.deltaTime;
|
||||
}
|
||||
regen.fDuraton -= 1f *Time.deltaTime;
|
||||
|
||||
if(regen.fDuraton < 0)
|
||||
{
|
||||
regenList.RemoveAt(regenList.IndexOf(regen));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class ManaRegen
|
||||
{
|
||||
public float fDuraton;
|
||||
public float fManaPerSecond;
|
||||
|
||||
public ManaRegen()
|
||||
{
|
||||
|
||||
}
|
||||
public ManaRegen(float duration, float manaPerSecond)
|
||||
{
|
||||
fDuraton = duration;
|
||||
fManaPerSecond = manaPerSecond;
|
||||
}
|
||||
}
|
11
Assets/Scripts/States/Gamelogic.cs.meta
Normal file
11
Assets/Scripts/States/Gamelogic.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4d34080a61fa47645b032357092bcc99
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
60
Assets/Scripts/States/ManaBar.cs
Normal file
60
Assets/Scripts/States/ManaBar.cs
Normal file
@ -0,0 +1,60 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class ManaBar : MonoBehaviour
|
||||
{
|
||||
public Slider manaBar;
|
||||
|
||||
private int maxMana = 100;
|
||||
private int currentMana;
|
||||
private WaitForSeconds regenTick = new WaitForSeconds(0.5f);
|
||||
private Coroutine regen;
|
||||
|
||||
|
||||
public static ManaBar instance;
|
||||
|
||||
private void Awake() {
|
||||
instance = this;
|
||||
}
|
||||
|
||||
private void Start() {
|
||||
currentMana = maxMana;
|
||||
manaBar.maxValue = maxMana;
|
||||
manaBar.value = maxMana;
|
||||
}
|
||||
|
||||
public void UseMana(int amount)
|
||||
{
|
||||
if(currentMana - amount >= 0 )
|
||||
{
|
||||
currentMana -= amount;
|
||||
manaBar.value = currentMana;
|
||||
|
||||
if(regen != null)
|
||||
StopCoroutine(regen);
|
||||
|
||||
regen = StartCoroutine(RegenMana());
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log("Not enough mana");
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerator RegenMana()
|
||||
{
|
||||
yield return new WaitForSeconds(0.1f);
|
||||
|
||||
while(currentMana < maxMana)
|
||||
{
|
||||
currentMana += maxMana / 10;
|
||||
manaBar.value = currentMana;
|
||||
yield return regenTick;
|
||||
}
|
||||
|
||||
regen = null;
|
||||
}
|
||||
|
||||
}
|
11
Assets/Scripts/States/ManaBar.cs.meta
Normal file
11
Assets/Scripts/States/ManaBar.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 38891abd62cc9634584e630986c02534
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
13
Assets/Scripts/States/Player.cs
Normal file
13
Assets/Scripts/States/Player.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Player : MonoBehaviour
|
||||
{
|
||||
private void Update() {
|
||||
if(Input.GetKeyDown(KeyCode.Space))
|
||||
{
|
||||
ManaBar.instance.UseMana(15);
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Scripts/States/Player.cs.meta
Normal file
11
Assets/Scripts/States/Player.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8effecfd846c8cf43ab76c0185e0f2a0
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
348
Assets/Scripts/Units/Unit.cs
Normal file
348
Assets/Scripts/Units/Unit.cs
Normal file
@ -0,0 +1,348 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Chars;
|
||||
using Data;
|
||||
using DefaultNamespace;
|
||||
using DG.Tweening;
|
||||
using HexFiled;
|
||||
using Items;
|
||||
using UnityEngine;
|
||||
using Weapons;
|
||||
using Object = UnityEngine.Object;
|
||||
using Random = UnityEngine.Random;
|
||||
|
||||
|
||||
namespace Units
|
||||
{
|
||||
public class Unit
|
||||
{
|
||||
private bool _isAlive;
|
||||
private GameObject _instance;
|
||||
private List<Item> _inventory;
|
||||
private AnimLength _animLength;
|
||||
private HexCell _cell;
|
||||
private HexGrid _hexGrid;
|
||||
public Action<GameObject> onPlayerSpawned;
|
||||
private Animator _animator;
|
||||
private UnitView _unitView;
|
||||
private bool _isBusy;
|
||||
private UnitInfo _data;
|
||||
private int _hp;
|
||||
private int _mana;
|
||||
private Weapon _weapon;
|
||||
private Vector2 _direction;
|
||||
private BarCanvas _barCanvas;
|
||||
private bool _isHardToCapture;
|
||||
private bool _isCapturing;
|
||||
private int _attackBonus;
|
||||
private int _defenceBonus;
|
||||
|
||||
|
||||
public bool IsBusy => _isBusy;
|
||||
public UnitView UnitView => _unitView;
|
||||
public bool IsAlive => _isAlive;
|
||||
public UnitColor Color => _data.color;
|
||||
public int InventoryCapacity => _data.inventoryCapacity;
|
||||
public Action<Item> OnItemPickUp;
|
||||
|
||||
public Unit(UnitInfo unitData, Weapon weapon, HexGrid hexGrid)
|
||||
{
|
||||
_weapon = weapon;
|
||||
_data = unitData;
|
||||
_isAlive = false;
|
||||
_hexGrid = hexGrid;
|
||||
_isBusy = false;
|
||||
_isHardToCapture = false;
|
||||
_isCapturing = false;
|
||||
}
|
||||
|
||||
public void SetAttackBonus(int duration, int value)
|
||||
{
|
||||
TimerHelper.Instance.StartTimer(StopAttackBonus, duration);
|
||||
_weapon.SetModifiedDamage(value);
|
||||
}
|
||||
|
||||
private void StopAttackBonus()
|
||||
{
|
||||
_weapon.SetModifiedDamage(0);
|
||||
}
|
||||
|
||||
public void SetDefenceBonus(int duration, int value)
|
||||
{
|
||||
TimerHelper.Instance.StartTimer(StopDefenceBonus, duration);
|
||||
_defenceBonus = value;
|
||||
}
|
||||
|
||||
private void StopDefenceBonus()
|
||||
{
|
||||
_defenceBonus = 0;
|
||||
}
|
||||
|
||||
public void Move(HexDirection direction)
|
||||
{
|
||||
if (!_cell.GetNeighbor(direction) || _isBusy) return;
|
||||
_unitView.StopHardCapture();
|
||||
if (_cell.GetNeighbor(direction).Color == _data.color)
|
||||
{
|
||||
DoTransit(direction);
|
||||
}
|
||||
else if (_cell.GetNeighbor(direction).Color != UnitColor.GREY)
|
||||
{
|
||||
_isHardToCapture = true;
|
||||
_unitView.RegenMana(_mana);
|
||||
DoTransit(direction);
|
||||
}
|
||||
|
||||
else if (_mana - _hexGrid.HexCaptureCost >= 0)
|
||||
{
|
||||
_mana -= _hexGrid.HexCaptureCost;
|
||||
_unitView.RegenMana(_mana);
|
||||
UpdateBarCanvas();
|
||||
DoTransit(direction);
|
||||
}
|
||||
}
|
||||
|
||||
private void DoTransit(HexDirection direction)
|
||||
{
|
||||
_isBusy = true;
|
||||
_isCapturing = _data.color != _cell.GetNeighbor(direction).Color;
|
||||
var previousCell = _cell;
|
||||
_cell = _cell.GetNeighbor(direction);
|
||||
PaintedController.UnitCurrentCell[_data.color] = (previousCell, _cell);
|
||||
RotateUnit(new Vector2((_cell.transform.position - _instance.transform.position).normalized.x,
|
||||
(_cell.transform.position - _instance.transform.position).normalized.z));
|
||||
_animator.SetTrigger("Move");
|
||||
_animator.SetBool("isMoving", _isBusy);
|
||||
_instance.transform.DOMove(_cell.transform.position, _animLength.Move);
|
||||
}
|
||||
|
||||
private void CaptureHex()
|
||||
{
|
||||
_cell.PaintHex(_data.color);
|
||||
}
|
||||
|
||||
private void SetAnimLength()
|
||||
{
|
||||
AnimationClip[] clips = _animator.runtimeAnimatorController.animationClips;
|
||||
foreach (var clip in clips)
|
||||
{
|
||||
switch (clip.name)
|
||||
{
|
||||
case "MoveJump":
|
||||
_animLength.Move = clip.length;
|
||||
break;
|
||||
case "Attack":
|
||||
_animLength.Attack = clip.length;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Spawn()
|
||||
{
|
||||
if (!_isAlive)
|
||||
{
|
||||
_cell = _hexGrid.GetCellFromCoord(_data.spawnPos);
|
||||
_cell.PaintHex(_data.color);
|
||||
_inventory = new List<Item>();
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
var neigh = _cell.GetNeighbor((HexDirection)i);
|
||||
neigh?.PaintHex(_data.color);
|
||||
|
||||
for (int j = 0; j < 6; j++)
|
||||
{
|
||||
neigh?.GetNeighbor((HexDirection)j)?.PaintHex(_data.color);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
PaintedController.UnitCurrentCell.Add(_data.color, (null, _cell));
|
||||
//
|
||||
|
||||
_instance = Object.Instantiate(_data.unitPrefa, _cell.transform.parent);
|
||||
_instance.transform.localPosition = _cell.transform.localPosition;
|
||||
onPlayerSpawned?.Invoke(_instance);
|
||||
_isAlive = true;
|
||||
_animator = _instance.GetComponent<Animator>();
|
||||
_unitView = _instance.GetComponent<UnitView>();
|
||||
_barCanvas = _unitView.BarCanvas.GetComponent<BarCanvas>();
|
||||
_unitView.SetUp(_barCanvas.SpawnShotUI(_weapon.shots), _weapon, RegenMana, _data.manaRegen, CaptureHex,
|
||||
this);
|
||||
SetAnimLength();
|
||||
MusicController.Instance.AddAudioSource(_instance);
|
||||
_mana = _data.maxMana;
|
||||
_hp = _data.maxHP;
|
||||
SetUpActions();
|
||||
}
|
||||
}
|
||||
|
||||
private void RegenMana()
|
||||
{
|
||||
_mana += _data.manaRegen;
|
||||
UpdateBarCanvas();
|
||||
}
|
||||
|
||||
public bool PickUpItem(ItemView itemView)
|
||||
{
|
||||
if (_inventory.Count < _data.inventoryCapacity)
|
||||
{
|
||||
var item = itemView.PickUp(this);
|
||||
_inventory.Add(item);
|
||||
OnItemPickUp.Invoke(item);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public void UseItem(Item item)
|
||||
{
|
||||
_inventory.Remove(item);
|
||||
}
|
||||
|
||||
private void MoveEnd()
|
||||
{
|
||||
_isBusy = false;
|
||||
_animator.SetBool("isMoving", _isBusy);
|
||||
if (!_isCapturing)
|
||||
{
|
||||
_isHardToCapture = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (_isHardToCapture)
|
||||
{
|
||||
_unitView.HardCaptureHex(_cell);
|
||||
}
|
||||
else
|
||||
{
|
||||
CaptureHex();
|
||||
MusicController.Instance.PlayRandomClip(MusicController.Instance.MusicData.SfxMusic.Captures,
|
||||
_cell.gameObject);
|
||||
}
|
||||
|
||||
_isHardToCapture = false;
|
||||
}
|
||||
|
||||
private void AttackEnd()
|
||||
{
|
||||
_isBusy = false;
|
||||
UpdateBarCanvas();
|
||||
}
|
||||
|
||||
private void Attacking()
|
||||
{
|
||||
if (_direction.Equals(Vector2.zero))
|
||||
{
|
||||
_direction = new Vector2(_unitView.transform.forward.x, _unitView.transform.forward.z);
|
||||
Aim(_direction);
|
||||
}
|
||||
|
||||
var ball = Object.Instantiate(_weapon.objectToThrow,
|
||||
_instance.transform.forward + _instance.transform.position + new Vector3(0, 2),
|
||||
_instance.transform.rotation);
|
||||
MusicController.Instance.AddAudioSource(ball);
|
||||
MusicController.Instance.PlayAudioClip(_weapon.shotSound, ball);
|
||||
ball.AddComponent<WeaponView>().SetWeapon(_weapon);
|
||||
ball.transform.DOMove(
|
||||
new Vector3(_direction.normalized.x,
|
||||
0, _direction.normalized.y) * _weapon.disnatce * HexGrid.HexDistance +
|
||||
_instance.transform.position + new Vector3(0, 2, 0),
|
||||
_weapon.speed)
|
||||
.SetEase(Ease.Linear)
|
||||
.OnComplete(() => Object.Destroy(ball));
|
||||
}
|
||||
|
||||
private void SetUpActions()
|
||||
{
|
||||
_unitView.OnStep += MoveEnd;
|
||||
_unitView.OnAttackEnd += AttackEnd;
|
||||
_unitView.OnAttack += Attacking;
|
||||
_unitView.OnHit += Damage;
|
||||
}
|
||||
|
||||
private void UpdateBarCanvas()
|
||||
{
|
||||
if (_hp > _data.maxHP)
|
||||
_hp = _data.maxHP;
|
||||
if (_mana > _data.maxMana)
|
||||
_mana = _data.maxMana;
|
||||
|
||||
float hp = _hp;
|
||||
float mana = _mana;
|
||||
float maxHp = _data.maxHP;
|
||||
float maxMana = _data.maxMana;
|
||||
_barCanvas.ManaBar.DOFillAmount(mana / maxMana, 0.5f).SetEase(Ease.InQuad);
|
||||
//_barCanvas.ManaBar.value =
|
||||
//_unitView.RegenMana(10);
|
||||
_barCanvas.HealthBar.DOFillAmount(hp / maxHp, 0.5f).SetEase(Ease.InQuad);
|
||||
}
|
||||
|
||||
private void Death()
|
||||
{
|
||||
_unitView.OnStep -= MoveEnd;
|
||||
_unitView.OnAttackEnd -= AttackEnd;
|
||||
_unitView.OnAttack -= Attacking;
|
||||
_unitView.OnHit -= Damage;
|
||||
_isAlive = false;
|
||||
_animator.SetTrigger("Death");
|
||||
MusicController.Instance.PlayAudioClip(MusicController.Instance.MusicData.SfxMusic.Death, _instance);
|
||||
MusicController.Instance.RemoveAudioSource(_instance);
|
||||
}
|
||||
|
||||
|
||||
public void StartAttack()
|
||||
{
|
||||
if (!_isBusy && _unitView.Shoot())
|
||||
{
|
||||
_isBusy = true;
|
||||
if (!_direction.Equals(Vector2.zero))
|
||||
RotateUnit(_direction);
|
||||
|
||||
_animator.SetTrigger("Attack");
|
||||
}
|
||||
}
|
||||
|
||||
private void RotateUnit(Vector2 direction)
|
||||
{
|
||||
_unitView.transform.DOLookAt(new Vector3(direction.x, 0, direction.y) + _unitView.transform.position,
|
||||
0.1f);
|
||||
}
|
||||
|
||||
public void Aim(Vector2 direction)
|
||||
{
|
||||
_unitView.AimCanvas.transform.LookAt(
|
||||
new Vector3(direction.x, 0, direction.y) + _unitView.transform.position);
|
||||
_direction = direction;
|
||||
}
|
||||
|
||||
public HexCell PlaceItemAim(HexDirection direction)
|
||||
{
|
||||
var cell = _cell.GetNeighbor(direction);
|
||||
_unitView.AimCanvas.transform.LookAt(cell.transform);
|
||||
return cell;
|
||||
}
|
||||
|
||||
private void Damage(int dmg)
|
||||
{
|
||||
if (_defenceBonus == 0 && _hp - dmg <= 0f)
|
||||
{
|
||||
Death();
|
||||
}
|
||||
|
||||
if (_defenceBonus > 0)
|
||||
{
|
||||
_defenceBonus -= dmg;
|
||||
}
|
||||
else
|
||||
{
|
||||
_hp -= dmg;
|
||||
}
|
||||
|
||||
UpdateBarCanvas();
|
||||
}
|
||||
}
|
||||
}
|
196
Assets/Scripts/Units/Views/UnitView.cs
Normal file
196
Assets/Scripts/Units/Views/UnitView.cs
Normal file
@ -0,0 +1,196 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Data;
|
||||
using DG.Tweening;
|
||||
using HexFiled;
|
||||
using Items;
|
||||
using Units;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
using UnityEngine.UI;
|
||||
using Weapons;
|
||||
using Random = UnityEngine.Random;
|
||||
|
||||
|
||||
public class UnitView : MonoBehaviour
|
||||
{
|
||||
public Action OnStep;
|
||||
public Action OnAttackEnd;
|
||||
public Action OnAttack;
|
||||
public Action<int> OnHit;
|
||||
[SerializeField] private GameObject barCanvas;
|
||||
[SerializeField] private GameObject aimCanvas;
|
||||
[SerializeField] private Image captureBar;
|
||||
|
||||
|
||||
private Stack<ShotUIView> _shootUIStack;
|
||||
private Stack<ShotUIView> _toReloadStack;
|
||||
private Weapon _weapon;
|
||||
private int _manaRegen;
|
||||
private Action _startRegen;
|
||||
private Coroutine _previosRegen;
|
||||
private Coroutine _previosReload;
|
||||
//
|
||||
private WaitForSeconds regenTick = new WaitForSeconds(0.5f);
|
||||
//
|
||||
private int _mana;
|
||||
private Action _capureHex;
|
||||
private Sequence _sequence;
|
||||
private AudioSource _audioSource;
|
||||
private Unit _unit;
|
||||
|
||||
public GameObject BarCanvas => barCanvas;
|
||||
public GameObject AimCanvas => aimCanvas;
|
||||
public UnitColor Color => _unit.Color;
|
||||
|
||||
public void SetUp(Stack<ShotUIView> shots, Weapon weapon, Action regenMana, int manaRegen, Action captureHex,
|
||||
Unit unit)
|
||||
{
|
||||
_shootUIStack = shots;
|
||||
_weapon = weapon;
|
||||
_toReloadStack = new Stack<ShotUIView>();
|
||||
_startRegen = regenMana;
|
||||
_manaRegen = manaRegen;
|
||||
_capureHex = captureHex;
|
||||
_unit = unit;
|
||||
}
|
||||
|
||||
public void HardCaptureHex(HexCell cell)
|
||||
{
|
||||
captureBar.gameObject.SetActive(true);
|
||||
_sequence = DOTween.Sequence();
|
||||
_sequence.Append(captureBar.DOFillAmount(1f, 0f).SetEase(Ease.Linear).OnComplete(() =>
|
||||
{
|
||||
_capureHex?.Invoke();
|
||||
captureBar.DOFillAmount(0f, 0f).SetEase(Ease.Linear);
|
||||
captureBar.gameObject.SetActive(false);
|
||||
MusicController.Instance.PlayRandomClip(MusicController.Instance.MusicData.SfxMusic.Captures,
|
||||
cell.gameObject);
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
public void StopHardCapture()
|
||||
{
|
||||
_sequence.Kill();
|
||||
captureBar.DOFillAmount(0f, 0f).SetEase(Ease.Linear);
|
||||
captureBar.gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
public bool Shoot()
|
||||
{
|
||||
if (_shootUIStack.Count == 0) return false;
|
||||
var shot = _shootUIStack.Pop();
|
||||
shot.Switch();
|
||||
_toReloadStack.Push(shot);
|
||||
if (_previosReload != null)
|
||||
{
|
||||
StopCoroutine(_previosReload);
|
||||
}
|
||||
|
||||
_previosReload = StartCoroutine(Reload());
|
||||
return true;
|
||||
}
|
||||
|
||||
public void RegenMana(int mana)
|
||||
{
|
||||
|
||||
if (_previosRegen != null)
|
||||
{
|
||||
StopCoroutine(_previosRegen);
|
||||
}
|
||||
|
||||
_mana = mana;
|
||||
//_startRegen.Invoke();
|
||||
_previosRegen = StartCoroutine(Regen());
|
||||
|
||||
//return _mana;
|
||||
}
|
||||
|
||||
private void Step()
|
||||
{
|
||||
OnStep?.Invoke();
|
||||
}
|
||||
|
||||
private void Land()
|
||||
{
|
||||
MusicController.Instance.PlayRandomClip(
|
||||
MusicController.Instance.MusicData.SfxMusic.Step, gameObject);
|
||||
}
|
||||
|
||||
private void AttackEnd()
|
||||
{
|
||||
OnAttackEnd?.Invoke();
|
||||
}
|
||||
|
||||
private void Attack()
|
||||
{
|
||||
OnAttack?.Invoke();
|
||||
}
|
||||
|
||||
private void OnTriggerEnter(Collider other)
|
||||
{
|
||||
WeaponView weaponView = other.GetComponent<WeaponView>();
|
||||
if (weaponView != null)
|
||||
{
|
||||
OnHit?.Invoke(weaponView.Weapon.modifiedDamage);
|
||||
other.transform.DOKill();
|
||||
Destroy(other.gameObject);
|
||||
}
|
||||
|
||||
ItemView itemView = other.GetComponent<ItemView>();
|
||||
|
||||
if (itemView != null && _unit.PickUpItem(itemView))
|
||||
{
|
||||
Destroy(itemView.gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerator Reload()
|
||||
{
|
||||
if (_toReloadStack.Count == 0) yield break; //TODO При частой стрльбе перезарядка работает некорректно
|
||||
yield return new WaitForSeconds(_weapon.reloadTime);
|
||||
if (_toReloadStack.Count == 0) yield break;
|
||||
var shot = _toReloadStack.Pop();
|
||||
|
||||
// _shootUIStack.Push(shot);
|
||||
shot.Switch();
|
||||
_shootUIStack.Push(shot);
|
||||
|
||||
foreach (var item in _toReloadStack)
|
||||
{
|
||||
if(Time.deltaTime < _weapon.reloadTime)
|
||||
{
|
||||
StopCoroutine(_previosReload);
|
||||
_previosReload = null;
|
||||
}
|
||||
_previosReload = StartCoroutine(Reload());
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
private IEnumerator Regen()
|
||||
{
|
||||
if (_mana >= 100) //TODO если пользовать ману во время регенерации, то мана не тратится.
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
|
||||
|
||||
yield return new WaitForSeconds(2f);
|
||||
while(_mana < 100)
|
||||
{
|
||||
_mana += _manaRegen;
|
||||
_startRegen.Invoke();
|
||||
}
|
||||
|
||||
//StartCoroutine(Regen());
|
||||
_previosRegen = null;
|
||||
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:93d6d3ca8a7d8423b01faacd00fa3921fe055fb2187873653a925e4cc1af85c0
|
||||
size 694398
|
3
Assets/TextMesh Pro/Fonts/LiberationSans.ttf
Normal file
3
Assets/TextMesh Pro/Fonts/LiberationSans.ttf
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:e5b0af421ea2bfbc1ac8d251d647268087ae82786234c57f757d1f0b90fa8b49
|
||||
size 350200
|
3
Assets/TextMesh Pro/Sprites/EmojiOne.png
Normal file
3
Assets/TextMesh Pro/Sprites/EmojiOne.png
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:a87b965a701de3dc31d7401e542b1fc946587f912c51d7a26e46ade9f098bd1a
|
||||
size 112319
|
Loading…
x
Reference in New Issue
Block a user