using System.Collections; using System.Collections.Generic; using UnityEngine; public class TetsFx : MonoBehaviour { public MyWFX MyWfx; Vector3 lastPos; // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { if (Input.GetKeyDown(KeyCode.A)) { Vector3 d = transform.position - lastPos; if (d.sqrMagnitude > 1) { int x = (int)transform.position.x/10; int y = (int)transform.position.z/10; WFXMapInfo[,] newWfxMap = new WFXMapInfo[6, 10]; List huiTuiMap = new List(); // WFXMapInfo[,] WfxMapInfos = MyWfx.WfxMapInfos; for (int i = 0; i < 6; i++) { for (int j = 0; j < 10; j++) { int newX = x + i - 2; int newY = y + j - 3; int n = newX * 10000 + newY; WFXMapInfo newName = null; WFXMapInfo wfxMapInfo = new WFXMapInfo(); if (MyWfx.currAllMapName.TryGetValue(n, out newName)) { newWfxMap[i, j] = newName; newName.x = i; newName.y = j; huiTuiMap.Add(newName); } else { wfxMapInfo.x = i; wfxMapInfo.y = j; wfxMapInfo.px = newX; wfxMapInfo.py = newY; newWfxMap[i, j] = wfxMapInfo; } // WfxMapInfos[n, y - MyWfx.lasetStartY]; } } MyWfx.NewShengCheng(newWfxMap, huiTuiMap,6,10); } } } }