64 lines
996 B
C#
64 lines
996 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.EventSystems;
|
|
using UnityEngine.UI;
|
|
using ZenFulcrum.EmbeddedBrowser;
|
|
|
|
/// <summary>
|
|
/// 异常Icon
|
|
/// wumin
|
|
/// </summary>
|
|
public class CamWarn3DIcon : MonoBehaviour
|
|
{
|
|
|
|
public int camID;//摄像头编号
|
|
private Camera cam;
|
|
|
|
|
|
private void Awake()
|
|
{
|
|
|
|
}
|
|
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
|
|
cam = Camera.main;
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
|
|
//Icon永远朝着镜头
|
|
if (cam != null)
|
|
transform.LookAt(cam.transform.position, Vector3.up);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// 点击Icon
|
|
/// </summary>
|
|
private void OnMouseDown()
|
|
{
|
|
|
|
if (EventSystem.current.IsPointerOverGameObject())
|
|
{
|
|
Debug.Log("鼠标在UI上");
|
|
return;
|
|
}
|
|
Main.intance.m_htmlPanel.CallFunction("showCarema");
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|