From e7d64874872d2c44a76a0b26eec3d1d87872f37d Mon Sep 17 00:00:00 2001 From: oldpeper <96619050+oldpeper@users.noreply.github.com> Date: Tue, 22 Oct 2024 11:31:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E8=BD=A6=E5=89=8D=E6=89=80=E6=9C=89?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- d2/Assets/Demigiant.meta | 8 + .../DOTween/Editor/DOTweenUpgradeManager.XML | 14 - .../DOTween/Editor/DOTweenUpgradeManager.dll | Bin 10752 -> 0 bytes .../Editor/DOTweenUpgradeManager.dll.meta | 21 - d2/Assets/Resources.meta | 8 + d2/Assets/Resources/DOTweenSettings.asset | 48 + .../Resources/DOTweenSettings.asset.meta | 8 + d2/Assets/Scenes/SampleScene.unity | 9959 ++++++++++++++++- d2/Assets/Script/GameManager.cs | 42 +- d2/Assets/Script/Map/MapManager.cs | 48 +- d2/Assets/Script/ObjectEndity/Grid.cs | 106 +- .../Script/ObjectEndity/PassengerObject.cs | 35 +- d2/Assets/Script/ObjectEndity/WaitSlot.cs | 36 + .../Script/ObjectEndity/WaitSlot.cs.meta | 11 + d2/Assets/Script/Tool.meta | 8 + d2/Assets/prefab.meta | 8 + d2/Assets/prefab/Image.prefab | 144 + .../Image.prefab.meta} | 4 +- d2/Assets/prefab/passenger.prefab | 92 + d2/Assets/prefab/passenger.prefab.meta | 7 + d2/UserSettings/EditorUserSettings.asset | 9 + 21 files changed, 10513 insertions(+), 103 deletions(-) create mode 100644 d2/Assets/Demigiant.meta delete mode 100644 d2/Assets/Demigiant/DOTween/Editor/DOTweenUpgradeManager.XML delete mode 100644 d2/Assets/Demigiant/DOTween/Editor/DOTweenUpgradeManager.dll delete mode 100644 d2/Assets/Demigiant/DOTween/Editor/DOTweenUpgradeManager.dll.meta create mode 100644 d2/Assets/Resources.meta create mode 100644 d2/Assets/Resources/DOTweenSettings.asset create mode 100644 d2/Assets/Resources/DOTweenSettings.asset.meta create mode 100644 d2/Assets/Script/ObjectEndity/WaitSlot.cs create mode 100644 d2/Assets/Script/ObjectEndity/WaitSlot.cs.meta create mode 100644 d2/Assets/Script/Tool.meta create mode 100644 d2/Assets/prefab.meta create mode 100644 d2/Assets/prefab/Image.prefab rename d2/Assets/{Demigiant/DOTween/Editor/DOTweenUpgradeManager.XML.meta => prefab/Image.prefab.meta} (62%) create mode 100644 d2/Assets/prefab/passenger.prefab create mode 100644 d2/Assets/prefab/passenger.prefab.meta diff --git a/d2/Assets/Demigiant.meta b/d2/Assets/Demigiant.meta new file mode 100644 index 00000000..5d4f2be1 --- /dev/null +++ b/d2/Assets/Demigiant.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0601edf0b587e8b4eae85ba535c269cb +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/d2/Assets/Demigiant/DOTween/Editor/DOTweenUpgradeManager.XML b/d2/Assets/Demigiant/DOTween/Editor/DOTweenUpgradeManager.XML deleted file mode 100644 index 02c3c95e..00000000 --- a/d2/Assets/Demigiant/DOTween/Editor/DOTweenUpgradeManager.XML +++ /dev/null @@ -1,14 +0,0 @@ - - - - DOTweenUpgradeManager - - - - - This class and its whole library are deleted the first time DOTween's setup is run after an upgrade (or after a new install). - NOTE: DidReloadScripts doesn't work on first install so it's useless, InitializeOnLoad is the only way - - - - diff --git a/d2/Assets/Demigiant/DOTween/Editor/DOTweenUpgradeManager.dll b/d2/Assets/Demigiant/DOTween/Editor/DOTweenUpgradeManager.dll deleted file mode 100644 index 10511cc237b624be10a162f9c2b8ee87f7e21518..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10752 zcmeHNdvF`adH?Qk07#gI2}+h^S&tJX+7L}5d?^+kMIuO$5@S-N2vV|Y%Jcy^f@dA> z;JX7UsuKlvMoBugQoBtvW95%L`beC#ar&6C)wq*~(`lPDG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Bjm4Mlq=QVM4^$ zzeTFv=hQs=R(NuLaa`+pZH(^5*d7*hlCYL9J_^WuzBAo;8`_u?Ro~pIe@;Arh0Om? T(); + passenger.transform.position=grid.transform.position; + passenger.passColor = (ColorEnum)colorIndex; + grid.passenger = passenger; + grid.buttonAction = grid.PlaySystemEvent; + } } // Update is called once per frame @@ -15,5 +37,23 @@ namespace Script { } + + public void MoveWaitEvent(Grid grid) + { + if (MapManager.ins.WaitSlot.MoveOpen(out var moveGrid)) + { + if (grid.NorthOpen()) + { + moveGrid.passenger = grid.passenger; + grid.passenger = null; + moveGrid.PassengerAni(); + } + } + } + + public void MoveCarEvent() + { + + } } } diff --git a/d2/Assets/Script/Map/MapManager.cs b/d2/Assets/Script/Map/MapManager.cs index 5be9f3c4..1d848b82 100644 --- a/d2/Assets/Script/Map/MapManager.cs +++ b/d2/Assets/Script/Map/MapManager.cs @@ -6,6 +6,7 @@ using UnityEngine.Serialization; namespace Script.Map { + //地图总控制脚本 public class MapManager : MonoBehaviour { public static MapManager ins; @@ -13,29 +14,60 @@ namespace Script.Map [SerializeField] private List carObjects; [SerializeField] private GameObject templateGrid; + public WaitSlot WaitSlot => _waitSlot; + [SerializeField] private WaitSlot _waitSlot; public Grid[,] MapGrid ; + [SerializeField] private List MapGrids; [SerializeField] private Transform gridParent; - public int x { get; private set; } - public int y { get; private set; } + public int x => mX; + [SerializeField] private int mX; + public int y => mY; + [SerializeField] private int mY; public bool InitReady { get; private set; } = false; private void Awake() { ins = this; + } + /// + /// 初始化游戏数据 + /// + public void InitPlayData() + { + MapGrid = new Grid[x, y]; + foreach (var grid in MapGrids) + { + MapGrid[grid.X, grid.Y] = grid; + } + } + + + [InspectorButton("初始化地图")] + public void InitMap() + { + if (ins==null) + { + ins = this; + } Init(10, 10); } - + + /// + /// 地图生成调用 + /// + /// + /// public void Init(int _x,int _y) { InitReady = false; - x = _x; - y = _y; + mX = _x; + mY = _y; MapGrid = new Grid[x, y]; - StartCoroutine(InitGrid()); + InitGrid(); } - private IEnumerator InitGrid(Action action=null) + private void InitGrid(Action action=null) { for (var i = 0; i < x; i++) { @@ -45,7 +77,7 @@ namespace Script.Map MapGrid[i,j].SetData(i,j); MapGrid[i,j].SetBool(true); MapGrid[i, j].SetRestPostion(); - yield return null; + MapGrids.Add(MapGrid[i,j]); } } diff --git a/d2/Assets/Script/ObjectEndity/Grid.cs b/d2/Assets/Script/ObjectEndity/Grid.cs index 8547cfcf..920d5680 100644 --- a/d2/Assets/Script/ObjectEndity/Grid.cs +++ b/d2/Assets/Script/ObjectEndity/Grid.cs @@ -1,76 +1,136 @@ using System; using System.Collections; using System.Collections.Generic; +using DG.Tweening; +using Script; using Script.Map; using UnityEngine; +using UnityEngine.UI; +//格子脚本,用于获取相邻信息 public class Grid : MonoBehaviour { - public int x { get; private set; } - public int y { get; private set; } - public bool Open { get; private set; } - public Grid East { get; private set; } - public Grid South { get; private set; } - public Grid West { get; private set; } - public Grid North { get; private set; } + public int X => gx; + [SerializeField] private int gx; + public int Y => gy; + [SerializeField] private int gy; + public bool Open => gOpen; + [SerializeField] private bool gOpen=true; + public Grid East => gEast; + [SerializeField] private Grid gEast; + public Grid South => gSouth; + [SerializeField] private Grid gSouth; + public Grid West => gWest; + [SerializeField] private Grid gWest; + public Grid North => gNorth; + [SerializeField] private Grid gNorth; + public bool aniPlay => gAniPlay; + [SerializeField] private bool gAniPlay=false; + + public PassengerObject passenger; + + public Action action = null; + public Action buttonAction=null; + + + private void Awake() + { + GetComponent