diff options
Diffstat (limited to 'SurvivalTest/Assets/Scripts')
4 files changed, 41 insertions, 1 deletions
diff --git a/SurvivalTest/Assets/Scripts/Managers/PlayerManager_Weapons.cs b/SurvivalTest/Assets/Scripts/Managers/PlayerManager_Weapons.cs index 381beb8..9a0f9db 100644 --- a/SurvivalTest/Assets/Scripts/Managers/PlayerManager_Weapons.cs +++ b/SurvivalTest/Assets/Scripts/Managers/PlayerManager_Weapons.cs @@ -12,9 +12,12 @@ public partial class PlayerManager : Singleton<PlayerManager> public bool isFire { get; private set; } + public bool autoFire {get{return m_AutoFire;}} private bool m_AutoFire; private float m_AutoFireDuration = 0.8f; + public bool lockAim { get; set; } + private float m_LastAxisValue = 0; void InitWeapons() diff --git a/SurvivalTest/Assets/Scripts/Test/TestPeaceMaker.cs b/SurvivalTest/Assets/Scripts/Test/TestPeaceMaker.cs index e4e3879..3662daf 100644 --- a/SurvivalTest/Assets/Scripts/Test/TestPeaceMaker.cs +++ b/SurvivalTest/Assets/Scripts/Test/TestPeaceMaker.cs @@ -77,7 +77,17 @@ public class TestPeaceMaker : CrewScript private Vector3 m_TargetZoom; // 锁定瞄准,以移动方向为准 - private bool m_LockAim; + private bool m_LockAim + { + get + { + return PlayerManager.Instance.lockAim; + } + set + { + PlayerManager.Instance.lockAim = value; + } + } private enum ControlMode { diff --git a/SurvivalTest/Assets/Scripts/UI/Panel/PanelTopStuffBar/UIStateSection.cs b/SurvivalTest/Assets/Scripts/UI/Panel/PanelTopStuffBar/UIStateSection.cs new file mode 100644 index 0000000..991ec3a --- /dev/null +++ b/SurvivalTest/Assets/Scripts/UI/Panel/PanelTopStuffBar/UIStateSection.cs @@ -0,0 +1,16 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class UIStateSection : MonoBehaviour +{ + public GameObject m_AutoFire; + public GameObject m_LockAim; + + private void Update() + { + m_AutoFire.SetActive(PlayerManager.Instance.autoFire); + m_LockAim.SetActive(PlayerManager.Instance.lockAim); + } + +}
\ No newline at end of file diff --git a/SurvivalTest/Assets/Scripts/UI/Panel/PanelTopStuffBar/UIStateSection.cs.meta b/SurvivalTest/Assets/Scripts/UI/Panel/PanelTopStuffBar/UIStateSection.cs.meta new file mode 100644 index 0000000..b29afd9 --- /dev/null +++ b/SurvivalTest/Assets/Scripts/UI/Panel/PanelTopStuffBar/UIStateSection.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 718f0f01a21e1e546b984ad0739fc76d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: |