diff options
author | chai <chaifix@163.com> | 2022-04-23 13:24:05 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2022-04-23 13:24:05 +0800 |
commit | bdb737230b30e8fb9be63d95b792e8c8ba531ea0 (patch) | |
tree | 9e1fe83c65af581d6b3411bcf1b00af4bde8990a /SurvivalTest/Assets/Scripts/Managers | |
parent | 747a355b8a7d273264ce1d8f1848633f8fa52c47 (diff) |
* ui staff
Diffstat (limited to 'SurvivalTest/Assets/Scripts/Managers')
10 files changed, 178 insertions, 0 deletions
diff --git a/SurvivalTest/Assets/Scripts/Managers/BattleManager.cs b/SurvivalTest/Assets/Scripts/Managers/BattleManager.cs new file mode 100644 index 0000000..102bc34 --- /dev/null +++ b/SurvivalTest/Assets/Scripts/Managers/BattleManager.cs @@ -0,0 +1,17 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class BattleManager : Singleton<BattleManager> +{ + + public void Init() + { + UIManager.Instance.OpenPanel(PanelType.PanelItemBar, null); + } + + public void Update() + { + } + +}
\ No newline at end of file diff --git a/SurvivalTest/Assets/Scripts/Managers/BattleManager.cs.meta b/SurvivalTest/Assets/Scripts/Managers/BattleManager.cs.meta new file mode 100644 index 0000000..ce61fdc --- /dev/null +++ b/SurvivalTest/Assets/Scripts/Managers/BattleManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0625fb778ee3237468a8f99fc92c37bd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/SurvivalTest/Assets/Scripts/Managers/PlayerManager.cs b/SurvivalTest/Assets/Scripts/Managers/PlayerManager.cs new file mode 100644 index 0000000..59593b0 --- /dev/null +++ b/SurvivalTest/Assets/Scripts/Managers/PlayerManager.cs @@ -0,0 +1,35 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public partial class PlayerManager : Singleton<PlayerManager> +{ + + // 角色 + private CrewScript m_Crew; + + // 持有的装备 + public List<EquipBase> equips { get { return m_Equips; } } + private List<EquipBase> m_Equips = new List<EquipBase>(); + + // 持有的饰品 + public List<DecorationBase> decorations { get { return m_Decorations; } } + private List<DecorationBase> m_Decorations = new List<DecorationBase>(); + + public void Init() + { + InitItems(); + + } + + public void Update() + { + UpdateItems(); + } + + public void SetCrew(CrewScript crew) + { + m_Crew = crew; + } + +}
\ No newline at end of file diff --git a/SurvivalTest/Assets/Scripts/Managers/PlayerManager.cs.meta b/SurvivalTest/Assets/Scripts/Managers/PlayerManager.cs.meta new file mode 100644 index 0000000..848ec64 --- /dev/null +++ b/SurvivalTest/Assets/Scripts/Managers/PlayerManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c2c3da009e0d8114597080ecff2e380c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/SurvivalTest/Assets/Scripts/Managers/PlayerManager_Decorations.cs b/SurvivalTest/Assets/Scripts/Managers/PlayerManager_Decorations.cs new file mode 100644 index 0000000..ce85849 --- /dev/null +++ b/SurvivalTest/Assets/Scripts/Managers/PlayerManager_Decorations.cs @@ -0,0 +1,10 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + + +public partial class PlayerManager : Singleton<PlayerManager> +{ + + +}
\ No newline at end of file diff --git a/SurvivalTest/Assets/Scripts/Managers/PlayerManager_Decorations.cs.meta b/SurvivalTest/Assets/Scripts/Managers/PlayerManager_Decorations.cs.meta new file mode 100644 index 0000000..3cc2dc3 --- /dev/null +++ b/SurvivalTest/Assets/Scripts/Managers/PlayerManager_Decorations.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6f2b538b1ec21a548b41fe478e5b3bd3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/SurvivalTest/Assets/Scripts/Managers/PlayerManager_Equips.cs b/SurvivalTest/Assets/Scripts/Managers/PlayerManager_Equips.cs new file mode 100644 index 0000000..ce85849 --- /dev/null +++ b/SurvivalTest/Assets/Scripts/Managers/PlayerManager_Equips.cs @@ -0,0 +1,10 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + + +public partial class PlayerManager : Singleton<PlayerManager> +{ + + +}
\ No newline at end of file diff --git a/SurvivalTest/Assets/Scripts/Managers/PlayerManager_Equips.cs.meta b/SurvivalTest/Assets/Scripts/Managers/PlayerManager_Equips.cs.meta new file mode 100644 index 0000000..c43b512 --- /dev/null +++ b/SurvivalTest/Assets/Scripts/Managers/PlayerManager_Equips.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 19dc8d657411e8d47a563a47442d687d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/SurvivalTest/Assets/Scripts/Managers/PlayerManager_Items.cs b/SurvivalTest/Assets/Scripts/Managers/PlayerManager_Items.cs new file mode 100644 index 0000000..a0cfe52 --- /dev/null +++ b/SurvivalTest/Assets/Scripts/Managers/PlayerManager_Items.cs @@ -0,0 +1,51 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public partial class PlayerManager : Singleton<PlayerManager> +{ + // 持有的物品 + public List<ItemBase> items { get { return m_Items; } } + private List<ItemBase> m_Items = new List<ItemBase>(); + + // 当前选中的物品 + ItemBase m_CurrentItem = null; + + void InitItems() + { + m_Items.Add(new Item_B2Phone()); + m_Items.Add(new Item_SpaceBeamer()); + } + + /// <summary> + /// 选中物品 + /// </summary> + public void SetCurrentItem(ItemBase item) + { + if (!items.Contains(item)) + { + Debug.LogError("No such item"); + return; + } + m_CurrentItem = item; + } + + /// <summary> + /// 使用当前道具 + /// </summary> + public void UseCurrentItem() + { + if (m_CurrentItem == null) + return; + + m_CurrentItem.OnUse(m_Crew.gameObject); + } + + void UpdateItems() + { + for(int i = 0; i < items.Count; ++i) + { + items[i].Update(); + } + } +}
\ No newline at end of file diff --git a/SurvivalTest/Assets/Scripts/Managers/PlayerManager_Items.cs.meta b/SurvivalTest/Assets/Scripts/Managers/PlayerManager_Items.cs.meta new file mode 100644 index 0000000..c0307e5 --- /dev/null +++ b/SurvivalTest/Assets/Scripts/Managers/PlayerManager_Items.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2b31f1faa8e2c6a4085213ca15e56220 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: |