From df6e2fe0699e4c1347d1bbddb4e3a44fc60a8aa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D1=82=D0=B0=D0=BD=D0=B8=D1=81=D0=BB=D0=B0=D0=B2=20?= =?UTF-8?q?=D0=A5=D0=BE=D0=B7=D1=8F=D0=B5=D0=BD=D0=BE=D0=BA?= Date: Mon, 7 Apr 2025 10:57:03 +0700 Subject: [PATCH] first commit --- API.meta | 8 + API/MTEGetMarksLabelsByArrPoint.meta | 8 + API/MTEGetMarksLabelsByArrPoint/Data.cs | 38 +++ API/MTEGetMarksLabelsByArrPoint/Data.cs.meta | 11 + MethodJSON.cs | 42 +++ MethodJSON.cs.meta | 11 + PersonScript.cs | 261 +++++++++++++++++++ PersonScript.cs.meta | 11 + PlayerScript.cs | 40 +++ PlayerScript.cs.meta | 11 + PostgreSQL.cs | 67 +++++ PostgreSQL.cs.meta | 11 + ThanksStASSForTheNiceMethod.cs | 178 +++++++++++++ ThanksStASSForTheNiceMethod.cs.meta | 11 + Uiika.cs | 173 ++++++++++++ Uiika.cs.meta | 11 + 16 files changed, 892 insertions(+) create mode 100644 API.meta create mode 100644 API/MTEGetMarksLabelsByArrPoint.meta create mode 100644 API/MTEGetMarksLabelsByArrPoint/Data.cs create mode 100644 API/MTEGetMarksLabelsByArrPoint/Data.cs.meta create mode 100644 MethodJSON.cs create mode 100644 MethodJSON.cs.meta create mode 100644 PersonScript.cs create mode 100644 PersonScript.cs.meta create mode 100644 PlayerScript.cs create mode 100644 PlayerScript.cs.meta create mode 100644 PostgreSQL.cs create mode 100644 PostgreSQL.cs.meta create mode 100644 ThanksStASSForTheNiceMethod.cs create mode 100644 ThanksStASSForTheNiceMethod.cs.meta create mode 100644 Uiika.cs create mode 100644 Uiika.cs.meta diff --git a/API.meta b/API.meta new file mode 100644 index 0000000..8af26de --- /dev/null +++ b/API.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4e30640b3abb93642a825989a05339a1 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/API/MTEGetMarksLabelsByArrPoint.meta b/API/MTEGetMarksLabelsByArrPoint.meta new file mode 100644 index 0000000..ebba276 --- /dev/null +++ b/API/MTEGetMarksLabelsByArrPoint.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d872f798ef1b3214ea27187d319cce1c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/API/MTEGetMarksLabelsByArrPoint/Data.cs b/API/MTEGetMarksLabelsByArrPoint/Data.cs new file mode 100644 index 0000000..9b856c9 --- /dev/null +++ b/API/MTEGetMarksLabelsByArrPoint/Data.cs @@ -0,0 +1,38 @@ +п»їusing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Assets.Scripts.API.MTEGetMarksLabelsByArrPoint +{ + [System.Serializable] + public class ApiResponse + { + public string error; + public ResponseData respose; + } + + [System.Serializable] + public class ResponseData + { + public Item[] items; + } + + [System.Serializable] + public class Item + { + public string aliases; + public string block_name; + public CenterPoint center_point; + public bool is_mark_detect; + } + + [System.Serializable] + public class CenterPoint + { + public float x; + public float y; + public float z; + } +} diff --git a/API/MTEGetMarksLabelsByArrPoint/Data.cs.meta b/API/MTEGetMarksLabelsByArrPoint/Data.cs.meta new file mode 100644 index 0000000..d804898 --- /dev/null +++ b/API/MTEGetMarksLabelsByArrPoint/Data.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5e4f00a28bac5814fa61edf72f1325b5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/MethodJSON.cs b/MethodJSON.cs new file mode 100644 index 0000000..e280773 --- /dev/null +++ b/MethodJSON.cs @@ -0,0 +1,42 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using System; + +// Root myDeserializedClass = JsonConvert.DeserializeObject(myJsonResponse); +public class Item +{ + public List block_names_aliases { get; set; } + public int sn { get; set; } + public DateTime time { get; set; } + public DateTime time_mo { get; set; } + public float x { get; set; } + public float x_mo { get; set; } + public float y { get; set; } + public float y_mo { get; set; } + public float z { get; set; } + public float z_mo { get; set; } +} + +public class MarksTime +{ + public int count_seconds { get; set; } + public string name { get; set; } +} + +public class ResposeMethod +{ + public List items { get; set; } + public string tag { get; set; } + public string time_begin { get; set; } + public string time_end { get; set; } + public List marks_time { get; set; } +} + +public class MethodJSON +{ + public string error { get; set; } + public ResposeMethod respose { get; set; } + public int status { get; set; } +} + diff --git a/MethodJSON.cs.meta b/MethodJSON.cs.meta new file mode 100644 index 0000000..e346c51 --- /dev/null +++ b/MethodJSON.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0be947f1f89f1e2409163368a7209533 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/PersonScript.cs b/PersonScript.cs new file mode 100644 index 0000000..b3ca576 --- /dev/null +++ b/PersonScript.cs @@ -0,0 +1,261 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.AI; +using System; +using System.Globalization; +using UnityEngine.UIElements; + +public class PersonScript : MonoBehaviour +{ + [Header("Данные сотрудника")] + public string FIO; //ФИО сотрудника + public string Tabnomer; //Серийный номер сотрудника + [Header("Компоненты сотрудника")] + [SerializeField] private Animator PersonAnimator; //Аниматор + [SerializeField] private NavMeshAgent NavMeshAgent; //ИИ + [SerializeField] private int CurrentPoint; //Текущая точка + [SerializeField] private ThanksStASSForTheNiceMethod Delogger; //Скрипт с данными + [SerializeField] private Uiika Uiika; + public VisualTreeAsset MainUIPrefab; + private Label TimeText; //UI компоненты --> + private Label CordsMoText; + private Label CordsRTLSText; + private Label PointText; + private Label TimeLabel; + private Label OtmetkaName; + private Label FullTime; + private Label SlidBegin; + private Label SlidEnd; + private ProgressBar ProgressBar; + private Button PlayButton; + private Button StopButton; + private Button BackButton; + private Slider Slider; + private SliderInt SliderTime; + private SliderInt SliderMove; // <-- UI компоненты + [SerializeField] private GameObject MoPointPrefab; //Префаб точки МО + [SerializeField] private GameObject RTLSPointPrefab; //Префаб точки РТЛС + [Header("UIDocument")] + public UIDocument UI; //UI + private GameObject moPoint; //память о точке МО + private GameObject rtlsPoint; //память о точке РТЛС + [Header("Данные ИИ")] + public float WaitTime; //Время проверки точки + public float NavAgentSpeed; //Скорость перемещения ИИ + public Vector3 VectorDestination; //Точка назначения + public float RemainingDistance; // оставшееся расстояние до точки + [Space] + public bool Play; //Проигрывание хождения + + public void InitMePlease() //Инициализация UI и установка начальных значений + { + var root = UI.rootVisualElement; + + TimeText = root.Q