using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using System.Globalization; public class SettingCal : MonoBehaviour { public void showInput() { GameObject S = GameObject.Find("PNLCAL"); DOIT.AllChildOff(S); GameObject.Find("PNLCAL").transform.Find(this.name).gameObject.SetActive(true); } public void Add() { //DOORS GameObject doors = GameObject.Find("PNLCAL").transform.Find("DOORS").transform.Find("INPUTS").gameObject; _P.DF = ConvertStringToNumber(doors, "InDO1"); _P.DD = ConvertStringToNumber(doors, "InDO2"); //CASEES GameObject cases = GameObject.Find("PNLCAL").transform.Find("CASES").transform.Find("INPUTS").gameObject; _P.CB = ConvertStringToNumber(cases,"InCA1"); _P.CW = ConvertStringToNumber(cases, "InCA2"); _P.CT = ConvertStringToNumber(cases, "InCA3"); _P.CCB = ConvertStringToNumber(cases, "InCA4"); _P.CCW = ConvertStringToNumber(cases, "InCA4"); //DRAWERS GameObject drawers = GameObject.Find("PNLCAL").transform.Find("DRAWERS").transform.Find("INPUTS").gameObject; _P.DR1 = ConvertStringToNumber(drawers, "InDR1"); //PANELS GameObject panels = GameObject.Find("PNLCAL").transform.Find("PANELS").transform.Find("INPUTS").gameObject; _P.P12 = ConvertStringToNumber(panels, "InPA1"); _P.P58 = ConvertStringToNumber(panels, "InPA2"); _P.P34 = ConvertStringToNumber(panels, "InPA3"); _P.P1 = ConvertStringToNumber(panels, "InPA4"); _P.P112 = ConvertStringToNumber(panels, "InPA5"); _P.P2 = ConvertStringToNumber(panels, "InPA6"); //MOLDINGS GameObject moldings = GameObject.Find("PNLCAL").transform.Find("MOLDINGS").transform.Find("INPUTS").gameObject; _P.MO = ConvertStringToNumber(moldings, "InMO"); _P.MOU = ConvertStringToNumber(moldings, "InMOU"); _P.MH = ConvertStringToNumber(moldings, "InMH"); _P.MU = ConvertStringToNumber(moldings, "InMU"); _P.MK = ConvertStringToNumber(moldings, "InMK"); _P.MOL = ConvertStringToNumber(moldings, "InMOL"); _P.MOUL= ConvertStringToNumber(moldings, "InMOUL"); _P.MHL = ConvertStringToNumber(moldings, "InMHL"); _P.MUL = ConvertStringToNumber(moldings, "InMUL"); _P.MKL = ConvertStringToNumber(moldings, "InMKL"); //OPTIONS GameObject options = GameObject.Find("PNLCAL").transform.Find("OPTIONS").transform.Find("INPUTS").gameObject; _P.O1p = ConvertStringToNumber(options, "InO1"); _P.O2p = ConvertStringToNumber(options, "InO2"); _P.O3p = ConvertStringToNumber(options, "InO3"); _P.O4p = ConvertStringToNumber(options, "InO4"); _P.O5p = ConvertStringToNumber(options, "InO5"); _P.O1q = ConvertStringToNumber(options, "InO1q"); _P.O2q = ConvertStringToNumber(options, "InO2q"); _P.O3q = ConvertStringToNumber(options, "InO3q"); _P.O4q = ConvertStringToNumber(options, "InO4q"); _P.O5q = ConvertStringToNumber(options, "InO5q"); print("_P.O4q===" + _P.O4q); _P.O1s = options.transform.Find("InO1s").transform.Find("Text").GetComponent().text; _P.O2s = options.transform.Find("InO2s").transform.Find("Text").GetComponent().text; _P.O3s = options.transform.Find("InO3s").transform.Find("Text").GetComponent().text; _P.O4s = options.transform.Find("InO4s").transform.Find("Text").GetComponent().text; _P.O5s = options.transform.Find("InO5s").transform.Find("Text").GetComponent().text; PRICE.Calprice(); DOIT.CloseALLPNL(); } public float ConvertStringToNumber(GameObject C,string t) { float num= 0; num = DOIT.ConvertStringToNumber( C.transform.Find(t).gameObject.transform.Find("Text").GetComponent().text); return num; } public void OpenPnl() { DOIT.CloseALLPNL(); GameObject.Find("PNL").transform.Find("SETCAL").gameObject.SetActive(true); fillpnl(); } public void fillpnl() { //DOORS GameObject IND = GameObject.Find("PNLCAL").transform.Find("DOORS").transform.Find("INPUTS").gameObject; IND.transform.Find("InDO1").gameObject.GetComponent().text = _P.DF.ToString("C"); IND.transform.Find("InDO2").gameObject.GetComponent().text = _P.DD.ToString("C"); //CASES GameObject INC = GameObject.Find("PNLCAL").transform.Find("CASES").transform.Find("INPUTS").gameObject; INC.transform.Find("InCA1").gameObject.GetComponent().text = _P.CB.ToString("C"); INC.transform.Find("InCA2").gameObject.GetComponent().text = _P.CW.ToString("C"); INC.transform.Find("InCA3").gameObject.GetComponent().text = _P.CT.ToString("C"); INC.transform.Find("InCA4").gameObject.GetComponent().text = _P.CCB.ToString("C"); INC.transform.Find("InCA5").gameObject.GetComponent().text = _P.CCW.ToString("C"); //DRAWERS GameObject INDR = GameObject.Find("PNLCAL").transform.Find("DRAWERS").transform.Find("INPUTS").gameObject; INDR.transform.Find("InDR1").gameObject.GetComponent().text = _P.DR1.ToString("C"); //PANELS GameObject INP = GameObject.Find("PNLCAL").transform.Find("PANELS").transform.Find("INPUTS").gameObject; INP.transform.Find("InPA1").gameObject.GetComponent().text = _P.P12.ToString("C"); INP.transform.Find("InPA2").gameObject.GetComponent().text = _P.P58.ToString("C"); INP.transform.Find("InPA2").gameObject.GetComponent().text = _P.P34.ToString("C"); INP.transform.Find("InPA3").gameObject.GetComponent().text = _P.P1.ToString("C"); INP.transform.Find("InPA4").gameObject.GetComponent().text = _P.P112.ToString("C"); INP.transform.Find("InPA5").gameObject.GetComponent().text = _P.P2.ToString("C"); //MOLDINGS GameObject INM = GameObject.Find("PNLCAL").transform.Find("MOLDINGS").transform.Find("INPUTS").gameObject; INM.transform.Find("InMO").gameObject.GetComponent().text = _P.MO.ToString("C"); INM.transform.Find("InMOU").gameObject.GetComponent().text = _P.MOU.ToString("C"); INM.transform.Find("InMH").gameObject.GetComponent().text = _P.MH.ToString("C"); INM.transform.Find("InMU").gameObject.GetComponent().text = _P.MU.ToString("C"); INM.transform.Find("InMK").gameObject.GetComponent().text = _P.MK.ToString("C"); INM.transform.Find("InFI").gameObject.GetComponent().text = _P.FI.ToString("C"); INM.transform.Find("InMOL").gameObject.GetComponent().text = _P.MOL.ToString(CultureInfo.InvariantCulture); INM.transform.Find("InMOUL").gameObject.GetComponent().text = _P.MOUL.ToString(CultureInfo.InvariantCulture); INM.transform.Find("InMHL").gameObject.GetComponent().text = _P.MHL.ToString(CultureInfo.InvariantCulture); INM.transform.Find("InMUL").gameObject.GetComponent().text = _P.MUL.ToString(CultureInfo.InvariantCulture); INM.transform.Find("InMKL").gameObject.GetComponent().text = _P.MKL.ToString(CultureInfo.InvariantCulture); INM.transform.Find("InFIL").gameObject.GetComponent().text = _P.FIL.ToString(CultureInfo.InvariantCulture); //OPTIONS GameObject INO = GameObject.Find("PNLCAL").transform.Find("OPTIONS").transform.Find("INPUTS").gameObject; INO.transform.Find("InO1").gameObject.GetComponent().text = _P.O1p.ToString("C"); INO.transform.Find("InO2").gameObject.GetComponent().text = _P.O2p.ToString("C"); INO.transform.Find("InO3").gameObject.GetComponent().text = _P.O3p.ToString("C"); INO.transform.Find("InO4").gameObject.GetComponent().text = _P.O4p.ToString("C"); INO.transform.Find("InO5").gameObject.GetComponent().text = _P.O5p.ToString("C"); INO.transform.Find("InO1q").gameObject.GetComponent().text = _P.O1q.ToString("F0"); INO.transform.Find("InO2q").gameObject.GetComponent().text = _P.O2q.ToString("F0"); INO.transform.Find("InO3q").gameObject.GetComponent().text = _P.O3q.ToString("F0"); INO.transform.Find("InO4q").gameObject.GetComponent().text = _P.O4q.ToString("F0"); INO.transform.Find("InO5q").gameObject.GetComponent().text = _P.O5q.ToString("F0"); if (_P.O1s != "") INO.transform.Find("InO1s").gameObject.GetComponent().text = _P.O1s.ToString(CultureInfo.InvariantCulture); if (_P.O2s != "") INO.transform.Find("InO2s").gameObject.GetComponent().text = _P.O2s.ToString(CultureInfo.InvariantCulture); if (_P.O3s != "") INO.transform.Find("InO3s").gameObject.GetComponent().text = _P.O3s.ToString(CultureInfo.InvariantCulture); if (_P.O4s != "") INO.transform.Find("InO4s").gameObject.GetComponent().text = _P.O4s.ToString(CultureInfo.InvariantCulture); if (_P.O5s != "") INO.transform.Find("InO5s").gameObject.GetComponent().text = _P.O5s.ToString(CultureInfo.InvariantCulture); } }