最新制作后提交
This commit is contained in:
parent
f6476412ff
commit
3eeafd6e6e
Binary file not shown.
@ -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"}]
|
||||||
|
|||||||
@ -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"}]
|
||||||
|
|||||||
@ -7,6 +7,185 @@ namespace DongWuYiXue.DaoNiaoShu
|
|||||||
{
|
{
|
||||||
public class PointLineManager : MonoBehaviour
|
public class PointLineManager : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
#region 修改逻辑前脚本 暂未删除
|
||||||
|
//List<Point> points = new();
|
||||||
|
//List<Line> lines = new();
|
||||||
|
//public Line m_LinePfb;
|
||||||
|
//public RectTransform m_LineCon;
|
||||||
|
//public Color color;
|
||||||
|
//private List<Point> selectPoints = new();
|
||||||
|
//private void Start()
|
||||||
|
//{
|
||||||
|
// points = GetComponentsInChildren<Point>().ToList();
|
||||||
|
// for (int i = 0; i < points.Count; i++)
|
||||||
|
// {
|
||||||
|
// points[i].Init(this);
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
///// <summary>
|
||||||
|
///// 画线
|
||||||
|
///// </summary>
|
||||||
|
//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;
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
///// <summary>
|
||||||
|
///// 两点之间是否已经有连线
|
||||||
|
///// </summary>
|
||||||
|
//public bool TwoPointsAlreadyConnected(List<Point> p)
|
||||||
|
//{
|
||||||
|
// for (int i = 0; i < lines.Count; i++)
|
||||||
|
// {
|
||||||
|
// if (lines[i].points.SequenceEqual(p))
|
||||||
|
// {
|
||||||
|
// return true;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// return false;
|
||||||
|
//}
|
||||||
|
///// <summary>
|
||||||
|
///// 一点是否已经连线
|
||||||
|
///// </summary>
|
||||||
|
//public bool OnePointsAlreadyConnected(Point p)
|
||||||
|
//{
|
||||||
|
// for (int i = 0; i < lines.Count; i++)
|
||||||
|
// {
|
||||||
|
// if (lines[i].points.Contains(p))
|
||||||
|
// {
|
||||||
|
// return true;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// return false;
|
||||||
|
//}
|
||||||
|
///// <summary>
|
||||||
|
///// 取消所有点击
|
||||||
|
///// </summary>
|
||||||
|
//public void UnselectPoints()
|
||||||
|
//{
|
||||||
|
// for (int i = 0; i < selectPoints.Count; i++)
|
||||||
|
// {
|
||||||
|
// selectPoints[i].UnSelect();
|
||||||
|
// }
|
||||||
|
// selectPoints.Clear();
|
||||||
|
//}
|
||||||
|
///// <summary>
|
||||||
|
///// 创建⼀条两点之间的线
|
||||||
|
///// </summary>
|
||||||
|
//private void CreateLine(Point p1, Point p2)
|
||||||
|
//{
|
||||||
|
// //实例化需要显⽰的线段图⽚pfb
|
||||||
|
// Line line = DrawLineTool.DrawLine(p1.transform.position, p2.transform.position, color, m_LineCon).GetComponent<Line>();
|
||||||
|
// line.AddPoint(p1);
|
||||||
|
// line.AddPoint(p2);
|
||||||
|
// line.gameObject.SetActive(true);
|
||||||
|
// lines.Add(line);
|
||||||
|
//}
|
||||||
|
///// <summary>
|
||||||
|
///// 清除线
|
||||||
|
///// </summary>
|
||||||
|
//public void ClearLine()
|
||||||
|
//{
|
||||||
|
// for (int i = 0; i < lines.Count; i++)
|
||||||
|
// {
|
||||||
|
// Destroy(lines[i].gameObject);
|
||||||
|
// }
|
||||||
|
// lines.Clear();
|
||||||
|
//}
|
||||||
|
///// <summary>
|
||||||
|
///// 判断对错
|
||||||
|
///// </summary>
|
||||||
|
//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;
|
||||||
|
//}
|
||||||
|
///// <summary>
|
||||||
|
///// 禁用按钮
|
||||||
|
///// </summary>
|
||||||
|
//public void ButtonForbidden()
|
||||||
|
//{
|
||||||
|
// for (int i = 0; i < points.Count; i++)
|
||||||
|
// {
|
||||||
|
// points[i].btn.interactable = false;
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
///// <summary>
|
||||||
|
///// 启用按钮
|
||||||
|
///// </summary>
|
||||||
|
//public void ButtonOnEnable()
|
||||||
|
//{
|
||||||
|
// for (int i = 0; i < points.Count; i++)
|
||||||
|
// {
|
||||||
|
// points[i].btn.interactable = true;
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
#endregion
|
||||||
|
|
||||||
List<Point> points = new();
|
List<Point> points = new();
|
||||||
List<Line> lines = new();
|
List<Line> lines = new();
|
||||||
public Line m_LinePfb;
|
public Line m_LinePfb;
|
||||||
@ -141,6 +320,10 @@ namespace DongWuYiXue.DaoNiaoShu
|
|||||||
public bool JudgeLine()
|
public bool JudgeLine()
|
||||||
{
|
{
|
||||||
bool trueOrFalse = true;
|
bool trueOrFalse = true;
|
||||||
|
if (lines.Count == 0)
|
||||||
|
{
|
||||||
|
trueOrFalse = false;
|
||||||
|
}
|
||||||
for (int i = 0; i < lines.Count; i++)
|
for (int i = 0; i < lines.Count; i++)
|
||||||
{
|
{
|
||||||
if (lines[i].Judge())
|
if (lines[i].Judge())
|
||||||
@ -153,14 +336,6 @@ namespace DongWuYiXue.DaoNiaoShu
|
|||||||
trueOrFalse = false;
|
trueOrFalse = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (int i = 0; i < points.Count; i++)
|
|
||||||
{
|
|
||||||
Point p = points[i];
|
|
||||||
if (p.answers != null && !OnePointsAlreadyConnected(p))
|
|
||||||
{
|
|
||||||
trueOrFalse = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return trueOrFalse;
|
return trueOrFalse;
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -183,5 +358,6 @@ namespace DongWuYiXue.DaoNiaoShu
|
|||||||
points[i].btn.interactable = true;
|
points[i].btn.interactable = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user