123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- using System.Collections;
- using System.Collections.Generic;
- using System.Net;
- using Unity.Mathematics;
- using Unity.VisualScripting;
- using UnityEngine;
- using UnityEngine.EventSystems;
- using XCharts.Runtime;
- public enum LineDir
- {
- Out,
- In
- };
- public enum ZYTime
- {
- Before,
- After,
- };
- public class LinePath : MonoBehaviour
- {
- public LineDir lineDir;
- public string startPos;
- public string endPos;
- public string linePathContent;
- public int manNum;
- public int homeNum;
- public int completeNum;
- public string dateTime;
- public GameObject lineRenderer;
- public Material firMat;
- public Material secMat;
- void Start()
- {
-
- }
- //public void SetPath(Vector3 start, Vector3 end) {
- // this.transform.position = start;
- // Vector3 direction = end - start;
- // Vector3 up = Vector3.up; // (0,1,0)
- // // 计算夹角
- // float angle = Vector3.Angle(direction, up);
- // // 使用叉积来判断方向
- // Vector3 crossProduct = Vector3.Cross(direction, up);
- // if (crossProduct.z < 0)
- // {
- // angle = 360 - angle;
- // }
- // //print(angle);
- // float distance = Vector3.Distance(end, start);
- // this.transform.localScale = new Vector3(1,distance / 2,1);
- // this.transform.eulerAngles = new Vector3(1, 1, -angle);
-
- //}
- public void OnShow()
- {
- if (RKZYLayer.lineInfoStatic)
- {
- if (!RKZYLayer.lineInfoStatic.linePaths.Contains(this))
- {
- RKZYLayer.lineInfoStatic.SetData(this);
- RKZYLayer.lineInfoStatic.GetComponent<RectTransform>().anchoredPosition = Input.mousePosition * 1920 / Screen.width;
- RKZYLayer.lineInfoStatic.linePaths.Add(this);
- //this.lineRenderer.GetComponent<MeshRenderer>().material = secMat;
- }
- }
- }
- public void UnShow()
- {
- RKZYLayer.lineInfoStatic.linePaths.Remove(this);
- //this.lineRenderer.GetComponent<MeshRenderer>().material = firMat;
- }
- //private void Update()
- //{
- // if (CameraManager.instance.secondCamera != null) {
- // float dyScale = CameraManager.instance.secondCamera.GetComponent<CameraBirdSec>().currentDistance / 6;
- // dyScale = math.clamp(dyScale, 1, 12);
- // this.transform.localScale = new Vector3(dyScale, this.transform.localScale.y, dyScale);
- // this.lineRenderer.GetComponent<MeshRenderer>().material.SetTextureScale("_MainTex", new Vector2(1, this.transform.localScale.y * 10 / this.transform.localScale.x));
- // }
- //}
- }
|