From 94fcee00f610b32ca05746ab502e32c1abb2cabb Mon Sep 17 00:00:00 2001 From: dddushesss <37773701+dddushesss@users.noreply.github.com> Date: Wed, 29 Dec 2021 06:15:38 +0300 Subject: [PATCH] fixed unit bar facing camera, other minor fixes --- Assets/Prefab/BarCAnvas.prefab | 20 ++++++------ Assets/Prefab/PauseMenu.prefab | 4 +-- .../1/Animation/Character/MoveJump.anim | 7 +++++ .../1/Character/Prefab/Ariost.prefab | 13 ++++---- .../1/Character/Prefab/Asvald.prefab | 6 ++-- .../Resources/1/Character/Prefab/Emir.prefab | 7 +++-- .../Resources/1/Character/Prefab/Mats.prefab | 7 +++-- .../1/Character/Prefab/Ragnar.prefab | 31 +++++++++++++------ Assets/Resources/Data/MusicData.asset | 2 +- Assets/Resources/JSONData.meta | 8 ----- Assets/Resources/JSONData/ChosenWeapon.json | 1 - .../Resources/JSONData/ChosenWeapon.json.meta | 7 ----- Assets/Resources/JSONData/Settings.json | 1 - Assets/Resources/JSONData/Settings.json.meta | 7 ----- Assets/Scenes/Level 1.unity | 2 +- Assets/Scripts/Controller/GameInit.cs | 2 +- Assets/Scripts/Data/MusicData.cs | 2 +- Assets/Scripts/GameUI/UIController.cs | 6 ++-- Assets/Scripts/Units/PlayerControl.cs | 8 +++-- Assets/Scripts/Units/Unit.cs | 1 + Assets/Scripts/Units/Views/UnitView.cs | 9 +++--- 21 files changed, 77 insertions(+), 74 deletions(-) delete mode 100644 Assets/Resources/JSONData.meta delete mode 100644 Assets/Resources/JSONData/ChosenWeapon.json delete mode 100644 Assets/Resources/JSONData/ChosenWeapon.json.meta delete mode 100644 Assets/Resources/JSONData/Settings.json delete mode 100644 Assets/Resources/JSONData/Settings.json.meta diff --git a/Assets/Prefab/BarCAnvas.prefab b/Assets/Prefab/BarCAnvas.prefab index c6d03e10..dd93665b 100644 --- a/Assets/Prefab/BarCAnvas.prefab +++ b/Assets/Prefab/BarCAnvas.prefab @@ -26,7 +26,7 @@ RectTransform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 3185331048183402439} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 5} + m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 5156761560679623958} @@ -34,7 +34,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 0, y: 3.75} + m_AnchoredPosition: {x: 0, y: 0.53} m_SizeDelta: {x: 3, y: 0.2} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &8174616228555596217 @@ -95,7 +95,7 @@ RectTransform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 4564225513960759228} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 5} + m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 6551948662265214362} @@ -104,7 +104,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 2.08, y: 4} + m_AnchoredPosition: {x: 2.08, y: 0.94} m_SizeDelta: {x: 1, y: 1} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &3314045166140750521 @@ -186,8 +186,8 @@ 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: 0} - m_SizeDelta: {x: 1080, y: 1920} + m_AnchoredPosition: {x: 0, y: 1.1486} + m_SizeDelta: {x: 10, y: 5.4055} m_Pivot: {x: 0.5, y: 0.5} --- !u!223 &8490769543284739872 Canvas: @@ -293,7 +293,7 @@ RectTransform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 6201783996967795459} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 5} + m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 9025064510373730425} @@ -302,7 +302,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 0, y: 4.25} + m_AnchoredPosition: {x: 0, y: 1.1899414} m_SizeDelta: {x: 3, y: 0.5} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &1357902011422320789 @@ -370,7 +370,7 @@ RectTransform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 6720477436881757364} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 5} + m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 5156761560679623958} @@ -378,7 +378,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 0.01, y: 4.83} + m_AnchoredPosition: {x: 0, y: 2} m_SizeDelta: {x: 3, y: 0.3} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &3872739704401499897 diff --git a/Assets/Prefab/PauseMenu.prefab b/Assets/Prefab/PauseMenu.prefab index c09e67bc..e32fb3ab 100644 --- a/Assets/Prefab/PauseMenu.prefab +++ b/Assets/Prefab/PauseMenu.prefab @@ -316,9 +316,9 @@ Canvas: m_OverrideSorting: 0 m_OverridePixelPerfect: 0 m_SortingBucketNormalizedSize: 0 - m_AdditionalShaderChannelsFlag: 25 + m_AdditionalShaderChannelsFlag: 0 m_SortingLayerID: 0 - m_SortingOrder: 0 + m_SortingOrder: 1 m_TargetDisplay: 0 --- !u!114 &5296751824488078439 MonoBehaviour: diff --git a/Assets/Resources/1/Animation/Character/MoveJump.anim b/Assets/Resources/1/Animation/Character/MoveJump.anim index 5a97d5a9..ec0d7795 100644 --- a/Assets/Resources/1/Animation/Character/MoveJump.anim +++ b/Assets/Resources/1/Animation/Character/MoveJump.anim @@ -73420,6 +73420,13 @@ AnimationClip: m_HasMotionFloatCurves: 0 m_Events: - time: 0.4 + functionName: Land + data: + objectReferenceParameter: {fileID: 0} + floatParameter: 0 + intParameter: 0 + messageOptions: 0 + - time: 0.53333336 functionName: Step data: objectReferenceParameter: {fileID: 0} diff --git a/Assets/Resources/1/Character/Prefab/Ariost.prefab b/Assets/Resources/1/Character/Prefab/Ariost.prefab index a441068f..ec61188b 100644 --- a/Assets/Resources/1/Character/Prefab/Ariost.prefab +++ b/Assets/Resources/1/Character/Prefab/Ariost.prefab @@ -1691,6 +1691,7 @@ MonoBehaviour: m_EditorClassIdentifier: barCanvas: {fileID: 268172662505640299} aimCanvas: {fileID: 1011384888140022260} + captureBar: {fileID: 0} --- !u!136 &1900872271281143359 CapsuleCollider: m_ObjectHideFlags: 0 @@ -3913,12 +3914,12 @@ PrefabInstance: - target: {fileID: 5156761560679623958, guid: dec5dd0d644d5c548a53563e65837162, type: 3} propertyPath: m_SizeDelta.x - value: 1080 + value: 10 objectReference: {fileID: 0} - target: {fileID: 5156761560679623958, guid: dec5dd0d644d5c548a53563e65837162, type: 3} propertyPath: m_SizeDelta.y - value: 1920 + value: 3 objectReference: {fileID: 0} - target: {fileID: 5156761560679623958, guid: dec5dd0d644d5c548a53563e65837162, type: 3} @@ -3943,17 +3944,17 @@ PrefabInstance: - target: {fileID: 5156761560679623958, guid: dec5dd0d644d5c548a53563e65837162, type: 3} propertyPath: m_LocalRotation.x - value: -0 + value: 0 objectReference: {fileID: 0} - target: {fileID: 5156761560679623958, guid: dec5dd0d644d5c548a53563e65837162, type: 3} propertyPath: m_LocalRotation.y - value: -0 + value: 0 objectReference: {fileID: 0} - target: {fileID: 5156761560679623958, guid: dec5dd0d644d5c548a53563e65837162, type: 3} propertyPath: m_LocalRotation.z - value: -0 + value: 0 objectReference: {fileID: 0} - target: {fileID: 5156761560679623958, guid: dec5dd0d644d5c548a53563e65837162, type: 3} @@ -3963,7 +3964,7 @@ PrefabInstance: - target: {fileID: 5156761560679623958, guid: dec5dd0d644d5c548a53563e65837162, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: 3 objectReference: {fileID: 0} - target: {fileID: 5156761560679623958, guid: dec5dd0d644d5c548a53563e65837162, type: 3} diff --git a/Assets/Resources/1/Character/Prefab/Asvald.prefab b/Assets/Resources/1/Character/Prefab/Asvald.prefab index 9c767b4d..cb0b121e 100644 --- a/Assets/Resources/1/Character/Prefab/Asvald.prefab +++ b/Assets/Resources/1/Character/Prefab/Asvald.prefab @@ -3854,12 +3854,12 @@ PrefabInstance: - target: {fileID: 5156761560679623958, guid: dec5dd0d644d5c548a53563e65837162, type: 3} propertyPath: m_SizeDelta.x - value: 1080 + value: 10 objectReference: {fileID: 0} - target: {fileID: 5156761560679623958, guid: dec5dd0d644d5c548a53563e65837162, type: 3} propertyPath: m_SizeDelta.y - value: 1920 + value: 5 objectReference: {fileID: 0} - target: {fileID: 5156761560679623958, guid: dec5dd0d644d5c548a53563e65837162, type: 3} @@ -3904,7 +3904,7 @@ PrefabInstance: - target: {fileID: 5156761560679623958, guid: dec5dd0d644d5c548a53563e65837162, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: 3 objectReference: {fileID: 0} - target: {fileID: 5156761560679623958, guid: dec5dd0d644d5c548a53563e65837162, type: 3} diff --git a/Assets/Resources/1/Character/Prefab/Emir.prefab b/Assets/Resources/1/Character/Prefab/Emir.prefab index 517871f4..632138e3 100644 --- a/Assets/Resources/1/Character/Prefab/Emir.prefab +++ b/Assets/Resources/1/Character/Prefab/Emir.prefab @@ -390,6 +390,7 @@ MonoBehaviour: m_EditorClassIdentifier: barCanvas: {fileID: 9197595637317142914} aimCanvas: {fileID: 8420239414472468003} + captureBar: {fileID: 0} --- !u!136 &1571523103774403885 CapsuleCollider: m_ObjectHideFlags: 0 @@ -3778,12 +3779,12 @@ PrefabInstance: - target: {fileID: 5156761560679623958, guid: dec5dd0d644d5c548a53563e65837162, type: 3} propertyPath: m_SizeDelta.x - value: 1080 + value: 10 objectReference: {fileID: 0} - target: {fileID: 5156761560679623958, guid: dec5dd0d644d5c548a53563e65837162, type: 3} propertyPath: m_SizeDelta.y - value: 1920 + value: 5 objectReference: {fileID: 0} - target: {fileID: 5156761560679623958, guid: dec5dd0d644d5c548a53563e65837162, type: 3} @@ -3828,7 +3829,7 @@ PrefabInstance: - target: {fileID: 5156761560679623958, guid: dec5dd0d644d5c548a53563e65837162, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: 3 objectReference: {fileID: 0} - target: {fileID: 5156761560679623958, guid: dec5dd0d644d5c548a53563e65837162, type: 3} diff --git a/Assets/Resources/1/Character/Prefab/Mats.prefab b/Assets/Resources/1/Character/Prefab/Mats.prefab index b5dcfdb9..b2044614 100644 --- a/Assets/Resources/1/Character/Prefab/Mats.prefab +++ b/Assets/Resources/1/Character/Prefab/Mats.prefab @@ -3517,6 +3517,7 @@ MonoBehaviour: m_EditorClassIdentifier: barCanvas: {fileID: 8614863231585036848} aimCanvas: {fileID: 8409302512724572423} + captureBar: {fileID: 0} --- !u!136 &2198464067484123790 CapsuleCollider: m_ObjectHideFlags: 0 @@ -3853,12 +3854,12 @@ PrefabInstance: - target: {fileID: 5156761560679623958, guid: dec5dd0d644d5c548a53563e65837162, type: 3} propertyPath: m_SizeDelta.x - value: 1080 + value: 10 objectReference: {fileID: 0} - target: {fileID: 5156761560679623958, guid: dec5dd0d644d5c548a53563e65837162, type: 3} propertyPath: m_SizeDelta.y - value: 1920 + value: 5 objectReference: {fileID: 0} - target: {fileID: 5156761560679623958, guid: dec5dd0d644d5c548a53563e65837162, type: 3} @@ -3903,7 +3904,7 @@ PrefabInstance: - target: {fileID: 5156761560679623958, guid: dec5dd0d644d5c548a53563e65837162, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: 3 objectReference: {fileID: 0} - target: {fileID: 5156761560679623958, guid: dec5dd0d644d5c548a53563e65837162, type: 3} diff --git a/Assets/Resources/1/Character/Prefab/Ragnar.prefab b/Assets/Resources/1/Character/Prefab/Ragnar.prefab index 2b4730e7..256bcd96 100644 --- a/Assets/Resources/1/Character/Prefab/Ragnar.prefab +++ b/Assets/Resources/1/Character/Prefab/Ragnar.prefab @@ -175,6 +175,7 @@ MonoBehaviour: m_EditorClassIdentifier: barCanvas: {fileID: 7624052504724712865} aimCanvas: {fileID: 3979930549707458788} + captureBar: {fileID: 650245892348180691} --- !u!136 &6373024555497604353 CapsuleCollider: m_ObjectHideFlags: 0 @@ -3932,18 +3933,18 @@ PrefabInstance: objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 09a0317cbdff9fa479a18c9e20743a8e, type: 3} ---- !u!224 &2548601768047453584 stripped -RectTransform: - m_CorrespondingSourceObject: {fileID: 859777855380249073, guid: 09a0317cbdff9fa479a18c9e20743a8e, - type: 3} - m_PrefabInstance: {fileID: 2932116763859057761} - m_PrefabAsset: {fileID: 0} --- !u!1 &3979930549707458788 stripped GameObject: m_CorrespondingSourceObject: {fileID: 2273039178377770117, guid: 09a0317cbdff9fa479a18c9e20743a8e, type: 3} m_PrefabInstance: {fileID: 2932116763859057761} m_PrefabAsset: {fileID: 0} +--- !u!224 &2548601768047453584 stripped +RectTransform: + m_CorrespondingSourceObject: {fileID: 859777855380249073, guid: 09a0317cbdff9fa479a18c9e20743a8e, + type: 3} + m_PrefabInstance: {fileID: 2932116763859057761} + m_PrefabAsset: {fileID: 0} --- !u!1001 &4196108535858654659 PrefabInstance: m_ObjectHideFlags: 0 @@ -3989,12 +3990,12 @@ PrefabInstance: - target: {fileID: 5156761560679623958, guid: dec5dd0d644d5c548a53563e65837162, type: 3} propertyPath: m_SizeDelta.x - value: 1080 + value: 10 objectReference: {fileID: 0} - target: {fileID: 5156761560679623958, guid: dec5dd0d644d5c548a53563e65837162, type: 3} propertyPath: m_SizeDelta.y - value: 1920 + value: 5 objectReference: {fileID: 0} - target: {fileID: 5156761560679623958, guid: dec5dd0d644d5c548a53563e65837162, type: 3} @@ -4039,7 +4040,7 @@ PrefabInstance: - target: {fileID: 5156761560679623958, guid: dec5dd0d644d5c548a53563e65837162, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: 3 objectReference: {fileID: 0} - target: {fileID: 5156761560679623958, guid: dec5dd0d644d5c548a53563e65837162, type: 3} @@ -4080,3 +4081,15 @@ RectTransform: type: 3} m_PrefabInstance: {fileID: 4196108535858654659} m_PrefabAsset: {fileID: 0} +--- !u!114 &650245892348180691 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 3692302203462554896, guid: dec5dd0d644d5c548a53563e65837162, + type: 3} + m_PrefabInstance: {fileID: 4196108535858654659} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: diff --git a/Assets/Resources/Data/MusicData.asset b/Assets/Resources/Data/MusicData.asset index e51f20a4..cdeee3ff 100644 --- a/Assets/Resources/Data/MusicData.asset +++ b/Assets/Resources/Data/MusicData.asset @@ -12,7 +12,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: ad850cd32937403f853eb6043fd04112, type: 3} m_Name: MusicData m_EditorClassIdentifier: - _settingsDataPath: /Resources/JSONData/Settings.json + _settingsDataPath: AudioSettings.json startMusic: {fileID: 0} backMusic: {fileID: 0} sfxMusic: diff --git a/Assets/Resources/JSONData.meta b/Assets/Resources/JSONData.meta deleted file mode 100644 index 59d48924..00000000 --- a/Assets/Resources/JSONData.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 856a9bb11d821f940a80bec1f53b90cb -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Resources/JSONData/ChosenWeapon.json b/Assets/Resources/JSONData/ChosenWeapon.json deleted file mode 100644 index 5db88fb7..00000000 --- a/Assets/Resources/JSONData/ChosenWeapon.json +++ /dev/null @@ -1 +0,0 @@ -{"icon":{"instanceID":17620},"objectToThrow":{"instanceID":17622},"VFXGameObject":{"instanceID":17624},"manaCost":15,"damage":30,"speed":0.5,"disnatce":3,"reloadTime":3.0,"shots":5,"shotSound":{"instanceID":17616},"hitSound":{"instanceID":17618}} \ No newline at end of file diff --git a/Assets/Resources/JSONData/ChosenWeapon.json.meta b/Assets/Resources/JSONData/ChosenWeapon.json.meta deleted file mode 100644 index a3fa5822..00000000 --- a/Assets/Resources/JSONData/ChosenWeapon.json.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 45125a3db50f8da4386961cbf7cb7f0a -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Resources/JSONData/Settings.json b/Assets/Resources/JSONData/Settings.json deleted file mode 100644 index 66077129..00000000 --- a/Assets/Resources/JSONData/Settings.json +++ /dev/null @@ -1 +0,0 @@ -{"isMusicAllowed":true,"isSFXAllowed":true} \ No newline at end of file diff --git a/Assets/Resources/JSONData/Settings.json.meta b/Assets/Resources/JSONData/Settings.json.meta deleted file mode 100644 index 4c1e9b22..00000000 --- a/Assets/Resources/JSONData/Settings.json.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 9c94023e876c0ee41906f81ec324e486 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scenes/Level 1.unity b/Assets/Scenes/Level 1.unity index de97658d..061f5128 100644 --- a/Assets/Scenes/Level 1.unity +++ b/Assets/Scenes/Level 1.unity @@ -141,7 +141,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 + m_IsActive: 1 --- !u!114 &763084229 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/Controller/GameInit.cs b/Assets/Scripts/Controller/GameInit.cs index 22f42b41..e51929cb 100644 --- a/Assets/Scripts/Controller/GameInit.cs +++ b/Assets/Scripts/Controller/GameInit.cs @@ -21,7 +21,7 @@ namespace Controller controllers.Add(hexGrid); UIController uiController = new UIController(data.UIData); - uiController.Spawn(); + uiController.Spawn(); //TODO при паузе Unit player; List units = new List(); diff --git a/Assets/Scripts/Data/MusicData.cs b/Assets/Scripts/Data/MusicData.cs index 5ac359b3..04df0025 100644 --- a/Assets/Scripts/Data/MusicData.cs +++ b/Assets/Scripts/Data/MusicData.cs @@ -20,7 +20,7 @@ namespace Data public AudioClip BackMusic => backMusic; public SFXMusic SfxMusic => sfxMusic; - public AudioSettings Settings => JsonUtility.FromJson(File.ReadAllText(Application.dataPath + _settingsDataPath)); + public AudioSettings Settings => JsonUtility.FromJson(File.ReadAllText(Application.persistentDataPath + "/" + _settingsDataPath)); } [Serializable] diff --git a/Assets/Scripts/GameUI/UIController.cs b/Assets/Scripts/GameUI/UIController.cs index 99904bf1..4d5cea91 100644 --- a/Assets/Scripts/GameUI/UIController.cs +++ b/Assets/Scripts/GameUI/UIController.cs @@ -19,9 +19,11 @@ namespace GameUI public void Spawn() { - _playerControlView = Object.Instantiate(_uiData.PlayerControlView); + var canvasGroup = new GameObject("CanvasGroup"); + canvasGroup.AddComponent(); + _playerControlView = Object.Instantiate(_uiData.PlayerControlView, canvasGroup.transform); - _uiData.ObjectsToSpawn.ForEach(x => Object.Instantiate(x)); + _uiData.ObjectsToSpawn.ForEach(x => Object.Instantiate(x, canvasGroup.transform)); } } } \ No newline at end of file diff --git a/Assets/Scripts/Units/PlayerControl.cs b/Assets/Scripts/Units/PlayerControl.cs index b3ac6e18..4951d5f8 100644 --- a/Assets/Scripts/Units/PlayerControl.cs +++ b/Assets/Scripts/Units/PlayerControl.cs @@ -43,8 +43,10 @@ namespace Chars public void FixedExecute() { + if (!_unit.IsBusy && _moveJoystick.Direction != Vector2.zero) { + _unit.Move(VectorToDirection(_moveJoystick.Direction.normalized)); } @@ -95,9 +97,9 @@ namespace Chars { if (_unit.IsAlive) { - _unit.UnitView.BarCanvas.transform.DOLookAt( - _unit.UnitView.BarCanvas.transform.position + _camera.transform.rotation * Vector3.back, 0f, - up: _camera.transform.rotation * Vector3.up); + _unit.UnitView.BarCanvas.transform.LookAt( + _unit.UnitView.BarCanvas.transform.position + _camera.transform.rotation * Vector3.back, + _camera.transform.rotation * Vector3.up); } } } diff --git a/Assets/Scripts/Units/Unit.cs b/Assets/Scripts/Units/Unit.cs index 0ebbf77c..9e6cdfc9 100644 --- a/Assets/Scripts/Units/Unit.cs +++ b/Assets/Scripts/Units/Unit.cs @@ -232,6 +232,7 @@ namespace Units private void RotateUnit(Vector2 direction) { + _unitView.transform.DOLookAt(new Vector3(direction.x, 0, direction.y) + _unitView.transform.position, 0.1f); } diff --git a/Assets/Scripts/Units/Views/UnitView.cs b/Assets/Scripts/Units/Views/UnitView.cs index f8d75685..9a7e506e 100644 --- a/Assets/Scripts/Units/Views/UnitView.cs +++ b/Assets/Scripts/Units/Views/UnitView.cs @@ -1,12 +1,7 @@ using System; using System.Collections; using System.Collections.Generic; -using Data; -using DefaultNamespace; -using DefaultNamespace.Weapons; using DG.Tweening; -using DG.Tweening.Core; -using TMPro; using UnityEngine; using UnityEngine.UI; using Weapons; @@ -97,6 +92,10 @@ public class UnitView : MonoBehaviour private void Step() { OnStep?.Invoke(); + } + + private void Land() + { MusicController.Instance.PlayerAudioClip( MusicController.Instance.MusicData.SfxMusic.Step[ Random.Range(0, MusicController.Instance.MusicData.SfxMusic.Step.Count - 1)], gameObject);