123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228 |
- using SC.XR.Unity;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- public class SettingMachineRoomData : MonoSingleton<SettingMachineRoomData>
- {
- public GameObject editorBtnCanvas;
- public GameObject EditorCanvas;
- public SCInputField line;
- public SCInputField list;
- public SCInputField lineI;
- public SCInputField listI;
- public SCInputField bNumber;
- public SCInputField cabinetW;
- public SCInputField cabinetH;
- public SCInputField bIntervalH;
- public SCInputField firstBladeSeverH;
- public SCInputField tagOffestPosY;
- public SCInputField cameraFar;
- public Slider lineSlider;
- public Slider listSlider;
- public Slider lineISlider;
- public Slider listISlider;
- public Slider bNumberSlider;
- public Slider cabinetWSlider;
- public Slider cabinetHSlider;
- public Slider bIntervalHSlider;
- public Slider firstBHSlider;
- public Slider tagOPosYSlider;
- public Slider cameraFarSlider;
- public Text lineText;
- public Text listText;
- public Text lineIText;
- public Text listIText;
- public Text bNumberText;
- public Text cabinetWText;
- public Text cabinetHText;
- public Text bIntervalHText;
- public Text firstBHText;
- public Text tagOPosYText;
- public Text cameraFarText;
- private void Start()
- {
-
- }
- public void Init(MachineRoomData data)
- {
-
- //this.line.textComponent.text = data.line.ToString();
- //this.list.textComponent.text = data.list.ToString();
- //this.lineI.textComponent.text = data.intervalW.ToString();
- //this.listI.textComponent.text = data.intervalL.ToString();
- //this.bNumber.textComponent.text = data.bladeSeverNumber.ToString();
- //this.cabinetW.textComponent.text = data.cabinetW.ToString();
- //this.cabinetH.textComponent.text = data.cabinetH.ToString();
- //this.bIntervalH.textComponent.text = data.bIntervalH.ToString();
- //this.firstBladeSeverH.textComponent.text = data.firstBladeSeverH.ToString();
- this.line.text = data.line.ToString();
- this.list.text = data.list.ToString();
- this.lineI.text = data.intervalW.ToString();
- this.listI.text = data.intervalL.ToString();
- this.bNumber.text = data.bladeSeverNumber.ToString();
- this.cabinetW.text = data.cabinetW.ToString();
- this.cabinetH.text = data.cabinetH.ToString();
- this.bIntervalH.text = data.bIntervalH.ToString();
- this.firstBladeSeverH.text = data.firstBladeSeverH.ToString();
- this.tagOffestPosY.text = data.tagOffestPosY.ToString();
- this.cameraFar.text = data.cameraFar.ToString();
- //this.line.text = "10";
- //this.list.text = "10";
- //this.lineI.text = "10";
- //this.listI.text = "10";
- //this.bNumber.text = "10";
- //this.cabinetW.text = "10";
- //this.cabinetH.text = "2";
- //this.bIntervalH.text = "1";
- //this.firstBladeSeverH.text = "2";
- //this.tagOffestPosY.text = "2";
- //this.cameraFar.text = "2";
- lineSlider.maxValue = 10;
- lineSlider.value = data.line;
- lineText.text = data.line.ToString();
- listSlider.maxValue = 10;
- listSlider.value = data.list;
- listText.text = data.list.ToString();
- lineISlider.maxValue = 10;
- lineISlider.value = data.intervalW;
- lineIText.text = data.intervalW.ToString();
- listISlider.maxValue = 10;
- listISlider.value = data.intervalL;
- listIText.text = data.intervalL.ToString();
- bNumberSlider.maxValue = 10;
- bNumberSlider.value = data.bladeSeverNumber;
- bNumberText.text = data.bladeSeverNumber.ToString();
- cabinetWSlider.maxValue = 10;
- cabinetWSlider.value = data.cabinetW;
- cabinetWText.text = data.cabinetW.ToString();
- cabinetHSlider.maxValue = 10f;
- cabinetHSlider.value = data.cabinetH;
- cabinetHText.text = data.cabinetH.ToString();
- bIntervalHSlider.maxValue = 10;
- bIntervalHSlider.value = data.bIntervalH;
- bIntervalHText.text = data.bIntervalH.ToString();
- firstBHSlider.maxValue = 2;
- firstBHSlider.value = data.firstBladeSeverH;
- firstBHText.text = data.firstBladeSeverH.ToString();
- tagOPosYSlider.maxValue = 2;
- tagOPosYSlider.value = data.tagOffestPosY;
- tagOPosYText.text = data.tagOffestPosY.ToString();
- cameraFarSlider.maxValue = 100;
- cameraFarSlider.minValue = 2;
- cameraFarSlider.value = data.cameraFar;
- cameraFarText.text = data.cameraFar.ToString();
-
- line.onValueChanged.AddListener((msg) => { if (msg == "") return; lineSlider.maxValue = int.Parse(msg); });
- lineSlider.onValueChanged.AddListener((value) => { MachineRoomManager.Instance.data.line = (int)value; MachineRoomManager.Instance.SettingMachine(); lineText.text = value.ToString(); });
- list.onValueChanged.AddListener((msg) => { if (msg == "") return; listSlider.maxValue = int.Parse(msg); });
- listSlider.onValueChanged.AddListener((value) => { MachineRoomManager.Instance.data.list = (int)value; MachineRoomManager.Instance.SettingMachine(); listText.text = value.ToString(); });
- lineI.onValueChanged.AddListener((msg) => { if (msg == "") return; lineISlider.maxValue = float.Parse(msg); });
- lineISlider.onValueChanged.AddListener((value) => { MachineRoomManager.Instance.data.intervalW = value; MachineRoomManager.Instance.SettingMachine(); lineIText.text = value.ToString(); });
- listI.onValueChanged.AddListener((msg) => { if (msg == "") return; listISlider.maxValue = float.Parse(msg); });
- listISlider.onValueChanged.AddListener((value) => { MachineRoomManager.Instance.data.intervalL = value; MachineRoomManager.Instance.SettingMachine(); listIText.text = value.ToString(); });
- bNumber.onValueChanged.AddListener((msg) => { if (msg == "") return; bNumberSlider.maxValue = int.Parse(msg); });
- bNumberSlider.onValueChanged.AddListener((value) => { MachineRoomManager.Instance.data.bladeSeverNumber = (int)value; MachineRoomManager.Instance.SettingMachine(); bNumberText.text = value.ToString(); });
- cabinetW.onValueChanged.AddListener((msg) => { if (msg == "") return; cabinetWSlider.maxValue = float.Parse(msg); });
- cabinetWSlider.onValueChanged.AddListener((value) => { MachineRoomManager.Instance.data.cabinetW = value; MachineRoomManager.Instance.SettingMachine(); cabinetWText.text = value.ToString(); });
- cabinetH.onValueChanged.AddListener((msg) => { if (msg == "") return; cabinetHSlider.maxValue = float.Parse(msg); });
- cabinetHSlider.onValueChanged.AddListener((value) => { MachineRoomManager.Instance.data.cabinetH = value; MachineRoomManager.Instance.SettingMachine(); cabinetHText.text = value.ToString(); });
- bIntervalH.onValueChanged.AddListener((msg) => { if (msg == "") return; bIntervalHSlider.maxValue = float.Parse(msg); });
- bIntervalHSlider.onValueChanged.AddListener((value) => { MachineRoomManager.Instance.data.bIntervalH = value; MachineRoomManager.Instance.SettingMachine(); bIntervalHText.text = value.ToString(); });
- firstBladeSeverH.onValueChanged.AddListener((msg) => { if (msg == "") return; firstBHSlider.maxValue = float.Parse(msg); });
- firstBHSlider.onValueChanged.AddListener((value) => { MachineRoomManager.Instance.data.firstBladeSeverH = value; MachineRoomManager.Instance.SettingMachine(); firstBHText.text = value.ToString(); });
- tagOffestPosY.onValueChanged.AddListener((msg) => { if (msg == "") return; tagOPosYSlider.maxValue = float.Parse(msg); });
- tagOPosYSlider.onValueChanged.AddListener((value) => { MachineRoomManager.Instance.data.tagOffestPosY = value; MachineRoomManager.Instance.SettingMachine(); tagOPosYText.text = value.ToString(); });
- cameraFar.onValueChanged.AddListener((msg) => { if (msg == "") return; cameraFarSlider.maxValue = float.Parse(msg); });
- cameraFarSlider.onValueChanged.AddListener((value) => { MachineRoomManager.Instance.data.cameraFar = value; MachineRoomManager.Instance.SettingCameraFar(); cameraFarText.text = value.ToString(); });
- // MachineRoomManager.Instance.MachineInit();
- }
- public void Onclick()
- {
- int lineNumber = int.Parse(line.textComponent.text);
- int listNumber = int.Parse(list.textComponent.text);
- float lineINumber = float.Parse(lineI.textComponent.text);
- float listINumber = float.Parse(listI.textComponent.text);
- int bNumbers = int.Parse(bNumber.textComponent.text);
- float cabinetWN = float.Parse(cabinetW.textComponent.text);
- float cabinetHN = float.Parse(cabinetH.textComponent.text);
- float bIntervalHN = float.Parse(bIntervalH.textComponent.text);
- float firstBHN = float.Parse(firstBladeSeverH.textComponent.text);
- MachineRoomManager.Instance.data.line = (int)lineSlider.value;
- MachineRoomManager.Instance.data.list = (int)listSlider.value;
- MachineRoomManager.Instance.data.intervalW = lineISlider.value;
- MachineRoomManager.Instance.data.intervalL = listISlider.value;
- MachineRoomManager.Instance.data.bladeSeverNumber = (int)bNumberSlider.value;
- MachineRoomManager.Instance.data.cabinetW = cabinetWSlider.value;
- MachineRoomManager.Instance.data.cabinetH = cabinetHSlider.value;
- MachineRoomManager.Instance.data.bIntervalH = bIntervalHSlider.value;
- MachineRoomManager.Instance.data.firstBladeSeverH = firstBHSlider.value;
- MachineRoomManager.Instance.SettingMachine();
- }
- private bool isEditor = false;
- public void EdiotrOnClick()
- {
- isEditor = !isEditor;
- EditorCanvas.SetActive(isEditor);
- }
-
- public void LineSlider( float maxValue)
- {
- lineSlider.maxValue = maxValue;
- }
- public void ListSlider( float maxValue)
- {
- listSlider.maxValue = maxValue;
- }
- private float openEditor = 0;
- public void EditorOpen()
- {
- openEditor++;
- if(openEditor>15&& openEditor<20)
- {
- editorBtnCanvas.SetActive(true);
-
- }
- else
- {
- editorBtnCanvas.SetActive(false);
- }
- }
- }
|