diff --git a/Assets/Resources/Main/ExcelData/Excel/MainData.xlsx b/Assets/Resources/Main/ExcelData/Excel/MainData.xlsx index 8a9877a..876b2df 100644 Binary files a/Assets/Resources/Main/ExcelData/Excel/MainData.xlsx and b/Assets/Resources/Main/ExcelData/Excel/MainData.xlsx differ diff --git a/Assets/Resources/Main/ExcelData/ExcelToJson/MainData.json b/Assets/Resources/Main/ExcelData/ExcelToJson/MainData.json index 1ce9ae7..9f9b0fe 100644 --- a/Assets/Resources/Main/ExcelData/ExcelToJson/MainData.json +++ b/Assets/Resources/Main/ExcelData/ExcelToJson/MainData.json @@ -1 +1 @@ -[{"id":1,"name":"静脉输液(留置针)虚拟仿真训练系统","texture":"","scene":"Main","nameSpace":"DongWuYiXue.Main","fsmManager":"","fsmClassPath":"","folder":"Main"},{"id":2,"name":"静脉留置针","texture":"","scene":"daoNiaoShu","nameSpace":"DongWuYiXue.DaoNiaoShu","fsmManager":"FSMManager","fsmClassPath":"_Scripts/Application/daoNiaoShu/","folder":"daoNiaoShu"}] +[{"id":1,"name":"大型公犬导尿术虚实结合训练系统","texture":"","scene":"Main","nameSpace":"DongWuYiXue.Main","fsmManager":"","fsmClassPath":"","folder":"Main"},{"id":2,"name":"大型公犬导尿术虚实结合训练系统","texture":"","scene":"daoNiaoShu","nameSpace":"DongWuYiXue.DaoNiaoShu","fsmManager":"FSMManager","fsmClassPath":"_Scripts/Application/daoNiaoShu/","folder":"daoNiaoShu"}] diff --git a/Assets/StreamingAssets/Main/ExcelData/ExcelToJson/MainData.json b/Assets/StreamingAssets/Main/ExcelData/ExcelToJson/MainData.json index 1ce9ae7..9f9b0fe 100644 --- a/Assets/StreamingAssets/Main/ExcelData/ExcelToJson/MainData.json +++ b/Assets/StreamingAssets/Main/ExcelData/ExcelToJson/MainData.json @@ -1 +1 @@ -[{"id":1,"name":"静脉输液(留置针)虚拟仿真训练系统","texture":"","scene":"Main","nameSpace":"DongWuYiXue.Main","fsmManager":"","fsmClassPath":"","folder":"Main"},{"id":2,"name":"静脉留置针","texture":"","scene":"daoNiaoShu","nameSpace":"DongWuYiXue.DaoNiaoShu","fsmManager":"FSMManager","fsmClassPath":"_Scripts/Application/daoNiaoShu/","folder":"daoNiaoShu"}] +[{"id":1,"name":"大型公犬导尿术虚实结合训练系统","texture":"","scene":"Main","nameSpace":"DongWuYiXue.Main","fsmManager":"","fsmClassPath":"","folder":"Main"},{"id":2,"name":"大型公犬导尿术虚实结合训练系统","texture":"","scene":"daoNiaoShu","nameSpace":"DongWuYiXue.DaoNiaoShu","fsmManager":"FSMManager","fsmClassPath":"_Scripts/Application/daoNiaoShu/","folder":"daoNiaoShu"}] diff --git a/Assets/_Scripts/Application/daoNiaoShu/Other/连线题/PointLineManager.cs b/Assets/_Scripts/Application/daoNiaoShu/Other/连线题/PointLineManager.cs index badbf21..1fcddbb 100644 --- a/Assets/_Scripts/Application/daoNiaoShu/Other/连线题/PointLineManager.cs +++ b/Assets/_Scripts/Application/daoNiaoShu/Other/连线题/PointLineManager.cs @@ -7,6 +7,185 @@ namespace DongWuYiXue.DaoNiaoShu { public class PointLineManager : MonoBehaviour { + #region 修改逻辑前脚本 暂未删除 + //List points = new(); + //List lines = new(); + //public Line m_LinePfb; + //public RectTransform m_LineCon; + //public Color color; + //private List selectPoints = new(); + //private void Start() + //{ + // points = GetComponentsInChildren().ToList(); + // for (int i = 0; i < points.Count; i++) + // { + // points[i].Init(this); + // } + //} + ///// + ///// 画线 + ///// + //public void DrawLine(Point p) + //{ + // selectPoints.Add(p); + // if (selectPoints.Count == 2 && selectPoints[0].group != selectPoints[1].group)//凑齐两点,且两点不同区域 + // { + // if (TwoPointsAlreadyConnected(selectPoints))//两点之间是否已经连线 + // { + // UnselectPoints(); + // return; + // } + // if (OnePointsAlreadyConnected(selectPoints[0]) && OnePointsAlreadyConnected(selectPoints[1]))//两点是否都与第三点有连线 + // { + // if (selectPoints[0].multip && selectPoints[1].multip) + // { + // CreateLine(selectPoints[0], selectPoints[1]); + // } + // UnselectPoints(); + // return; + // } + // if (OnePointsAlreadyConnected(selectPoints[0]))//点1是否都与第三点有连线 + // { + // if (selectPoints[0].multip) + // { + // CreateLine(selectPoints[0], selectPoints[1]); + // } + // UnselectPoints(); + // return; + // } + // if (OnePointsAlreadyConnected(selectPoints[1]))//点2是否都与第三点有连线 + // { + // if (selectPoints[1].multip) + // { + // CreateLine(selectPoints[0], selectPoints[1]); + // } + // UnselectPoints(); + // return; + // } + // CreateLine(selectPoints[0], selectPoints[1]); + // UnselectPoints(); + // return; + // } + // if (selectPoints.Count == 2 && selectPoints[0].group == selectPoints[1].group)//凑齐两点,且两点同一区域 + // { + // UnselectPoints(); + // p.Select(); + // selectPoints.Add(p); + // return; + // } + //} + ///// + ///// 两点之间是否已经有连线 + ///// + //public bool TwoPointsAlreadyConnected(List p) + //{ + // for (int i = 0; i < lines.Count; i++) + // { + // if (lines[i].points.SequenceEqual(p)) + // { + // return true; + // } + // } + // return false; + //} + ///// + ///// 一点是否已经连线 + ///// + //public bool OnePointsAlreadyConnected(Point p) + //{ + // for (int i = 0; i < lines.Count; i++) + // { + // if (lines[i].points.Contains(p)) + // { + // return true; + // } + // } + // return false; + //} + ///// + ///// 取消所有点击 + ///// + //public void UnselectPoints() + //{ + // for (int i = 0; i < selectPoints.Count; i++) + // { + // selectPoints[i].UnSelect(); + // } + // selectPoints.Clear(); + //} + ///// + ///// 创建⼀条两点之间的线 + ///// + //private void CreateLine(Point p1, Point p2) + //{ + // //实例化需要显⽰的线段图⽚pfb + // Line line = DrawLineTool.DrawLine(p1.transform.position, p2.transform.position, color, m_LineCon).GetComponent(); + // line.AddPoint(p1); + // line.AddPoint(p2); + // line.gameObject.SetActive(true); + // lines.Add(line); + //} + ///// + ///// 清除线 + ///// + //public void ClearLine() + //{ + // for (int i = 0; i < lines.Count; i++) + // { + // Destroy(lines[i].gameObject); + // } + // lines.Clear(); + //} + ///// + ///// 判断对错 + ///// + //public bool JudgeLine() + //{ + // bool trueOrFalse = true; + // for (int i = 0; i < lines.Count; i++) + // { + // if (lines[i].Judge()) + // { + // lines[i].Correct(); + // } + // else + // { + // lines[i].Error(); + // trueOrFalse = false; + // } + // } + // for (int i = 0; i < points.Count; i++) + // { + // Point p = points[i]; + // if (p.answers != null && !OnePointsAlreadyConnected(p)) + // { + // trueOrFalse = false; + // } + // } + // return trueOrFalse; + //} + ///// + ///// 禁用按钮 + ///// + //public void ButtonForbidden() + //{ + // for (int i = 0; i < points.Count; i++) + // { + // points[i].btn.interactable = false; + // } + //} + ///// + ///// 启用按钮 + ///// + //public void ButtonOnEnable() + //{ + // for (int i = 0; i < points.Count; i++) + // { + // points[i].btn.interactable = true; + // } + //} + #endregion + List points = new(); List lines = new(); public Line m_LinePfb; @@ -141,6 +320,10 @@ namespace DongWuYiXue.DaoNiaoShu public bool JudgeLine() { bool trueOrFalse = true; + if (lines.Count == 0) + { + trueOrFalse = false; + } for (int i = 0; i < lines.Count; i++) { if (lines[i].Judge()) @@ -153,14 +336,6 @@ namespace DongWuYiXue.DaoNiaoShu trueOrFalse = false; } } - for (int i = 0; i < points.Count; i++) - { - Point p = points[i]; - if (p.answers != null && !OnePointsAlreadyConnected(p)) - { - trueOrFalse = false; - } - } return trueOrFalse; } /// @@ -183,5 +358,6 @@ namespace DongWuYiXue.DaoNiaoShu points[i].btn.interactable = true; } } + } } \ No newline at end of file