diff --git a/Assets/Resources/1/Animation/Character/TestController.controller b/Assets/Resources/1/Animation/Character/TestController.controller index f879d988..9e4e0164 100644 --- a/Assets/Resources/1/Animation/Character/TestController.controller +++ b/Assets/Resources/1/Animation/Character/TestController.controller @@ -866,7 +866,7 @@ AnimatorState: m_MirrorParameterActive: 0 m_CycleOffsetParameterActive: 0 m_TimeParameterActive: 0 - m_Motion: {fileID: 7400000, guid: 9dd3a0a7b64c33c45b2ff87106004a95, type: 2} + m_Motion: {fileID: 7400000, guid: f4bfcb0bd8f4807429f6f6d3dd70cc15, type: 2} m_Tag: m_SpeedParameter: m_MirrorParameter: diff --git a/Assets/Resources/Data/PlayerData.asset b/Assets/Resources/Data/PlayerData.asset index 17438812..1a06e80e 100644 --- a/Assets/Resources/Data/PlayerData.asset +++ b/Assets/Resources/Data/PlayerData.asset @@ -19,5 +19,5 @@ MonoBehaviour: type: 3} joystickView: {fileID: 4385872142190176059, guid: 4df6913b39f4979429158c344680d83f, type: 3} - Tick: 0.8 + Tick: 0.5 hexTexture: {fileID: 2800000, guid: 0298dfcb0756f534a9a125d510461c7a, type: 3} diff --git a/Assets/Scenes/SampleScene.unity b/Assets/Scenes/SampleScene.unity index 32230375..195e8b80 100644 --- a/Assets/Scenes/SampleScene.unity +++ b/Assets/Scenes/SampleScene.unity @@ -292,8 +292,8 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 963194225} - m_LocalRotation: {x: 0.2588191, y: 0, z: 0, w: 0.9659258} - m_LocalPosition: {x: 15, y: 15, z: -10} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 14.935106, y: 1.1221166, z: 13.4063225} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} diff --git a/Assets/Scripts/Chars/Player.cs b/Assets/Scripts/Chars/Player.cs index c8e53112..3fa7780e 100644 --- a/Assets/Scripts/Chars/Player.cs +++ b/Assets/Scripts/Chars/Player.cs @@ -1,5 +1,6 @@ using System; using Data; +using DG.Tweening; using HexFiled; using TMPro; using UnityEngine; @@ -17,6 +18,8 @@ namespace Chars private HexGrid _hexGrid; private Texture _texture; public Action OnPlayerSpawned; + private Animator _animator; + private float _tick; public GameObject Playerinstance => _instance; @@ -27,6 +30,7 @@ namespace Chars _isAlive = false; _hexGrid = hexGrid; _texture = playerData.hexTexture; + _tick = playerData.Tick; } @@ -36,8 +40,17 @@ namespace Chars { _cell = _cell.GetNeighbor(direction); _curentPosition = _cell.coordinates; - _cell.PaintHex(_texture); - _instance.transform.localPosition = _cell.transform.localPosition; + + _instance.transform.LookAt(_cell.transform); + _animator.SetTrigger("Move"); + _animator.SetBool("isMoving", true); + _instance.transform.DOMove(_cell.transform.position, _tick).OnComplete(() => + { + _animator.SetBool("isMoving", false); + _animator.SetTrigger("Jump"); + _cell.PaintHex(_texture); + }); + } } @@ -55,6 +68,7 @@ namespace Chars _instance.transform.localPosition = _cell.transform.localPosition; OnPlayerSpawned?.Invoke(_instance); _isAlive = true; + _animator = _instance.GetComponent(); } } diff --git a/Assets/Scripts/Chars/PlayerControl.cs b/Assets/Scripts/Chars/PlayerControl.cs index c4584ba6..efa44d9a 100644 --- a/Assets/Scripts/Chars/PlayerControl.cs +++ b/Assets/Scripts/Chars/PlayerControl.cs @@ -27,10 +27,12 @@ namespace Chars public void Execute() { + if (Time.time - _curTime >= _tick && _moveJoystick.Direction != Vector2.zero) { _curTime = Time.time; _player.Move(VectorToDirection(_moveJoystick.Direction.normalized)); + } } diff --git a/Assets/Scripts/HexFiled/HexMetrics.cs b/Assets/Scripts/HexFiled/HexMetrics.cs index 71d3350d..e84ca518 100644 --- a/Assets/Scripts/HexFiled/HexMetrics.cs +++ b/Assets/Scripts/HexFiled/HexMetrics.cs @@ -1,6 +1,4 @@ -using UnityEngine; - -namespace HexFiled +namespace HexFiled { public static class HexMetrics { diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index d833dcb1..7bff9cd4 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -257,7 +257,14 @@ PlayerSettings: AndroidMinifyDebug: 0 AndroidValidateAppBundleSize: 1 AndroidAppBundleSizeToValidate: 150 - m_BuildTargetIcons: [] + m_BuildTargetIcons: + - m_BuildTarget: + m_Icons: + - serializedVersion: 2 + m_Icon: {fileID: 2800000, guid: 5bb37d3bcba28fc41a02b3dfb56cccec, type: 3} + m_Width: 128 + m_Height: 128 + m_Kind: 0 m_BuildTargetPlatformIcons: - m_BuildTarget: Android m_Icons: @@ -647,6 +654,7 @@ PlayerSettings: ps4videoRecordingFeaturesUsed: 0 ps4contentSearchFeaturesUsed: 0 ps4CompatibilityPS5: 0 + ps4AllowPS5Detection: 0 ps4GPU800MHz: 1 ps4attribEyeToEyeDistanceSettingVR: 0 ps4IncludedModules: []