PMN
This commit is contained in:
parent
8cbc807830
commit
65d0e03887
|
@ -93,8 +93,8 @@ MonoBehaviour:
|
|||
m_faceColor:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontSize: 21.5
|
||||
m_fontSizeBase: 21.5
|
||||
m_fontSize: 15
|
||||
m_fontSizeBase: 15
|
||||
m_fontWeight: 400
|
||||
m_enableAutoSizing: 0
|
||||
m_fontSizeMin: 18
|
||||
|
@ -147,6 +147,7 @@ GameObject:
|
|||
- component: {fileID: 1223891732822202744}
|
||||
- component: {fileID: 6888887207691414927}
|
||||
- component: {fileID: 5852540941965105660}
|
||||
- component: {fileID: 2402839505161102747}
|
||||
m_Layer: 0
|
||||
m_Name: "\u641C\u7D22\u6846\u9009\u9879"
|
||||
m_TagString: Untagged
|
||||
|
@ -173,7 +174,7 @@ RectTransform:
|
|||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 328.6461, y: 35}
|
||||
m_SizeDelta: {x: 190, y: 35}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &1223891732822202744
|
||||
CanvasRenderer:
|
||||
|
@ -203,7 +204,7 @@ MonoBehaviour:
|
|||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 21300000, guid: 52b3ecd3594e86642bc08d6b8aca666b, type: 3}
|
||||
m_Sprite: {fileID: 21300000, guid: c3519ce271255094b9c09d64e9cbc0be, type: 3}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
|
@ -257,3 +258,18 @@ MonoBehaviour:
|
|||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
--- !u!114 &2402839505161102747
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5570102123366740405}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: e4eef7cfa99f99249bc011633cb57ede, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
needDragGoBtn: {fileID: 0}
|
||||
text: {fileID: 2140947268708861572}
|
||||
SelectBtn: {fileID: 5852540941965105660}
|
||||
|
|
|
@ -174,6 +174,8 @@ MonoBehaviour:
|
|||
volume: 2
|
||||
isExit: 0
|
||||
isClicked: 0
|
||||
isTarget: 0
|
||||
isplace: 0
|
||||
canPut: 0
|
||||
--- !u!114 &6975863905056445117
|
||||
MonoBehaviour:
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1 +1 @@
|
|||
http://sgjpmb.natappfree.cc/
|
||||
http://a9mx5g.natappfree.cc/
|
File diff suppressed because one or more lines are too long
|
@ -2,7 +2,6 @@ using System.Collections;
|
|||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using TMPro;
|
||||
using UnityEngine.UIElements;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class SearchName1 : MonoBehaviour
|
||||
|
@ -10,7 +9,15 @@ public class SearchName1 : MonoBehaviour
|
|||
public GameObject scrollView;
|
||||
public Transform scrollViewContent;
|
||||
public TMP_InputField inputField;
|
||||
public TextMeshProUGUI searchText;
|
||||
/// <summary>
|
||||
/// 搜索文本框预制体
|
||||
/// </summary>
|
||||
public GameObject prefabsText;
|
||||
/// <summary>
|
||||
/// 搜索按钮
|
||||
/// </summary>
|
||||
public Button serarchBtn;
|
||||
[Header("加入需要搜索的设备名称")]
|
||||
public List<GameObject> objs = new List<GameObject>();
|
||||
private List<GameObject> SearchObjects = new List<GameObject>();
|
||||
|
@ -20,6 +27,7 @@ public class SearchName1 : MonoBehaviour
|
|||
{
|
||||
scrollView.SetActive(false);
|
||||
InputFieldEvent();
|
||||
//OnClickSearchBtn();
|
||||
}
|
||||
|
||||
void InputFieldEvent()
|
||||
|
@ -48,12 +56,11 @@ public class SearchName1 : MonoBehaviour
|
|||
|
||||
foreach (GameObject go in objs)
|
||||
{
|
||||
if (go.name.Contains(strName))
|
||||
if ((go.name).ToString().Contains(strName))
|
||||
{
|
||||
SearchObjects.Add(go);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < SearchObjects.Count; i++)
|
||||
{
|
||||
GameObject tmp= Instantiate(prefabsText, scrollViewContent,false);
|
||||
|
@ -62,5 +69,19 @@ public class SearchName1 : MonoBehaviour
|
|||
}
|
||||
|
||||
}
|
||||
//TODO:有问题
|
||||
void OnClickSearchBtn()
|
||||
{
|
||||
serarchBtn.onClick.AddListener(() =>
|
||||
{
|
||||
if (searchText.text != "")
|
||||
{
|
||||
scrollView.SetActive(true);
|
||||
Serach(searchText.text.Trim());
|
||||
}
|
||||
else scrollView.SetActive(false);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -25,6 +25,13 @@ public class DragTest : MonoBehaviour
|
|||
public bool isExit = false;
|
||||
public bool isClicked = false;
|
||||
|
||||
public bool isTarget;
|
||||
/// <summary>
|
||||
/// 是否已经放置
|
||||
/// </summary>
|
||||
public bool isplace;
|
||||
|
||||
|
||||
public bool canPut;
|
||||
bool isray = false;
|
||||
bool finishPut;
|
||||
|
@ -78,7 +85,7 @@ public class DragTest : MonoBehaviour
|
|||
{
|
||||
//if (isray)
|
||||
{
|
||||
bool isTarget = false;
|
||||
isTarget = false;
|
||||
foreach (GameObject item in listTargets)
|
||||
{
|
||||
if (GetOverGameObject(Camera.main.gameObject).Contains(item))
|
||||
|
@ -167,6 +174,7 @@ public class DragTest : MonoBehaviour
|
|||
|
||||
finishPut = true;
|
||||
isTarget = true;
|
||||
isplace = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -177,7 +185,11 @@ public class DragTest : MonoBehaviour
|
|||
|
||||
}
|
||||
}
|
||||
if (isTarget == false)
|
||||
if (isplace == false)
|
||||
{
|
||||
Destroy(gameObject);
|
||||
}
|
||||
else if (!isTarget && !isplace)
|
||||
{
|
||||
Destroy(gameObject);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue