summaryrefslogtreecommitdiff
path: root/SurvivalTest/Assets/Scripts/Managers
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2022-04-25 10:09:11 +0800
committerchai <chaifix@163.com>2022-04-25 10:09:11 +0800
commit8131033510c711248de1904649cfa1dbe4bbe69f (patch)
tree80e0db1f24c6d624ac412f240f54cc18e626c3d0 /SurvivalTest/Assets/Scripts/Managers
parent71ae3d755a03a706d93291ca57c6de8e6f0d5926 (diff)
*rename item to prop
Diffstat (limited to 'SurvivalTest/Assets/Scripts/Managers')
-rw-r--r--SurvivalTest/Assets/Scripts/Managers/BattleManager.cs2
-rw-r--r--SurvivalTest/Assets/Scripts/Managers/PlayerManager.cs4
-rw-r--r--SurvivalTest/Assets/Scripts/Managers/PlayerManager_Items.cs35
-rw-r--r--SurvivalTest/Assets/Scripts/Managers/PlayerManager_Props.cs35
-rw-r--r--SurvivalTest/Assets/Scripts/Managers/PlayerManager_Props.cs.meta (renamed from SurvivalTest/Assets/Scripts/Managers/PlayerManager_Items.cs.meta)2
5 files changed, 39 insertions, 39 deletions
diff --git a/SurvivalTest/Assets/Scripts/Managers/BattleManager.cs b/SurvivalTest/Assets/Scripts/Managers/BattleManager.cs
index c473a5d..399ea18 100644
--- a/SurvivalTest/Assets/Scripts/Managers/BattleManager.cs
+++ b/SurvivalTest/Assets/Scripts/Managers/BattleManager.cs
@@ -9,7 +9,7 @@ public class BattleManager : Singleton<BattleManager>
{
UIManager.Instance.OpenPanel(PanelType.PanelTopSuffBar, null);
//UIManager.Instance.OpenPanel(PanelType.PanelBossHpBar, null);
- //UIManager.Instance.OpenPanel(PanelType.PanelItemBar, null);
+ //UIManager.Instance.OpenPanel(PanelType.PanelPropBar, null);
//UIManager.Instance.OpenPanel(PanelType.PanelWeaponBar, null);
}
diff --git a/SurvivalTest/Assets/Scripts/Managers/PlayerManager.cs b/SurvivalTest/Assets/Scripts/Managers/PlayerManager.cs
index bae437e..ce27739 100644
--- a/SurvivalTest/Assets/Scripts/Managers/PlayerManager.cs
+++ b/SurvivalTest/Assets/Scripts/Managers/PlayerManager.cs
@@ -10,7 +10,7 @@ public partial class PlayerManager : Singleton<PlayerManager>
public void Init()
{
- InitItems();
+ InitProps();
InitWeapons();
InitDecorations();
}
@@ -19,7 +19,7 @@ public partial class PlayerManager : Singleton<PlayerManager>
{
CheckInput();
- UpdateItems();
+ UpdateProps();
UpdateWeapons();
UpdateDecorations();
}
diff --git a/SurvivalTest/Assets/Scripts/Managers/PlayerManager_Items.cs b/SurvivalTest/Assets/Scripts/Managers/PlayerManager_Items.cs
deleted file mode 100644
index a22947a..0000000
--- a/SurvivalTest/Assets/Scripts/Managers/PlayerManager_Items.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-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>();
-
- void InitItems()
- {
- m_Items.Add(new Item_B2Phone());
- m_Items.Add(new Item_SpaceBeamer());
- m_Items.Add(new Item_NuclearBomb());
- }
-
- public void UseItem(ItemBase item)
- {
- if(!items.Contains(item))
- {
- Debug.LogError("No such item, name=" + item.name);
- return;
- }
- item.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_Props.cs b/SurvivalTest/Assets/Scripts/Managers/PlayerManager_Props.cs
new file mode 100644
index 0000000..59801f7
--- /dev/null
+++ b/SurvivalTest/Assets/Scripts/Managers/PlayerManager_Props.cs
@@ -0,0 +1,35 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public partial class PlayerManager : Singleton<PlayerManager>
+{
+ // 持有的物品
+ public List<PropBase> props { get { return m_Props; } }
+ private List<PropBase> m_Props = new List<PropBase>();
+
+ void InitProps()
+ {
+ m_Props.Add(new Prop_B2Phone());
+ m_Props.Add(new Prop_SpaceBeamer());
+ m_Props.Add(new Prop_NuclearBomb());
+ }
+
+ public void UseProp(PropBase prop)
+ {
+ if(!props.Contains(prop))
+ {
+ Debug.LogError("No such prop, name=" + prop.name);
+ return;
+ }
+ prop.OnUse(m_Crew.gameObject);
+ }
+
+ void UpdateProps()
+ {
+ for(int i = 0; i < props.Count; ++i)
+ {
+ props[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_Props.cs.meta
index c0307e5..7588f45 100644
--- a/SurvivalTest/Assets/Scripts/Managers/PlayerManager_Items.cs.meta
+++ b/SurvivalTest/Assets/Scripts/Managers/PlayerManager_Props.cs.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: 2b31f1faa8e2c6a4085213ca15e56220
+guid: 704fc6666fbbf0146be9db79e42d7601
MonoImporter:
externalObjects: {}
serializedVersion: 2