summaryrefslogtreecommitdiff
path: root/WorldlineKeepers/Assets/Scripts/Battle
diff options
context:
space:
mode:
Diffstat (limited to 'WorldlineKeepers/Assets/Scripts/Battle')
-rw-r--r--WorldlineKeepers/Assets/Scripts/Battle/BattleManager.cs10
-rw-r--r--WorldlineKeepers/Assets/Scripts/Battle/BattleManager.cs.meta11
-rw-r--r--WorldlineKeepers/Assets/Scripts/Battle/GridMap.cs47
-rw-r--r--WorldlineKeepers/Assets/Scripts/Battle/GridMap.cs.meta11
-rw-r--r--WorldlineKeepers/Assets/Scripts/Battle/SceneManager.cs11
-rw-r--r--WorldlineKeepers/Assets/Scripts/Battle/SceneManager.cs.meta11
6 files changed, 101 insertions, 0 deletions
diff --git a/WorldlineKeepers/Assets/Scripts/Battle/BattleManager.cs b/WorldlineKeepers/Assets/Scripts/Battle/BattleManager.cs
new file mode 100644
index 0000000..8372139
--- /dev/null
+++ b/WorldlineKeepers/Assets/Scripts/Battle/BattleManager.cs
@@ -0,0 +1,10 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class BattleManager : Singleton<BattleManager>
+{
+
+
+
+} \ No newline at end of file
diff --git a/WorldlineKeepers/Assets/Scripts/Battle/BattleManager.cs.meta b/WorldlineKeepers/Assets/Scripts/Battle/BattleManager.cs.meta
new file mode 100644
index 0000000..a89b003
--- /dev/null
+++ b/WorldlineKeepers/Assets/Scripts/Battle/BattleManager.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: bea0e35a4b2fa264698b0e2816565545
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/WorldlineKeepers/Assets/Scripts/Battle/GridMap.cs b/WorldlineKeepers/Assets/Scripts/Battle/GridMap.cs
new file mode 100644
index 0000000..c99bf4a
--- /dev/null
+++ b/WorldlineKeepers/Assets/Scripts/Battle/GridMap.cs
@@ -0,0 +1,47 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+/// <summary>
+/// 用Grid托管需要实现这个接口
+/// </summary>
+public interface IGridMapObject
+{
+ // 坐标,transform.position
+ public Vector2 coordinate { get; }
+}
+
+public class GridCell
+{
+ public List<IGridMapObject> m_Object;
+}
+
+/// <summary>
+/// 用网格划分场景,不依赖形状,只依赖位置
+/// </summary>
+public class GridMap
+{
+
+ // 单个cell的大小
+ private Vector2 m_CellSize;
+
+ // 整个grid的范围 x, y, xcount, ycount
+ private Vector4 m_Range;
+
+ // 左上角开始索引
+ private List<GridCell> m_GridCells;
+
+ public GridMap()
+ {
+ m_GridCells = new List<GridCell>();
+ }
+
+ private int GetGridIndex(Vector2 pos)
+ {
+
+
+ return -1;
+ }
+
+} \ No newline at end of file
diff --git a/WorldlineKeepers/Assets/Scripts/Battle/GridMap.cs.meta b/WorldlineKeepers/Assets/Scripts/Battle/GridMap.cs.meta
new file mode 100644
index 0000000..989a829
--- /dev/null
+++ b/WorldlineKeepers/Assets/Scripts/Battle/GridMap.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 66e52a379c253b54d896c3a5631bfdfa
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/WorldlineKeepers/Assets/Scripts/Battle/SceneManager.cs b/WorldlineKeepers/Assets/Scripts/Battle/SceneManager.cs
new file mode 100644
index 0000000..9ed2fc9
--- /dev/null
+++ b/WorldlineKeepers/Assets/Scripts/Battle/SceneManager.cs
@@ -0,0 +1,11 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class SceneManager : Singleton<SceneManager>
+{
+
+ // 场景内所有对象用这个结构维护
+ private GridMap m_GridMap;
+
+} \ No newline at end of file
diff --git a/WorldlineKeepers/Assets/Scripts/Battle/SceneManager.cs.meta b/WorldlineKeepers/Assets/Scripts/Battle/SceneManager.cs.meta
new file mode 100644
index 0000000..fe1604c
--- /dev/null
+++ b/WorldlineKeepers/Assets/Scripts/Battle/SceneManager.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 4d3730897865ceb44a87a57742832f78
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant: