diff --git a/Assets/Editor.meta b/Assets/Editor.meta deleted file mode 100644 index 7893de34..00000000 --- a/Assets/Editor.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 173f6a76aed37484ab7c21df3d06555d -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Editor/CustomSnap.cs b/Assets/Editor/CustomSnap.cs deleted file mode 100644 index 9ced2c4b..00000000 --- a/Assets/Editor/CustomSnap.cs +++ /dev/null @@ -1,7 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public class CustomSnap : MonoBehaviour -{ -} diff --git a/Assets/Editor/CustomSnap.cs.meta b/Assets/Editor/CustomSnap.cs.meta deleted file mode 100644 index 05601b5d..00000000 --- a/Assets/Editor/CustomSnap.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 15744dd8ca4a9044b844f2c87e4715eb -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Editor/CustomSnapPoint.cs b/Assets/Editor/CustomSnapPoint.cs deleted file mode 100644 index 24e2b69f..00000000 --- a/Assets/Editor/CustomSnapPoint.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public class CustomSnapPoint : MonoBehaviour -{ - private void OnDrawGizmos() - { - Gizmos.color = Color.green; - Gizmos.DrawSphere(transform.position, radius: 0.05f); - } -} diff --git a/Assets/Editor/CustomSnapPoint.cs.meta b/Assets/Editor/CustomSnapPoint.cs.meta deleted file mode 100644 index 889642e3..00000000 --- a/Assets/Editor/CustomSnapPoint.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 44c61104889393343ac0fea14ff74581 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Editor/CustomSnappingTool.cs b/Assets/Editor/CustomSnappingTool.cs deleted file mode 100644 index 2350d96c..00000000 --- a/Assets/Editor/CustomSnappingTool.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEditor; -using UnityEditor.EditorTools; -using UnityEngine; - -[EditorTool("Custom Snap Move", typeof(CustomSnap))] -public class CustomSnappingTool : EditorTool -{ - public Texture2D ToolIcon; - - public override GUIContent toolbarIcon { - get - { - - return new GUIContent - { - image = ToolIcon, - text = "Custom Snape Move Tool", - tooltip = "Custom Snape Move Tool - best tool ever" - }; - } - } - - public override void OnToolGUI(EditorWindow window) - { - Transform targetTransform = ((CustomSnap)target).transform; - - EditorGUI.BeginChangeCheck(); - Vector3 newPosition = Handles.PositionHandle(targetTransform.position, Quaternion.identity); - - if(EditorGUI.EndChangeCheck()) - { - Undo.RecordObject(targetTransform, name: "Move with snap tool"); - } MoveWithSnapping(targetTransform, newPosition); - } - - - private void MoveWithSnapping(Transform targetTransform, Vector3 newPosition) - { - CustomSnapPoint[] allPoints = FindObjectsOfType(); - CustomSnapPoint[] targetPoints = targetTransform.GetComponentsInChildren(); - - Vector3 bestPosition = newPosition; - float closestDistance = float.PositiveInfinity; - - foreach (CustomSnapPoint point in allPoints) - { - if (point.transform.parent == targetTransform) continue; - - foreach (CustomSnapPoint ownPoint in targetPoints) - { - Vector3 targetPos = point.transform.position - (ownPoint.transform.position - targetTransform.position); - float distance = Vector3.Distance(a: targetPos, b: newPosition); - - if(distance < closestDistance) - { - closestDistance = distance; - bestPosition = targetPos; - } - } - } - - if(closestDistance < 0.5f) - { - targetTransform.position = bestPosition; - } - else - { - targetTransform.position = newPosition; - } - - - - } -} - diff --git a/Assets/Editor/CustomSnappingTool.cs.meta b/Assets/Editor/CustomSnappingTool.cs.meta deleted file mode 100644 index 7459948f..00000000 --- a/Assets/Editor/CustomSnappingTool.cs.meta +++ /dev/null @@ -1,13 +0,0 @@ -fileFormatVersion: 2 -guid: cce80278a8aadb94bac8ebc9be8cf090 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: - - m_Target: {instanceID: 0} - - ToolIcon: {fileID: 2800000, guid: 0b6f492d8c1555c4da0550561f2e5f4b, type: 3} - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scenes/MainMenu.unity b/Assets/Scenes/MainMenu.unity index adabe942..7baf5208 100644 --- a/Assets/Scenes/MainMenu.unity +++ b/Assets/Scenes/MainMenu.unity @@ -3401,6 +3401,7 @@ MonoBehaviour: menuSprites: - {fileID: 21300000, guid: 426478b073313244bbe84d3ec1cafa64, type: 3} - {fileID: 21300000, guid: 29916103981328e438052adcf04f2737, type: 3} + gameText: {fileID: 1138818630} --- !u!1 &1862883448 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/Actions/SuperJump.cs b/Assets/Scripts/Actions/SuperJump.cs index 0bae0422..06bc1761 100644 --- a/Assets/Scripts/Actions/SuperJump.cs +++ b/Assets/Scripts/Actions/SuperJump.cs @@ -71,6 +71,7 @@ public class SuperJump : PlayerAction if (tile.buildingOnTile != null) { Destroy(tile.buildingOnTile); + TileManagment.ReleaseTile(tile); } } } diff --git a/Assets/Scripts/ChooseLevelButtonsTasks.cs b/Assets/Scripts/ChooseLevelButtonsTasks.cs index 34795d0a..4ad98c54 100644 --- a/Assets/Scripts/ChooseLevelButtonsTasks.cs +++ b/Assets/Scripts/ChooseLevelButtonsTasks.cs @@ -3,11 +3,15 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; +using TMPro; public class ChooseLevelButtonsTasks : MonoBehaviour { [SerializeField] private Image menuLevelImg; [SerializeField] private List menuSprites; + [SerializeField] private TextMeshProUGUI gameText; + + private List menuText = new List { "MATS", "EMIR" }; private int levelsAmount = 2; @@ -20,6 +24,7 @@ public class ChooseLevelButtonsTasks : MonoBehaviour } menuLevelImg.sprite = menuSprites[GameData.currentChosenLevel - 1]; + gameText.text = menuText[GameData.currentChosenLevel - 1]; } public void OnNextBtnClick() @@ -31,6 +36,7 @@ public class ChooseLevelButtonsTasks : MonoBehaviour } menuLevelImg.sprite = menuSprites[GameData.currentChosenLevel - 1]; + gameText.text = menuText[GameData.currentChosenLevel - 1]; } public void OnTestBtnClick() diff --git a/Assets/Scripts/Global/TileManagment.cs b/Assets/Scripts/Global/TileManagment.cs index 28a4cb77..a170fb7e 100644 --- a/Assets/Scripts/Global/TileManagment.cs +++ b/Assets/Scripts/Global/TileManagment.cs @@ -68,6 +68,7 @@ public class TileManagment : MonoBehaviour foreach (var tile in levelTiles) { lvTilesStruct[(int)Mathf.Round(2 * tile.tilePosition.x / tileOffset), (int)Mathf.Round(-2 * tile.tilePosition.z / tileOffset)] = tile; + //Debug.Log((int)Mathf.Round(2 * tile.tilePosition.x / tileOffset) +" and "+ Mathf.Round(-2 * tile.tilePosition.z / tileOffset)); } OnInitialized?.Invoke(); @@ -194,8 +195,9 @@ public class TileManagment : MonoBehaviour { return resultTile; }*/ - if (position.x < 0 || position.z > 0) + if (position.x < 0 || position.z > 0.5f) { + //Debug.Log("null pos"); return null; } @@ -203,8 +205,10 @@ public class TileManagment : MonoBehaviour if (result != null) { + //Debug.Log(result); return result; } + //Debug.Log("not tile"); return null; } diff --git a/Assets/ToweHealthController.cs b/Assets/ToweHealthController.cs index 93ccb765..9456094e 100644 --- a/Assets/ToweHealthController.cs +++ b/Assets/ToweHealthController.cs @@ -31,6 +31,8 @@ public class ToweHealthController : MonoBehaviour private void Die() { + TileInfo tile = TileManagment.GetTile(transform.position); + TileManagment.ReleaseTile(tile); Destroy(gameObject); } } diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 62c1c49a..b0844762 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -127,7 +127,7 @@ PlayerSettings: 16:10: 1 16:9: 1 Others: 1 - bundleVersion: 0.36 + bundleVersion: 0.38 preloadedAssets: [] metroInputSource: 0 wsaTransparentSwapchain: 0