修改连线点击过快无法连线问题
This commit is contained in:
parent
b6364f22dc
commit
db527c65a3
|
|
@ -137,7 +137,7 @@ GameObject:
|
|||
- component: {fileID: 8252842663213540200}
|
||||
- component: {fileID: 6672875250636715790}
|
||||
m_Layer: 5
|
||||
m_Name: 1-4-2
|
||||
m_Name: 5-4-2
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
|
|
@ -1873,7 +1873,7 @@ GameObject:
|
|||
- component: {fileID: 2737212479208173497}
|
||||
- component: {fileID: 6655939487465875950}
|
||||
m_Layer: 5
|
||||
m_Name: 1-3-1
|
||||
m_Name: 5-3-1
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
|
|
@ -2230,7 +2230,7 @@ GameObject:
|
|||
- component: {fileID: 856056912071669166}
|
||||
- component: {fileID: 657600881843389557}
|
||||
m_Layer: 5
|
||||
m_Name: 1-3-2
|
||||
m_Name: 5-3-2
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
|
|
@ -3043,7 +3043,7 @@ GameObject:
|
|||
- component: {fileID: 5665983946915621847}
|
||||
- component: {fileID: 9149981731159942754}
|
||||
m_Layer: 5
|
||||
m_Name: 1-5-1
|
||||
m_Name: 5-5-1
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
|
|
@ -3332,7 +3332,7 @@ GameObject:
|
|||
- component: {fileID: 4431048995298863157}
|
||||
- component: {fileID: 6296556775557808310}
|
||||
m_Layer: 5
|
||||
m_Name: 1-5-2
|
||||
m_Name: 5-5-2
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
|
|
@ -4793,7 +4793,7 @@ GameObject:
|
|||
- component: {fileID: 349545727647928612}
|
||||
- component: {fileID: 8811260483391861293}
|
||||
m_Layer: 5
|
||||
m_Name: 1-2-2
|
||||
m_Name: 5-2-2
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
|
|
@ -5213,7 +5213,7 @@ GameObject:
|
|||
- component: {fileID: 7105609011367627543}
|
||||
- component: {fileID: 5678060293557198011}
|
||||
m_Layer: 5
|
||||
m_Name: 1-1-2
|
||||
m_Name: 5-1-2
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
|
|
@ -5801,7 +5801,7 @@ GameObject:
|
|||
- component: {fileID: 7352063738167320145}
|
||||
- component: {fileID: 7027064101671987027}
|
||||
m_Layer: 5
|
||||
m_Name: 1-4-1
|
||||
m_Name: 5-4-1
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
|
|
@ -7324,7 +7324,7 @@ GameObject:
|
|||
- component: {fileID: 6886174278147879563}
|
||||
- component: {fileID: 8089084432970626067}
|
||||
m_Layer: 5
|
||||
m_Name: 1-2-1
|
||||
m_Name: 5-2-1
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
|
|
@ -7613,7 +7613,7 @@ GameObject:
|
|||
- component: {fileID: 5413668968045056710}
|
||||
- component: {fileID: 8259052942713030222}
|
||||
m_Layer: 5
|
||||
m_Name: 1-1-1
|
||||
m_Name: 5-1-1
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
|
|
|
|||
|
|
@ -398,6 +398,6 @@ MonoBehaviour:
|
|||
m_Script: {fileID: 11500000, guid: 9d3e9e611302a94449b889f55f429449, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
bg: {fileID: 0}
|
||||
text_Content: {fileID: 0}
|
||||
text_Title: {fileID: 0}
|
||||
bg: {fileID: 7002883869800419636}
|
||||
text_Content: {fileID: 8594377904747112240}
|
||||
text_Title: {fileID: 5145926162580700466}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -57,14 +57,28 @@ public enum InterfaceType
|
|||
}
|
||||
public class LineConnect : MonoBehaviour
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 唯一ID
|
||||
/// </summary>
|
||||
public int id;
|
||||
public InterfaceType interfaceType = InterfaceType.None;
|
||||
/// <summary>
|
||||
/// 是否是不需要连接的接口
|
||||
/// </summary>
|
||||
public bool IsNotLine = false;
|
||||
/// <summary>
|
||||
/// 是否已经点击了该接口
|
||||
/// </summary>
|
||||
public bool isClick = false;
|
||||
private void OnMouseDown()
|
||||
{
|
||||
if (!isClick && LineManager.instance.Addtime >= 2)
|
||||
{
|
||||
isClick = true;
|
||||
Debug.Log(transform.name);
|
||||
LineManager.instance.ClickPoint(transform);
|
||||
LineManager.instance.Addtime = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,8 +60,9 @@ public class LineManager : SerializedMonoBehaviour
|
|||
/// </summary>
|
||||
public string LineName;
|
||||
|
||||
public string line1;
|
||||
public string line2;
|
||||
public float Addtime = 0;
|
||||
|
||||
public string Laboratorycourse = "K=1";
|
||||
private void Awake()
|
||||
{
|
||||
instance = this;
|
||||
|
|
@ -125,14 +126,25 @@ public class LineManager : SerializedMonoBehaviour
|
|||
switch (ExperimentNumber)
|
||||
{
|
||||
case 511:
|
||||
Laboratorycourse = "K=1";
|
||||
UI_TopTipPanel.instance.Init("提示:" + "当前实验是" + Laboratorycourse, ",请点击" + LineName + "。");
|
||||
ComputerPanel.sprite = Experimentalresults[0];
|
||||
break;
|
||||
case 512:
|
||||
Laboratorycourse = "K=2";
|
||||
UI_TopTipPanel.instance.Init("提示:" + "当前实验是" + Laboratorycourse, ",请点击" + LineName + "。");
|
||||
ComputerPanel.sprite = Experimentalresults[1];
|
||||
break;
|
||||
case 521:
|
||||
Laboratorycourse = "T=1S";
|
||||
UI_TopTipPanel.instance.Init("提示:" + "当前实验是" + Laboratorycourse, ",请点击" + LineName + "。");
|
||||
ComputerPanel.sprite = Experimentalresults[2];
|
||||
break;
|
||||
case 522:
|
||||
Laboratorycourse = "T=0.1S";
|
||||
UI_TopTipPanel.instance.Init("提示:" + "当前实验是" + Laboratorycourse, ",请点击" + LineName + "。");
|
||||
ComputerPanel.sprite = Experimentalresults[3];
|
||||
break;
|
||||
}
|
||||
}
|
||||
bool isshow;
|
||||
|
|
@ -158,38 +170,7 @@ public class LineManager : SerializedMonoBehaviour
|
|||
Highlights = Highlights_Backup.ToList();
|
||||
Bootstrap.Instance.uiManager.HidePanel<UI_TopTipPanel>();
|
||||
}
|
||||
//if (LineShowModel.Instance.currentState == DrawingState.Idle)
|
||||
//{
|
||||
// if (Input.GetKeyDown(KeyCode.Alpha1))
|
||||
// {
|
||||
// //先重置高亮,再重置模型,否则初始化无法正确显示高亮
|
||||
// Highlights = highlightsdic[511].ToList();
|
||||
// Highlights_Backup = highlightsdic[511].ToList();
|
||||
// Initialization(511);
|
||||
// Models.ForEach((x) => { x.SetActive(false); });
|
||||
// Models = Modeldic[511].ToList();
|
||||
// }
|
||||
// if (Input.GetKeyDown(KeyCode.Alpha2))
|
||||
// {
|
||||
|
||||
// //先重置高亮,再重置模型,否则初始化无法正确显示高亮
|
||||
// Highlights = highlightsdic[512].ToList();
|
||||
// Highlights_Backup = highlightsdic[512].ToList();
|
||||
// Initialization(512);
|
||||
// Models.ForEach((x) => { x.SetActive(false); });
|
||||
// Models = Modeldic[512].ToList();
|
||||
// }
|
||||
// if (Input.GetKeyDown(KeyCode.Alpha3))
|
||||
// {
|
||||
|
||||
// //先重置高亮,再重置模型,否则初始化无法正确显示高亮
|
||||
// Highlights = highlightsdic[521].ToList();
|
||||
// Highlights_Backup = highlightsdic[521].ToList();
|
||||
// Initialization(521);
|
||||
// Models.ForEach((x) => { x.SetActive(false); });
|
||||
// Models = Modeldic[521].ToList();
|
||||
// }
|
||||
//}
|
||||
Addtime += 0.05f;
|
||||
}
|
||||
/// <summary>
|
||||
/// Çл»¿Î³Ì
|
||||
|
|
@ -212,7 +193,6 @@ public class LineManager : SerializedMonoBehaviour
|
|||
/// <param name="point"></param>
|
||||
public void ClickPoint(Transform point)
|
||||
{
|
||||
|
||||
if (Highlights.Count != 20 && Highlights.Count % 2 != 0)
|
||||
{
|
||||
for (int i = 0; i < Highlights.Count; i++)
|
||||
|
|
@ -222,6 +202,7 @@ public class LineManager : SerializedMonoBehaviour
|
|||
if (!Highlights_Backup[j].name.Equals(Highlights[i].name))
|
||||
{
|
||||
Highlights_Backup[j].GetComponent<BoxCollider>().enabled = false;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -371,6 +352,8 @@ public class LineManager : SerializedMonoBehaviour
|
|||
|
||||
}
|
||||
LineShowModel.Instance.DeleteWiresByCollider(line1.gameObject);
|
||||
line1.GetComponent<LineConnect>().isClick = false;
|
||||
line2.GetComponent<LineConnect>().isClick = false;
|
||||
|
||||
return true;
|
||||
//}
|
||||
|
|
@ -399,7 +382,6 @@ public class LineManager : SerializedMonoBehaviour
|
|||
{
|
||||
hightindext = i;
|
||||
Highlights[i].highlighted = false;
|
||||
|
||||
Highlights.Remove(Highlights[i]);
|
||||
break;
|
||||
}
|
||||
|
|
@ -411,11 +393,11 @@ public class LineManager : SerializedMonoBehaviour
|
|||
Highlights[hightindext].GetComponent<BoxCollider>().enabled = true;
|
||||
}
|
||||
LightPanel.highlighted = false;
|
||||
Devices.highlighted = false;
|
||||
|
||||
Bootstrap.Instance.uiManager.ShowPanel<UI_TopTipPanel>(this, E_UI_Layer.Top,
|
||||
(panel) =>
|
||||
{
|
||||
panel.Init("提示:", "请点击" + LineName + "。");
|
||||
panel.Init("提示:" + "当前实验是" + Laboratorycourse, "请点击" + LineName + "。");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -303,7 +303,7 @@ public class LineShowModel : MonoBehaviour
|
|||
if (endCollider == startColliderObject)
|
||||
{
|
||||
Debug.LogWarning("不能连接到自身!");
|
||||
CancelDrawing();
|
||||
//CancelDrawing();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,13 +33,13 @@ public class UI_ExperimentChooesPanel : BasePanel
|
|||
LineManager.instance.ChangeClass(521);
|
||||
break;
|
||||
case "5-2-2":
|
||||
|
||||
LineManager.instance.ChangeClass(522);
|
||||
break;
|
||||
case "1-3-1":
|
||||
|
||||
case "5-3-1":
|
||||
LineManager.instance.ChangeClass(531);
|
||||
break;
|
||||
case "1-3-2":
|
||||
|
||||
case "5-3-2":
|
||||
LineManager.instance.ChangeClass(532);
|
||||
break;
|
||||
case "1-4-1":
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,11 @@ public class UI_TopTipPanel : BasePanel
|
|||
public Image bg;
|
||||
public TextMeshProUGUI text_Content;
|
||||
public TextMeshProUGUI text_Title;
|
||||
public static UI_TopTipPanel instance;
|
||||
private void Start()
|
||||
{
|
||||
instance = this;
|
||||
}
|
||||
public void Init(string title, string content)
|
||||
{
|
||||
text_Title = GetControl<TextMeshProUGUI>("Text_Title");
|
||||
|
|
@ -28,7 +33,7 @@ public class UI_TopTipPanel : BasePanel
|
|||
StopCoroutine(HideAsync(5));
|
||||
StartCoroutine(HideAsync(5));
|
||||
}
|
||||
private IEnumerator HideAsync (float disappear )
|
||||
private IEnumerator HideAsync(float disappear)
|
||||
{
|
||||
yield return new WaitForSeconds(disappear);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue