修改tips
This commit is contained in:
parent
18c89e51f5
commit
f1da03ba63
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,46 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
//============================================================
|
||||
//支持中文,文件使用UTF-8编码
|
||||
//@author YangHua
|
||||
//@create 20230917
|
||||
//@company QianHuo
|
||||
//
|
||||
//@description:
|
||||
//============================================================
|
||||
namespace Components
|
||||
{
|
||||
public class ThreeDTips : MonoBehaviour
|
||||
{
|
||||
public Camera _camera;
|
||||
// Use this for initialization
|
||||
private void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
// 从相机位置发射一条射线经过屏幕上的鼠标点击位置
|
||||
Ray ray = _camera.ScreenPointToRay(Input.mousePosition);
|
||||
|
||||
// 声明一个射线碰撞信息类
|
||||
RaycastHit hit;
|
||||
|
||||
// 进行碰撞检测
|
||||
bool res = Physics.Raycast(ray, out hit);
|
||||
|
||||
if (res)
|
||||
{
|
||||
// 如果产生了碰撞
|
||||
if (hit.collider.GetComponent<ToolModelClick>())
|
||||
{
|
||||
Debug.Log(hit.collider.name);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 3c5fc970ddc9b02408821b3367de7f06
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -61,13 +61,13 @@ public class ToolModelClick : MonoBehaviour
|
|||
|
||||
public Highlighter selfHighlighter;
|
||||
|
||||
public GameObject tipPrefab;
|
||||
|
||||
[ContextMenu("Set")]
|
||||
public void TTTTT()
|
||||
{
|
||||
tipPrefab = Resources.Load<GameObject>("ModelTips");
|
||||
}
|
||||
//public GameObject tipPrefab;
|
||||
//public GameObject tip;
|
||||
//[ContextMenu("Set")]
|
||||
//public void TTTTT()
|
||||
//{
|
||||
// tipPrefab = Resources.Load<GameObject>("ModelTips");
|
||||
//}
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
|
@ -86,6 +86,13 @@ public class ToolModelClick : MonoBehaviour
|
|||
if (EventSystem.current.IsPointerOverGameObject())
|
||||
return;
|
||||
onEnter?.Invoke();
|
||||
UIManager.Instance.SetThreeDTip(gameObject.name);
|
||||
//tip = Instantiate(tipPrefab);
|
||||
//tip.GetComponentInChildren<TextMesh>().text = gameObject.name;
|
||||
//tip.transform.localPosition = transform.localPosition;
|
||||
//tip.transform.localScale = Vector3.one;
|
||||
//tip.transform.LookAt(Camera.main.transform.position);
|
||||
//tip.transform.localEulerAngles = new Vector3(90f, 0, 0);
|
||||
}
|
||||
|
||||
private void OnMouseDown()
|
||||
|
@ -110,5 +117,7 @@ public class ToolModelClick : MonoBehaviour
|
|||
if (EventSystem.current.IsPointerOverGameObject())
|
||||
return;
|
||||
onExit?.Invoke();
|
||||
UIManager.Instance.SetThreeDTip("");
|
||||
//Destroy(tip);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace Adam
|
|||
{
|
||||
public class JobCardController : MonoBehaviour
|
||||
{
|
||||
public string url = "http://111.229.30.246:10013/Handler/Taiqu.ashx?action=kh&bianhao=";
|
||||
public string url;
|
||||
public InputField[] userIDs;
|
||||
public InputField[] userNames;
|
||||
public InputField[] workSpace;
|
||||
|
|
|
@ -22,6 +22,7 @@ public class UIManager : MonoSingleton<UIManager>
|
|||
public ExitCheckController exitCheckController;
|
||||
public Button exitBtn;
|
||||
public Button backToToolBtn;
|
||||
public Text threeDTip;
|
||||
// Use this for initialization
|
||||
private void Start()
|
||||
{
|
||||
|
@ -46,6 +47,19 @@ public class UIManager : MonoSingleton<UIManager>
|
|||
private void BackToTool()
|
||||
{
|
||||
SceneLoad.Instance.SceneChange("工具间场景");
|
||||
}
|
||||
|
||||
public void SetThreeDTip(string name)
|
||||
{
|
||||
if (name == "")
|
||||
{
|
||||
threeDTip.transform.parent.gameObject.SetActive(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
threeDTip.transform.parent.gameObject.SetActive(true);
|
||||
threeDTip.text = name;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ RenderSettings:
|
|||
m_ReflectionIntensity: 1
|
||||
m_CustomReflection: {fileID: 0}
|
||||
m_Sun: {fileID: 0}
|
||||
m_IndirectSpecularColor: {r: 0.91471344, g: 1.0185646, b: 0.94445914, a: 1}
|
||||
m_IndirectSpecularColor: {r: 0.67866755, g: 0.7565462, b: 0.7109155, a: 1}
|
||||
m_UseRadianceAmbientProbe: 0
|
||||
--- !u!157 &3
|
||||
LightmapSettings:
|
||||
|
|
Loading…
Reference in New Issue