From fc2cfdad0d3cfb3844681855c1c45d9415f5ee8e Mon Sep 17 00:00:00 2001 From: chai <215380520@qq.com> Date: Tue, 9 May 2023 19:28:57 +0800 Subject: *misc --- marching/Assets/Scripts/Battle/BattleManager.cs | 10 +++++ .../Assets/Scripts/Battle/BattleManager.cs.meta | 11 +++++ marching/Assets/Scripts/Battle/GridMap.cs | 47 ++++++++++++++++++++++ marching/Assets/Scripts/Battle/GridMap.cs.meta | 11 +++++ marching/Assets/Scripts/Battle/SceneManager.cs | 11 +++++ .../Assets/Scripts/Battle/SceneManager.cs.meta | 11 +++++ 6 files changed, 101 insertions(+) create mode 100644 marching/Assets/Scripts/Battle/BattleManager.cs create mode 100644 marching/Assets/Scripts/Battle/BattleManager.cs.meta create mode 100644 marching/Assets/Scripts/Battle/GridMap.cs create mode 100644 marching/Assets/Scripts/Battle/GridMap.cs.meta create mode 100644 marching/Assets/Scripts/Battle/SceneManager.cs create mode 100644 marching/Assets/Scripts/Battle/SceneManager.cs.meta (limited to 'marching/Assets/Scripts/Battle') diff --git a/marching/Assets/Scripts/Battle/BattleManager.cs b/marching/Assets/Scripts/Battle/BattleManager.cs new file mode 100644 index 0000000..8372139 --- /dev/null +++ b/marching/Assets/Scripts/Battle/BattleManager.cs @@ -0,0 +1,10 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class BattleManager : Singleton +{ + + + +} \ No newline at end of file diff --git a/marching/Assets/Scripts/Battle/BattleManager.cs.meta b/marching/Assets/Scripts/Battle/BattleManager.cs.meta new file mode 100644 index 0000000..a89b003 --- /dev/null +++ b/marching/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/marching/Assets/Scripts/Battle/GridMap.cs b/marching/Assets/Scripts/Battle/GridMap.cs new file mode 100644 index 0000000..c99bf4a --- /dev/null +++ b/marching/Assets/Scripts/Battle/GridMap.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +/// +/// 用Grid托管需要实现这个接口 +/// +public interface IGridMapObject +{ + // 坐标,transform.position + public Vector2 coordinate { get; } +} + +public class GridCell +{ + public List m_Object; +} + +/// +/// 用网格划分场景,不依赖形状,只依赖位置 +/// +public class GridMap +{ + + // 单个cell的大小 + private Vector2 m_CellSize; + + // 整个grid的范围 x, y, xcount, ycount + private Vector4 m_Range; + + // 左上角开始索引 + private List m_GridCells; + + public GridMap() + { + m_GridCells = new List(); + } + + private int GetGridIndex(Vector2 pos) + { + + + return -1; + } + +} \ No newline at end of file diff --git a/marching/Assets/Scripts/Battle/GridMap.cs.meta b/marching/Assets/Scripts/Battle/GridMap.cs.meta new file mode 100644 index 0000000..989a829 --- /dev/null +++ b/marching/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/marching/Assets/Scripts/Battle/SceneManager.cs b/marching/Assets/Scripts/Battle/SceneManager.cs new file mode 100644 index 0000000..9ed2fc9 --- /dev/null +++ b/marching/Assets/Scripts/Battle/SceneManager.cs @@ -0,0 +1,11 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class SceneManager : Singleton +{ + + // 场景内所有对象用这个结构维护 + private GridMap m_GridMap; + +} \ No newline at end of file diff --git a/marching/Assets/Scripts/Battle/SceneManager.cs.meta b/marching/Assets/Scripts/Battle/SceneManager.cs.meta new file mode 100644 index 0000000..fe1604c --- /dev/null +++ b/marching/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: -- cgit v1.1-26-g67d0