public override void SetStageOutInfo() { int[] out_num = { 1, 2, 3, 31 }; string ExcelPath = Application.dataPath + "/StreamingAssets/Excel/MyOut.xls"; ExcelOperator excelClass = new ExcelOperator(); DataTable OutData = new DataTable("OutData"); OutData = excelClass.ExcelReader(ExcelPath, caseName); if (stage_current > OutData.Rows.Count) { Debug.LogError("当前步骤OUT没有设置参数"); } else { //Debug.Log(OutData.Rows[stage_current][out_num].ToString()); for (int i = 0; i < 4; i++) { if (OutData.Rows[stage_current][out_num[i]].ToString() == "0") { GSKDATA.OutInfo[out_num[i]] = false; //CaseClass.RBP_Set_OT_Data(out_num[i], GSKDATA.OutInfo[out_num[i]]); ScreenScript.setOutData(out_num[i], 0); } else { GSKDATA.OutInfo[out_num[i]] = true; //CaseClass.RBP_Set_OT_Data(out_num[i], GSKDATA.OutInfo[out_num[i]]); ScreenScript.setOutData(out_num[i], 1); } } } }
IEnumerator phase_11()//reapeat the prograss { if (GSKDATA.SoftCurrentMode == "Teach") { //CameraPosition(); float waittime = 0; ShowTips(); ReadTips(TitleName[stage_current]); waittime = GetVoiceTime(TitleName[stage_current]); yield return(StartCoroutine(Timer(waittime))); LstageRead(); List <string> stage_code = new List <string>(); string ExcelPath = Application.dataPath + "/StreamingAssets/Excel/MyCode.xls"; ExcelOperator excelClass = new ExcelOperator(); DataTable CodeData = new DataTable("CodeData"); CodeData = excelClass.ExcelReader(ExcelPath, caseName); int i = 0; while (i < CodeData.Rows.Count) { string tempcode = CodeData.Rows[i][stage_current + 1].ToString(); if (tempcode != "") { stage_code.Add(CodeData.Rows[i][stage_current + 1].ToString()); } i++; } if (stage_code.Count > 0) { //Debug.Log("程序行:" + stage_code.Count +" " + FileName); GSKFile.CreateFile(FileName); GSKFile.writeContents(stage_code, FileName); //GSKDATA.CurrentProgramName = FileName; } else { GSKFile.DeleteProgram(FileName); //FileName = "777777.prl"; } ScreenScript.SetCurrentWin_Teach("F3"); } else { Debug.Log("pass" + stage_current); GetCurrentCode(); GetCurrentPosition(); yield return(StartCoroutine(DoubleE())); } }
// Use this for initialization void Start() { _SfxParticlesPool = new List <GameObject> { Capacity = _PoolSize }; for (int i = 0; i < _InitialSize; i++) { GameObject tmp = (GameObject)Instantiate(GenericPrefab); tmp.SetActive(false); _SfxParticlesPool.Add(tmp); } TopDoor = TopDoorSource.GetComponent <TopDoorScript>(); LeftScreen = LeftScreenSource.GetComponent <ScreenScript>(); RightScreen = RightScreenSource.GetComponent <ScreenScript>(); }
private void updateCamera() { // Obtain ScreenScript component ScreenScript cam = currentScreen.GetComponent <ScreenScript>(); // check if there;s a screenscrpt if (cam) { //Debug.Log(viewPos.y); //------------ // RIGHT //------------ // Check if there's a right screen and target's x pos is > 0.95 if (cam.rightScreen && translate != true && viewPos.x > 1.1F) { //Debug.Log("target is on the right side!"); // assign current screen to right Screen currentScreen = cam.rightScreen; // translate camera destination = new Vector3(currentScreen.position.x, 10, currentScreen.position.z); translate = true; } //------------ // LEFT //------------ // Check if there's a left screen and target's x pos is > 0.015 else if (cam.leftScreen && translate != true && viewPos.x < 0.0F) { //Debug.Log("target is on the left side!"); // assign current screen to left Screen currentScreen = cam.leftScreen; // translate camera destination = new Vector3(currentScreen.position.x, 10, currentScreen.position.z); translate = true; } //------------ // TOP //------------ // Check if there's a top screen and target's y pos is > 0.95 else if (cam.topScreen && translate != true && viewPos.y > 1.05F) { // assign current screen to atop Screen currentScreen = cam.topScreen; // translate camera destination = new Vector3(currentScreen.position.x, 10, currentScreen.position.z); translate = true; } //------------ // BOTTOM //------------ // Check if there's a bottom screen and target's y pos is < 0.015 else if (cam.bottomScreen && translate != true && viewPos.y < 0.09F) { // assign current screen to bottom Screen currentScreen = cam.bottomScreen; // translate camera destination = new Vector3(currentScreen.position.x, 10, currentScreen.position.z); translate = true; } }//check for camscript }
private void OnEnable() { targetCamera = FindObjectOfType <Camera>(); Debug.Assert(targetCamera != null); screenScript = FindObjectOfType <ScreenScript>(); Debug.Assert(screenScript != null); foreach (var screenMode in new ScreenScript.ScreenModeType[] { ScreenScript.ScreenModeType.Normal8K, ScreenScript.ScreenModeType.Distotion4K, ScreenScript.ScreenModeType.Normal4K, ScreenScript.ScreenModeType.Distotion2K, ScreenScript.ScreenModeType.Normal2K }) { var toggle = Find <Toggle>(screenMode.ToString()); if (toggle != null) { var action = new UnityAction <bool>((val) => { if (val) { screenScript.ScreenMode = screenMode; } }); onStart += () => { toggle.isOn = screenScript.ScreenMode == screenMode; toggle.onValueChanged.AddListener(action); }; onDisable += () => { if (toggle != null) { toggle.onValueChanged.RemoveListener(action); } }; } } { var slider = Find <Slider>("FieldOfView"); if (slider != null) { var action = new UnityAction <float>((val) => targetCamera.fieldOfView = val); onStart += () => { slider.value = targetCamera.fieldOfView; slider.onValueChanged.AddListener(action); }; onDisable += () => { if (slider != null) { slider.onValueChanged.RemoveListener(action); } }; } } { var slider = Find <Slider>("V-Dist"); if (slider != null) { var action = new UnityAction <float>((val) => screenScript.VerticalDistotion = val); onStart += () => { slider.value = screenScript.VerticalDistotion; slider.onValueChanged.AddListener(action); }; onDisable += () => { if (slider != null) { slider.onValueChanged.RemoveListener(action); } }; } } { var slider = Find <Slider>("H-Dist"); if (slider != null) { var action = new UnityAction <float>((val) => screenScript.HorizontalDistotion = val); onStart += () => { slider.value = screenScript.HorizontalDistotion; slider.onValueChanged.AddListener(action); }; onDisable += () => { if (slider != null) { slider.onValueChanged.RemoveListener(action); } }; } } { var toggle = Find <Toggle>("Soft"); if (toggle != null) { var action = new UnityAction <bool>((val) => screenScript.SoftFilter = val); onStart += () => { toggle.isOn = screenScript.SoftFilter; toggle.onValueChanged.AddListener(action); }; onDisable += () => { if (toggle != null) { toggle.onValueChanged.RemoveListener(action); } }; } } { var toggle = Find <Toggle>("Sharp"); if (toggle != null) { var action = new UnityAction <bool>((val) => screenScript.SharpFilter = val); onStart += () => { toggle.isOn = screenScript.SharpFilter; toggle.onValueChanged.AddListener(action); }; onDisable += () => { if (toggle != null) { toggle.onValueChanged.RemoveListener(action); } }; } } { var rawImage = Find <RawImage>("RawImage"); if (rawImage != null) { onUpdate += () => { if (screenScript.Updated) { rawImage.texture = screenScript.Thumbnail; } }; onDisable += () => { if (rawImage != null) { rawImage.texture = null; } }; } } started = false; }