Last Fixes
This commit is contained in:
parent
ba49046c27
commit
7167ac5c1c
3080
Assets/Prefabs_NEW/UI/GameCanvas.prefab
Normal file
3080
Assets/Prefabs_NEW/UI/GameCanvas.prefab
Normal file
File diff suppressed because it is too large
Load Diff
7
Assets/Prefabs_NEW/UI/GameCanvas.prefab.meta
Normal file
7
Assets/Prefabs_NEW/UI/GameCanvas.prefab.meta
Normal file
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a72be70db1163c14b8b7a3cb1c00a59d
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -3402,6 +3402,8 @@ MonoBehaviour:
|
||||
- {fileID: 21300000, guid: 426478b073313244bbe84d3ec1cafa64, type: 3}
|
||||
- {fileID: 21300000, guid: 29916103981328e438052adcf04f2737, type: 3}
|
||||
gameText: {fileID: 1138818630}
|
||||
btnNext: {fileID: 866147930}
|
||||
btnPrev: {fileID: 668707257}
|
||||
--- !u!1 &1862883448
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -50,6 +50,7 @@ public class ActionTargetingSystem : MonoBehaviour
|
||||
while (_playerState.IsAnyActionsAllowed())
|
||||
{
|
||||
Vector3 actionDir = new Vector3(CustomInput.rightInput.x, 0f, CustomInput.rightInput.y);
|
||||
actionDir = RecalculateDir(actionDir);
|
||||
TileInfo targetTile = TileManagment.GetTile(_playerState.currentTile.tilePosition, actionDir, _playerState.currentAction.distance);
|
||||
|
||||
if (IsTargetingAllowed(targetTile))
|
||||
@ -85,4 +86,23 @@ public class ActionTargetingSystem : MonoBehaviour
|
||||
StopAllCoroutines();
|
||||
_playerState.currentActionTarget = null;
|
||||
}
|
||||
|
||||
private Vector3 RecalculateDir(Vector3 dir)
|
||||
{
|
||||
if (dir.magnitude < 0.3f)
|
||||
{
|
||||
return Vector3.zero;
|
||||
}
|
||||
Vector3 closestDir = TileManagment.basicDirections[0];
|
||||
foreach (var newDir in TileManagment.basicDirections)
|
||||
{
|
||||
float distOld = Vector3.Distance(closestDir, dir);
|
||||
float distNew = Vector3.Distance(newDir, dir);
|
||||
if (distNew < distOld)
|
||||
{
|
||||
closestDir = newDir;
|
||||
}
|
||||
}
|
||||
return closestDir;
|
||||
}
|
||||
}
|
||||
|
@ -11,10 +11,18 @@ public class ChooseLevelButtonsTasks : MonoBehaviour
|
||||
[SerializeField] private List<Sprite> menuSprites;
|
||||
[SerializeField] private TextMeshProUGUI gameText;
|
||||
|
||||
[SerializeField] private GameObject btnNext, btnPrev;
|
||||
|
||||
private List<string> menuText = new List<string> { "MATS", "EMIR" };
|
||||
|
||||
private int levelsAmount = 2;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
btnNext.SetActive(true);
|
||||
btnPrev.SetActive(false);
|
||||
}
|
||||
|
||||
public void OnPrevBtnClick()
|
||||
{
|
||||
GameData.currentChosenLevel--;
|
||||
@ -25,6 +33,9 @@ public class ChooseLevelButtonsTasks : MonoBehaviour
|
||||
|
||||
menuLevelImg.sprite = menuSprites[GameData.currentChosenLevel - 1];
|
||||
gameText.text = menuText[GameData.currentChosenLevel - 1];
|
||||
|
||||
btnNext.SetActive(true);
|
||||
btnPrev.SetActive(false);
|
||||
}
|
||||
|
||||
public void OnNextBtnClick()
|
||||
@ -37,6 +48,9 @@ public class ChooseLevelButtonsTasks : MonoBehaviour
|
||||
|
||||
menuLevelImg.sprite = menuSprites[GameData.currentChosenLevel - 1];
|
||||
gameText.text = menuText[GameData.currentChosenLevel - 1];
|
||||
|
||||
btnNext.SetActive(false);
|
||||
btnPrev.SetActive(true);
|
||||
}
|
||||
|
||||
public void OnTestBtnClick()
|
||||
|
@ -127,7 +127,7 @@ PlayerSettings:
|
||||
16:10: 1
|
||||
16:9: 1
|
||||
Others: 1
|
||||
bundleVersion: 0.44
|
||||
bundleVersion: 0.45
|
||||
preloadedAssets: []
|
||||
metroInputSource: 0
|
||||
wsaTransparentSwapchain: 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user