void GetMouseInfo() { if (Input.GetMouseButtonDown(0)) { Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); Debug.DrawRay(ray.origin, ray.direction * 100, Color.red, 50); RaycastHit hit; if (Physics.Raycast(ray, out hit, Mathf.Infinity, layerMask)) { if (hit.collider.transform.name == refName) { if (anemometr.isOn) { Debug.Log("Уже включен"); } else { anemometr.SwitchToolState(); //transform.localPosition = activePos; Debug.Log("Теперь включен"); //task AppRootStatic.SetRunedTask(); } } } } }
private void LoadTask() { for (int i = 0; i < Task.Length; i++) { AppRootStatic.SetActiveTaskIndecator(i + 1, Task[i]); } }
public void Click() { if (type == TypeButton.HideInfo1 || type == TypeButton.HideInfo2 || type == TypeButton.HideHelper) { gameObject.transform.Rotate(0, 0, 180); switch (type) { case TypeButton.HideInfo1: AppRootStatic.SetActiveLabel(TypeLabel.AppMenuInfo1, !AppRootStatic.isActive(TypeLabel.AppMenuInfo1)); break; case TypeButton.HideInfo2: AppRootStatic.SetActiveLabel(TypeLabel.AppMenuInfo2, !AppRootStatic.isActive(TypeLabel.AppMenuInfo2)); break; case TypeButton.HideHelper: AppRootStatic.SetActiveLabel(TypeLabel.AppMenuHelp, !AppRootStatic.isActive(TypeLabel.AppMenuHelp)); break; } return; } if (type == TypeButton.Task) { GetComponentInChildren <RawImage>().transform.Rotate(0, 0, 180); } AppRootStatic.OnButtonClick(type, type == TypeButton.Viewer ? NumberModel:0); }
void Awake() { GetComponent <Button>().onClick.AddListener(Click); AppRootStatic.AddButton(this); if (type == TypeButton.NextInstr || type == TypeButton.PrevInstr) { txt = GetComponentInChildren <Text>(); } Rotation = transform.rotation; }
private void ButtonInstrument() { if (AppRootStatic.isActive(TypeButton.PrevInstr) && AppRootStatic.isActive(TypeButton.NextInstr)) { switch (UnityEngine.Mathf.Abs(Instrument)) { case 0: AppRootStatic.SetButtonText(TypeButton.NextInstr, "Анемометр"); AppRootStatic.SetButtonText(TypeButton.PrevInstr, "Гигрометр"); break; case 1: AppRootStatic.SetButtonText(TypeButton.NextInstr, "Гигрометр"); AppRootStatic.SetButtonText(TypeButton.PrevInstr, "Термометр"); break; case 2: AppRootStatic.SetButtonText(TypeButton.NextInstr, "Термометр"); AppRootStatic.SetButtonText(TypeButton.PrevInstr, "Анемометр"); break; } } }
public int StartLab(int var = 1) { NumberRoom = 0; //Загрузка из ресурсов(json) string jsontmp = ((TextAsset)Resources.Load("Headers", typeof(TextAsset))).text; Head = JsonUtility.FromJson <List_Headers>(jsontmp); jsontmp = ((TextAsset)Resources.Load("Helpers", typeof(TextAsset))).text; Help = JsonUtility.FromJson <List_Helpers>(jsontmp); jsontmp = ((TextAsset)Resources.Load("Info1", typeof(TextAsset))).text; Info1 = JsonUtility.FromJson <List_Info1>(jsontmp); jsontmp = ((TextAsset)Resources.Load("Variants", typeof(TextAsset))).text; Variants variant = JsonUtility.FromJson <Variants>(jsontmp); Variants = variant.Variants_Work[var]; //подгрузка варианта ViewerActivWindow(); //Start LABS Task = new bool[AppRootStatic.GetCountTask()]; for (int i = 0; i < Task.Length; i++) { Task[i] = false; } LoadTask(); return(0); }
void Awake() { AppRootStatic.AddTask(this); }
public void OnButtonClick(TypeButton _tb, int num_but = 0) { switch (_tb) { case TypeButton.Next: if (NumberRoom != 0 && NumberRoom != 5) { AppRootStatic.NextRoomNavigation(); } NumberRoom++; ViewerActivWindow(); break; case TypeButton.Back: if (NumberRoom != 6 && NumberRoom != 1) { AppRootStatic.PrevRoomNavigation(); } NumberRoom--; ViewerActivWindow(); break; case TypeButton.Metodics: AppRootStatic.SetActiveUI(TypeUI.AppMenu, false); AppRootStatic.SetActiveLabel(TypeLabel.Header, false); AppRootStatic.SetActiveLabel(TypeLabel.Info, false); AppRootStatic.SetActiveUI(TypeUI.Metodic, true); oWindows = false; break; case TypeButton.CloseMetodics: AppRootStatic.SetActiveUI(TypeUI.Metodic, false); ViewerActivWindow(); break; case TypeButton.CloseApplication: AppRootStatic.SetActiveUI(TypeUI.AppMenu, false); AppRootStatic.SetActiveLabel(TypeLabel.Header, false); AppRootStatic.SetActiveLabel(TypeLabel.Info, false); AppRootStatic.SetActiveUI(TypeUI.Exit, true); oWindows = false; break; case TypeButton.YesExit: Application.Quit(); break; case TypeButton.NoExit: AppRootStatic.SetActiveUI(TypeUI.Exit, false); ViewerActivWindow(); break; case TypeButton.NextInstr: if (Instrument % 3 != 0) { return; } Instrument = (Instrument + 1) % 3; ButtonInstrument(); AppRootStatic.NextTool(); break; case TypeButton.PrevInstr: if (Instrument % 3 != 1) { return; } Instrument = (Instrument - 1) % 3; AppRootStatic.PrevuTool(); ButtonInstrument(); break; case TypeButton.Viewer: AppRootStatic.SetActiveUI(TypeUI.Metodic, false); AppRootStatic.SetActiveLabel(TypeLabel.Viewer, true); AppRootStatic.SetObjectViewer(num_but, true); ///просотр объектов!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! break; case TypeButton.CloseViewr: AppRootStatic.SetActiveUI(TypeUI.Metodic, true); AppRootStatic.SetActiveLabel(TypeLabel.Viewer, false); break; case TypeButton.Task: AppRootStatic.SetActiveLabel(TypeLabel.Task, !AppRootStatic.isActive(TypeLabel.Task)); ///задачи break; } }
private void ViewerActivWindow() { switch (NumberRoom) { case 0: AppRootStatic.SetActiveLabel(TypeLabel.Info, true); AppRootStatic.SetActiveLabel(TypeLabel.Header, true); AppRootStatic.SetActiveUI(TypeUI.AppMenu, true); AppRootStatic.SetActiveLabel(TypeLabel.AppMenuInfo1, false); AppRootStatic.SetActiveLabel(TypeLabel.AppMenuInfo2, false); AppRootStatic.SetActiveLabel(TypeLabel.AppMenuHelp, false); AppRootStatic.SetActiveButton(TypeButton.Back, false); AppRootStatic.SetActiveButton(TypeButton.NextInstr, false); AppRootStatic.SetActiveButton(TypeButton.PrevInstr, false); AppRootStatic.SetActiveButton(TypeButton.HideInfo1, false); AppRootStatic.SetActiveButton(TypeButton.HideInfo2, false); AppRootStatic.SetActiveButton(TypeButton.HideHelper, false); AppRootStatic.SetActiveUI(TypeUI.Metodic, false); AppRootStatic.SetActiveLabel(TypeLabel.Viewer, false); AppRootStatic.SetActiveUI(TypeUI.Exit, false); AppRootStatic.SetLabelText(TypeLabel.Header, Head.Header[NumberRoom]); AppRootStatic.SetActiveLabel(TypeLabel.Task, false); AppRootStatic.SetActiveButton(TypeButton.Task, false); oWindows = true; AppRootStatic.isMoviment = false; return; case 6: AppRootStatic.SetActiveLabel(TypeLabel.Info, true); AppRootStatic.SetActiveLabel(TypeLabel.Header, true); AppRootStatic.SetActiveUI(TypeUI.AppMenu, true); AppRootStatic.SetActiveLabel(TypeLabel.AppMenuInfo1, false); AppRootStatic.SetActiveLabel(TypeLabel.AppMenuInfo2, false); AppRootStatic.SetActiveLabel(TypeLabel.AppMenuHelp, false); AppRootStatic.SetActiveButton(TypeButton.Next, false); AppRootStatic.SetActiveButton(TypeButton.NextInstr, false); AppRootStatic.SetActiveButton(TypeButton.PrevInstr, false); AppRootStatic.SetActiveButton(TypeButton.HideInfo1, false); AppRootStatic.SetActiveButton(TypeButton.HideInfo2, false); AppRootStatic.SetActiveButton(TypeButton.HideHelper, false); AppRootStatic.SetLabelText(TypeLabel.Header, Head.Header[NumberRoom]); AppRootStatic.SetActiveLabel(TypeLabel.Task, false); AppRootStatic.SetActiveButton(TypeButton.Task, false); oWindows = true; AppRootStatic.isMoviment = false; return; default: AppRootStatic.SetActiveLabel(TypeLabel.Header, true); AppRootStatic.SetActiveUI(TypeUI.AppMenu, true); if (oWindows) { AppRootStatic.SetActiveLabel(TypeLabel.AppMenuInfo1, true); AppRootStatic.SetActiveLabel(TypeLabel.AppMenuInfo2, true); AppRootStatic.SetActiveLabel(TypeLabel.AppMenuHelp, true); AppRootStatic.SetActiveButton(TypeButton.Back, true); AppRootStatic.SetActiveButton(TypeButton.Next, true); AppRootStatic.SetActiveButton(TypeButton.NextInstr, true); AppRootStatic.SetActiveButton(TypeButton.PrevInstr, true); AppRootStatic.SetActiveButton(TypeButton.HideInfo1, true); AppRootStatic.SetActiveButton(TypeButton.HideInfo2, true); AppRootStatic.SetActiveButton(TypeButton.HideHelper, true); AppRootStatic.SetActiveButton(TypeButton.Task, true); AppRootStatic.NormalButtonHide(); oWindows = false; } AppRootStatic.SetLabelText(TypeLabel.Header, Head.Header[NumberRoom]); AppRootStatic.SetLabelText(TypeLabel.AppMenuInfo1, Info1.Info[NumberRoom - 1]); AppRootStatic.SetLabelText(TypeLabel.AppMenuInfo2, GetStrinInfo2(Variants.Rooms[NumberRoom - 1])); AppRootStatic.SetValues(System.Convert.ToSingle(Variants.Rooms[NumberRoom - 1].ValueThermometr), System.Convert.ToSingle(Variants.Rooms[NumberRoom - 1].ValueAnimometr) / 10, System.Convert.ToSingle(Variants.Rooms[NumberRoom - 1].ValueHygrometeDry), System.Convert.ToSingle(Variants.Rooms[NumberRoom - 1].ValueHygrometeWet)); AppRootStatic.SwitchToolOff(); AppRootStatic.SetLabelText(TypeLabel.AppMenuHelp, Help.Helper[NumberRoom == 6 ? 1 : 0]); AppRootStatic.SetActiveLabel(TypeLabel.Info, false); AppRootStatic.SetActiveLabel(TypeLabel.Task, false); AppRootStatic.NormalButtonTask(); ButtonInstrument(); AppRootStatic.isMoviment = true; break; } }
void Awake() { AppRootStatic.SetAppRoot(this); }
void Awake() { AppRootStatic.AddUI(this); }
private void Awake() { AppRootStatic.SetRoomNavigaton(this); }
public void SetRunedTask() { AppRootStatic.SetActiveTaskIndecator((NumberRoom - 1) * 3 + (Instrument + 1), true); }
private float delay = 4; //не верь предупреждению, если оно есть private void Awake() { AppRootStatic.SetAnemometr(this); }
private void Awake() { AppRootStatic.SetToolScroller(this); }
private float delay = 0.5f; //не верь предупреждению, если оно есть private void Awake() { AppRootStatic.SetIKTermometr(this); }
void Awake() { AppRootStatic.AddObjectViewer(this); }
private void Awake() { AppRootStatic.SetPhysicValues(this); }
void Awake() { AppRootStatic.AddLabel(this); }