diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000..8bcd690c --- /dev/null +++ b/.vscode/launch.json @@ -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" + } + ] +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 00000000..008f20fa --- /dev/null +++ b/.vscode/tasks.json @@ -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" + } + ] +} \ No newline at end of file diff --git a/Assets/Prefab/AimCanvas.prefab b/Assets/Prefab/AimCanvas.prefab index f4bfadc2..977eacfb 100644 --- a/Assets/Prefab/AimCanvas.prefab +++ b/Assets/Prefab/AimCanvas.prefab @@ -83,7 +83,7 @@ MonoBehaviour: m_FallbackScreenDPI: 96 m_DefaultSpriteDPI: 96 m_DynamicPixelsPerUnit: 1 - m_PresetInfoIsWorld: 0 + m_PresetInfoIsWorld: 1 --- !u!114 &6763014501615571600 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/Assets/Prefab/BarCAnvas.prefab b/Assets/Prefab/BarCAnvas.prefab index dd93665b..f714807f 100644 --- a/Assets/Prefab/BarCAnvas.prefab +++ b/Assets/Prefab/BarCAnvas.prefab @@ -186,7 +186,7 @@ RectTransform: 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.1486} + 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 @@ -232,7 +232,7 @@ MonoBehaviour: m_FallbackScreenDPI: 96 m_DefaultSpriteDPI: 96 m_DynamicPixelsPerUnit: 1 - m_PresetInfoIsWorld: 1 + m_PresetInfoIsWorld: 0 --- !u!114 &1271697267505620599 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/Assets/Prefab/Tests.meta b/Assets/Prefab/Tests.meta new file mode 100644 index 00000000..707e25a2 --- /dev/null +++ b/Assets/Prefab/Tests.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: dfc9988be09620a4798e070262bdf0c6 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefab/Tests/Bullet.prefab b/Assets/Prefab/Tests/Bullet.prefab new file mode 100644 index 00000000..0776e572 --- /dev/null +++ b/Assets/Prefab/Tests/Bullet.prefab @@ -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: diff --git a/Assets/Prefab/Tests/Bullet.prefab.meta b/Assets/Prefab/Tests/Bullet.prefab.meta new file mode 100644 index 00000000..8e50a10e --- /dev/null +++ b/Assets/Prefab/Tests/Bullet.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 657111cb607c294479046ca0faef6c69 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefab/Tests/DestroyBullet.cs b/Assets/Prefab/Tests/DestroyBullet.cs new file mode 100644 index 00000000..088e5a3c --- /dev/null +++ b/Assets/Prefab/Tests/DestroyBullet.cs @@ -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); + } + + +} diff --git a/Assets/Prefab/Tests/DestroyBullet.cs.meta b/Assets/Prefab/Tests/DestroyBullet.cs.meta new file mode 100644 index 00000000..a55c5a98 --- /dev/null +++ b/Assets/Prefab/Tests/DestroyBullet.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7fd043b309962ec4ab2244e7b7257fe7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefab/Tests/Fire.cs b/Assets/Prefab/Tests/Fire.cs new file mode 100644 index 00000000..b7174afc --- /dev/null +++ b/Assets/Prefab/Tests/Fire.cs @@ -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 ammoStack = new Stack(); + + 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(). + 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); + + } + } + } +} diff --git a/Assets/Prefab/Tests/Fire.cs.meta b/Assets/Prefab/Tests/Fire.cs.meta new file mode 100644 index 00000000..e5079bb9 --- /dev/null +++ b/Assets/Prefab/Tests/Fire.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9f62e81b9dba43648bc3e2f3bcd1bc9e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/1/Character/Prefab/Asvald.prefab b/Assets/Resources/1/Character/Prefab/Asvald.prefab index cb0b121e..af7f694b 100644 --- a/Assets/Resources/1/Character/Prefab/Asvald.prefab +++ b/Assets/Resources/1/Character/Prefab/Asvald.prefab @@ -3931,6 +3931,11 @@ PrefabInstance: propertyPath: m_PresetInfoIsWorld value: 1 objectReference: {fileID: 0} + - target: {fileID: 9185818537322146330, guid: dec5dd0d644d5c548a53563e65837162, + type: 3} + propertyPath: m_FillAmount + value: 1 + objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: dec5dd0d644d5c548a53563e65837162, type: 3} --- !u!1 &5591725933991455353 stripped diff --git a/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_box_blur.png b/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_box_blur.png index cd2fd258..c10a5c51 100644 Binary files a/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_box_blur.png and b/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_box_blur.png differ diff --git a/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_circle.png b/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_circle.png index 371155cb..d3513f67 100644 Binary files a/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_circle.png and b/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_circle.png differ diff --git a/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_circle_blur 1.png b/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_circle_blur 1.png index db4881f4..45aede34 100644 Binary files a/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_circle_blur 1.png and b/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_circle_blur 1.png differ diff --git a/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_circle_blur.png b/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_circle_blur.png index a7166f61..2f373045 100644 Binary files a/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_circle_blur.png and b/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_circle_blur.png differ diff --git a/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_circle_glow.png b/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_circle_glow.png index 9da115c1..362833eb 100644 Binary files a/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_circle_glow.png and b/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_circle_glow.png differ diff --git a/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_circle_line_blue.png b/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_circle_line_blue.png index a3d2540d..5cd3a29e 100644 Binary files a/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_circle_line_blue.png and b/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_circle_line_blue.png differ diff --git a/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_glow.png b/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_glow.png index e34655a9..360301b0 100644 Binary files a/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_glow.png and b/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_glow.png differ diff --git a/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_glow_small.png b/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_glow_small.png index f5382101..b80b1ab3 100644 Binary files a/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_glow_small.png and b/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_glow_small.png differ diff --git a/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_rotate_line.png b/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_rotate_line.png index b93c4977..beac0344 100644 Binary files a/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_rotate_line.png and b/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_rotate_line.png differ diff --git a/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_rotate_line_small.png b/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_rotate_line_small.png index b050f1d7..69c3b491 100644 Binary files a/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_rotate_line_small.png and b/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_rotate_line_small.png differ diff --git a/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_special_particle_blue.png b/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_special_particle_blue.png index f1ffcecc..ef08e7c6 100644 Binary files a/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_special_particle_blue.png and b/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_special_particle_blue.png differ diff --git a/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_special_particle_green.png b/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_special_particle_green.png index 36dda1e9..bce6fdb8 100644 Binary files a/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_special_particle_green.png and b/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_special_particle_green.png differ diff --git a/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_special_particle_purple.png b/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_special_particle_purple.png index 1807018a..8f2de3f7 100644 Binary files a/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_special_particle_purple.png and b/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_special_particle_purple.png differ diff --git a/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_special_particle_red.png b/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_special_particle_red.png index bd90f1c4..744f1620 100644 Binary files a/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_special_particle_red.png and b/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_special_particle_red.png differ diff --git a/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_special_particle_white.png b/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_special_particle_white.png index fd1acd65..edf07c6e 100644 Binary files a/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_special_particle_white.png and b/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_special_particle_white.png differ diff --git a/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_special_particle_yellow.png b/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_special_particle_yellow.png index bedae3e2..f19b8e60 100644 Binary files a/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_special_particle_yellow.png and b/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_special_particle_yellow.png differ diff --git a/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_star_blue.png b/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_star_blue.png index 19ec6b45..ddad7171 100644 Binary files a/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_star_blue.png and b/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_star_blue.png differ diff --git a/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_star_green.png b/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_star_green.png index e44ee7a1..0823f903 100644 Binary files a/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_star_green.png and b/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_star_green.png differ diff --git a/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_star_light.png b/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_star_light.png index f6d27888..64c7403f 100644 Binary files a/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_star_light.png and b/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_star_light.png differ diff --git a/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_star_purple.png b/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_star_purple.png index 7020c5cd..9f41dc2a 100644 Binary files a/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_star_purple.png and b/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_star_purple.png differ diff --git a/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_star_red.png b/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_star_red.png index 2d4e1e8e..b0152acf 100644 Binary files a/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_star_red.png and b/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_star_red.png differ diff --git a/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_star_white.png b/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_star_white.png index 06ae4cd8..0530fef7 100644 Binary files a/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_star_white.png and b/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_star_white.png differ diff --git a/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_star_yellow.png b/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_star_yellow.png index 2479aebf..d7d287d4 100644 Binary files a/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_star_yellow.png and b/Assets/Resources/1/_NewSprites/Fx_Paticle/Particle/Texture/fx_star_yellow.png differ diff --git a/Assets/Resources/1/_NewSprites/Logo.png b/Assets/Resources/1/_NewSprites/Logo.png index 28f75064..9158210d 100644 Binary files a/Assets/Resources/1/_NewSprites/Logo.png and b/Assets/Resources/1/_NewSprites/Logo.png differ diff --git a/Assets/Resources/1/_NewSprites/icon.png b/Assets/Resources/1/_NewSprites/icon.png index c16c6f9f..1062e656 100644 Binary files a/Assets/Resources/1/_NewSprites/icon.png and b/Assets/Resources/1/_NewSprites/icon.png differ diff --git a/Assets/Resources/Data/ItemData.asset b/Assets/Resources/Data/ItemData.asset index 7270ebb4..ce450559 100644 --- a/Assets/Resources/Data/ItemData.asset +++ b/Assets/Resources/Data/ItemData.asset @@ -20,6 +20,7 @@ MonoBehaviour: spawnablePrefab: {fileID: 4774919592469818776, guid: 0dbed8f974ba44a42af9d8fcae504ce0, type: 3} values: + spawnChance: 0.2 - prefab: {fileID: 3197816592181874056, guid: 2704c4f795b0d7748a3e3fa53be4d893, type: 3} isInstantUse: 1 @@ -27,6 +28,7 @@ MonoBehaviour: icon: {fileID: 21300000, guid: caf8bc0311dd2fc4ca1528a82a063754, type: 3} spawnablePrefab: {fileID: 0} values: 030000000f000000 + spawnChance: 0.516 - prefab: {fileID: 8639522512577941448, guid: 7b6a7f64e52da514d88aa97ad8f863df, type: 3} isInstantUse: 1 @@ -34,5 +36,6 @@ MonoBehaviour: icon: {fileID: 21300000, guid: 35be128594dcdce48b5d8e5317b38ed9, type: 3} spawnablePrefab: {fileID: 0} values: 0a0000001e000000 + spawnChance: 0.797 fromTimeSpawn: 3 toTimeSpawn: 10 diff --git a/Assets/Scripts/Controller/GameInit.cs b/Assets/Scripts/Controller/GameInit.cs index 9d80907c..6d5f3388 100644 --- a/Assets/Scripts/Controller/GameInit.cs +++ b/Assets/Scripts/Controller/GameInit.cs @@ -26,8 +26,9 @@ namespace Controller 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); @@ -39,7 +40,9 @@ namespace Controller { if (unit.isPlayer) { - player = new Unit(unit, JsonUtility.FromJson(data.ChosenWeapon), hexGrid); + var weapon = JsonUtility.FromJson(data.ChosenWeapon); + weapon.SetModifiedDamage(0); + player = new Unit(unit, weapon, hexGrid); PlayerControl playerControl = new PlayerControl(player, uiController.PlayerControlView, uiController.PlayerInventoryView); controllers.Add(playerControl); diff --git a/Assets/Scripts/Items/ItemFabric.cs b/Assets/Scripts/Items/ItemFabric.cs index 78e2dc56..24dbc13e 100644 --- a/Assets/Scripts/Items/ItemFabric.cs +++ b/Assets/Scripts/Items/ItemFabric.cs @@ -52,13 +52,13 @@ namespace Items while (closedList.Contains(cell) || cell.Item != null) { - cell = _openList[Random.Range(0, _openList.Count - 1)]; + return; } var type = GetWeightedType(); while (type == null) { - type = GetWeightedType(); + return; } var info = _itemInfos[type.ToString().Replace("Items.", "")]; var obj = (Item)Activator.CreateInstance(type, info); diff --git a/Assets/Scripts/States.meta b/Assets/Scripts/States.meta new file mode 100644 index 00000000..9d483bc7 --- /dev/null +++ b/Assets/Scripts/States.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4690d5b96a9971f4fa845f4b25440eba +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/States/Gamelogic.cs b/Assets/Scripts/States/Gamelogic.cs new file mode 100644 index 00000000..7d63a649 --- /dev/null +++ b/Assets/Scripts/States/Gamelogic.cs @@ -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 regenList; + public Mana() + { + regenList = new List(); + } + public Mana(float max, float current) + { + Max_MP = max; + Current_MP = current; + regenList = new List(); + } + 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; + } +} diff --git a/Assets/Scripts/States/Gamelogic.cs.meta b/Assets/Scripts/States/Gamelogic.cs.meta new file mode 100644 index 00000000..9c61c694 --- /dev/null +++ b/Assets/Scripts/States/Gamelogic.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4d34080a61fa47645b032357092bcc99 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/States/ManaBar.cs b/Assets/Scripts/States/ManaBar.cs new file mode 100644 index 00000000..daeb0b5f --- /dev/null +++ b/Assets/Scripts/States/ManaBar.cs @@ -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; + } + +} diff --git a/Assets/Scripts/States/ManaBar.cs.meta b/Assets/Scripts/States/ManaBar.cs.meta new file mode 100644 index 00000000..15b65a13 --- /dev/null +++ b/Assets/Scripts/States/ManaBar.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 38891abd62cc9634584e630986c02534 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/States/Player.cs b/Assets/Scripts/States/Player.cs new file mode 100644 index 00000000..6fd8e04a --- /dev/null +++ b/Assets/Scripts/States/Player.cs @@ -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); + } + } +} diff --git a/Assets/Scripts/States/Player.cs.meta b/Assets/Scripts/States/Player.cs.meta new file mode 100644 index 00000000..9aa40202 --- /dev/null +++ b/Assets/Scripts/States/Player.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8effecfd846c8cf43ab76c0185e0f2a0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Units/AI.meta b/Assets/Scripts/Units/AI.meta deleted file mode 100644 index 0f365721..00000000 --- a/Assets/Scripts/Units/AI.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 32fec41995024d6f9b110df79b751c97 -timeCreated: 1641238734 \ No newline at end of file diff --git a/Assets/Scripts/Units/Unit.cs b/Assets/Scripts/Units/Unit.cs index 08df4777..a473036d 100644 --- a/Assets/Scripts/Units/Unit.cs +++ b/Assets/Scripts/Units/Unit.cs @@ -66,7 +66,7 @@ namespace Units { _weapon.SetModifiedDamage(0); } - + public void SetDefenceBonus(int duration, int value) { TimerHelper.Instance.StartTimer(StopDefenceBonus, duration); @@ -77,7 +77,7 @@ namespace Units { _defenceBonus = 0; } - + public void Move(HexDirection direction) { if (!_cell.GetNeighbor(direction) || _isBusy) return; @@ -169,7 +169,8 @@ namespace Units _animator = _instance.GetComponent(); _unitView = _instance.GetComponent(); _barCanvas = _unitView.BarCanvas.GetComponent(); - _unitView.SetUp(_barCanvas.SpawnShotUI(_weapon.shots), _weapon, RegenMana, _data.manaRegen, CaptureHex, this); + _unitView.SetUp(_barCanvas.SpawnShotUI(_weapon.shots), _weapon, RegenMana, _data.manaRegen, CaptureHex, + this); SetAnimLength(); MusicController.Instance.AddAudioSource(_instance); _mana = _data.maxMana; @@ -201,6 +202,7 @@ namespace Units { _inventory.Remove(item); } + private void MoveEnd() { _isBusy = false; @@ -274,6 +276,8 @@ namespace Units 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); } @@ -324,7 +328,6 @@ namespace Units private void Damage(int dmg) { - if (_defenceBonus == 0 && _hp - dmg <= 0f) { Death(); @@ -338,7 +341,7 @@ namespace Units { _hp -= dmg; } - + UpdateBarCanvas(); } } diff --git a/Assets/Scripts/Units/Views/UnitView.cs b/Assets/Scripts/Units/Views/UnitView.cs index eea60bda..fd95f684 100644 --- a/Assets/Scripts/Units/Views/UnitView.cs +++ b/Assets/Scripts/Units/Views/UnitView.cs @@ -31,6 +31,9 @@ public class UnitView : MonoBehaviour 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; @@ -92,13 +95,17 @@ public class UnitView : MonoBehaviour public void RegenMana(int mana) { + if (_previosRegen != null) { StopCoroutine(_previosRegen); } _mana = mana; + //_startRegen.Invoke(); _previosRegen = StartCoroutine(Regen()); + + //return _mana; } private void Step() @@ -146,9 +153,24 @@ public class UnitView : MonoBehaviour yield return new WaitForSeconds(_weapon.reloadTime); if (_toReloadStack.Count == 0) yield break; var shot = _toReloadStack.Pop(); - shot.Switch(); - _shootUIStack.Push(shot); - StartCoroutine(Reload()); + + // _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() @@ -158,9 +180,17 @@ public class UnitView : MonoBehaviour yield break; } - yield return new WaitForSeconds(1f); - _mana += _manaRegen; - _startRegen.Invoke(); - StartCoroutine(Regen()); + + yield return new WaitForSeconds(2f); + while(_mana < 100) + { + _mana += _manaRegen; + _startRegen.Invoke(); + } + + //StartCoroutine(Regen()); + _previosRegen = null; + + } } \ No newline at end of file diff --git a/Assets/TextMesh Pro/Documentation/TextMesh Pro User Guide 2016.pdf b/Assets/TextMesh Pro/Documentation/TextMesh Pro User Guide 2016.pdf index c2ea2d27..1db4e05f 100644 Binary files a/Assets/TextMesh Pro/Documentation/TextMesh Pro User Guide 2016.pdf and b/Assets/TextMesh Pro/Documentation/TextMesh Pro User Guide 2016.pdf differ diff --git a/Assets/TextMesh Pro/Fonts/LiberationSans.ttf b/Assets/TextMesh Pro/Fonts/LiberationSans.ttf index 626dd936..0d896af6 100644 Binary files a/Assets/TextMesh Pro/Fonts/LiberationSans.ttf and b/Assets/TextMesh Pro/Fonts/LiberationSans.ttf differ diff --git a/Assets/TextMesh Pro/Sprites/EmojiOne.png b/Assets/TextMesh Pro/Sprites/EmojiOne.png index c0de66d0..63e49d09 100644 Binary files a/Assets/TextMesh Pro/Sprites/EmojiOne.png and b/Assets/TextMesh Pro/Sprites/EmojiOne.png differ