From 077fed3feec54646c12e3562028e781374568f8f Mon Sep 17 00:00:00 2001 From: DyatelO Date: Wed, 29 Dec 2021 22:36:19 +0300 Subject: [PATCH 01/11] Debug forUnity --- .vscode/launch.json | 55 +++++++++++++++++++++++++++++++++++++++++++++ .vscode/tasks.json | 42 ++++++++++++++++++++++++++++++++++ 2 files changed, 97 insertions(+) create mode 100644 .vscode/launch.json create mode 100644 .vscode/tasks.json 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 -- 2.47.1 From c6391c6441557dff0593b1edd0d01c834a9a79c1 Mon Sep 17 00:00:00 2001 From: DyatelO Date: Thu, 30 Dec 2021 20:14:47 +0300 Subject: [PATCH 02/11] no message --- Assets/Scripts/HexFiled/PaintedController.cs | 51 +++++++++++++++++++- 1 file changed, 49 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/HexFiled/PaintedController.cs b/Assets/Scripts/HexFiled/PaintedController.cs index d4e64ad8..24a73fdc 100644 --- a/Assets/Scripts/HexFiled/PaintedController.cs +++ b/Assets/Scripts/HexFiled/PaintedController.cs @@ -37,7 +37,7 @@ namespace HexFiled } } } - else if (item.Key == UnitColor.GREY) + else if (item.Key != cell.Color) { } @@ -59,10 +59,56 @@ namespace HexFiled resultDict.Add(cell.Color, new List{cell}); } - } ); + } + ); return resultDict; } + + + private List FillRound(List cells) + { + List neighbourByColor = new List(); + for (int i = 0; i < 6; i++) + { + var neighbour = _cell.GetNeighbor((HexDirection)i); + if(neighbour.Color == _cell.Color) + { + neighbourByColor.Add(neighbour); + } + } + + if(neighbourByColor.Count > 1 && neighbourByColor.Count < 6) + { + + var start = neighbourByColor[Random.Range(0, neighbourByColor.Count - 1)]; + var end = neighbourByColor[Random.Range(0, neighbourByColor.Count - 1)]; + neighbourByColor.Remove(start); + + + var path = HasPath(start, end); + while(neighbourByColor.Count <= 0 && path.hasPath) + { + start = neighbourByColor[Random.Range(0, neighbourByColor.Count - 1)]; + end = neighbourByColor[Random.Range(0, neighbourByColor.Count - 1)]; + neighbourByColor.Remove(start); + path = HasPath(start, end); + } + + if(!path.hasPath) + { + + } + + foreach (var cell in cells) + { + + } + } + + + } + private ( bool hasPath , List field ) HasPath(HexCell start, HexCell end) { List closedList = new List(); @@ -73,6 +119,7 @@ namespace HexFiled closedList.Add(currentCell); + closedList.Add(_cell); while(stackIteators.Count >= 0 ) -- 2.47.1 From def871faed2a6c28477c81d9c817457e18348085 Mon Sep 17 00:00:00 2001 From: dddushesss <37773701+dddushesss@users.noreply.github.com> Date: Mon, 3 Jan 2022 18:47:13 +0300 Subject: [PATCH 03/11] fixes. chosen weapon status --- Assets/ChosenWeapon.cs | 30 ++++++++++++++++++++++++++++++ Assets/ChosenWeapon.cs.meta | 11 +++++++++++ Assets/Scenes/NewMainMenu.unity | 2 +- Assets/WeaponSelection.cs | 7 +++++++ 4 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 Assets/ChosenWeapon.cs create mode 100644 Assets/ChosenWeapon.cs.meta diff --git a/Assets/ChosenWeapon.cs b/Assets/ChosenWeapon.cs new file mode 100644 index 00000000..46236e64 --- /dev/null +++ b/Assets/ChosenWeapon.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using TMPro; +using UnityEngine; +using Weapons; + +public class ChosenWeapon : MonoBehaviour +{ + [SerializeField] private TMP_Text attackText; + [SerializeField] private TMP_Text reloadText; + [SerializeField] private string chosenWeaponDataPath; + + private Weapon Weapon => + JsonUtility.FromJson(File.ReadAllText(Application.persistentDataPath + "/" + chosenWeaponDataPath)); + + private void Start() + { + attackText.text = Weapon.damage.ToString(); + reloadText.text = Weapon.reloadTime.ToString(CultureInfo.CurrentCulture); + } + + public void ChangeChosenWeapon(Weapon weapon) + { + attackText.text = weapon.damage.ToString(); + reloadText.text = weapon.reloadTime.ToString(CultureInfo.CurrentCulture); + } +} \ No newline at end of file diff --git a/Assets/ChosenWeapon.cs.meta b/Assets/ChosenWeapon.cs.meta new file mode 100644 index 00000000..ecd6a459 --- /dev/null +++ b/Assets/ChosenWeapon.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a2920b048f18f5946b93c003a602952b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/NewMainMenu.unity b/Assets/Scenes/NewMainMenu.unity index 9e0990ab..1045a4b3 100644 --- a/Assets/Scenes/NewMainMenu.unity +++ b/Assets/Scenes/NewMainMenu.unity @@ -88770,7 +88770,7 @@ MonoBehaviour: m_EditorClassIdentifier: menuMusSrc: {fileID: 579284492} GameData: {fileID: 11400000, guid: 4828646b64dadac47a63b0be91a92517, type: 2} - dataFilePath: AduioSettings + dataFilePath: AudioSettings.json musicSlider: {fileID: 1813936035} sfxSlider: {fileID: 597565998} musicImage: {fileID: 1040137649} diff --git a/Assets/WeaponSelection.cs b/Assets/WeaponSelection.cs index c465a64b..3c0810fe 100644 --- a/Assets/WeaponSelection.cs +++ b/Assets/WeaponSelection.cs @@ -1,7 +1,9 @@ +using System; using System.Collections.Generic; using System.IO; using DefaultNamespace.Weapons; using UnityEngine; +using UnityEngine.Events; using UnityEngine.UI; using Weapons; @@ -11,6 +13,8 @@ public class WeaponSelection : MonoBehaviour [SerializeField] private WeaponIcon weaponIcon; [SerializeField] private Transform grid; [SerializeField] private string dataFilePath; + [SerializeField] private ChosenWeapon chosenWeapon; + private Action changeStats; private List