public void ResumeButton() { background.SetActive(false); Lect.SetCursor(true, false); isPause = false; Time.timeScale = 1f; }
protected override IEnumerator Move() { while (true) { if (wait) { float x = Mathf.Cos(Mathf.Deg2Rad * 45f) * radi; float y = Mathf.Sin(Mathf.Deg2Rad * 45f) * radi; Vector3 offset = new Vector3(x, 0, y); dest = transform.position + offset; SetDest2(); yield return(new WaitForSeconds(1f)); } float dis = (transform.position - dest).sqrMagnitude; if (dis < stopDistance || !nav.hasPath) { SetDestination(); } Lect.Rotate(transform, dest, control.rotateSpeed); yield return(null); } }
private IEnumerator Cycle() { transform.parent = funnelsParent; while (true) { Vector3 pos = Lect.RandomPosOnCenter(player.position, minDis, maxDis); float _y = 0f; _y = Random.Range(player.position.y - yInterval, player.position.y + yInterval); if (_y < groundY) { _y = groundY; } else if (_y > skyY) { _y = skyY; } pos.y = _y; float val = 0f; while (val < funnelCycle) { transform.position = Vector3.Lerp(transform.position, pos, moveSpeed * Time.fixedDeltaTime); val += Time.fixedDeltaTime; yield return(new WaitForFixedUpdate()); } } }
/// <summary> /// 가장 가까운 위치를 측정해서 반환함 /// </summary> private Vector3 GetClosePosition() { int positionNumber = 0; Vector3 firstLow = movePositions[0].position; if (firstLow.Equals(currentDestination)) { firstLow = movePositions[1].position; } float lowDistance = Lect.Distance(transform.position, firstLow); for (int i = 1; i < movePositions.Length; i++) { if (movePositions[i].position.Equals(currentDestination) || movePositions[i].position.Equals(previousDestination)) { continue; } float currentDistance = Lect.Distance(transform.position, movePositions[i].position); if (lowDistance > currentDistance) { positionNumber = i; lowDistance = currentDistance; } } previousDestination = currentDestination; currentDestination = movePositions[positionNumber].position; return(currentDestination); }
/// <summary> /// 가장 먼 위치를 측정해서 반환함 /// </summary> private Vector3 GetFarPosition() { int positionNumber = 0; Vector3 firstHigh = movePositions[0].position; if (firstHigh.Equals(currentDestination)) { firstHigh = movePositions[1].position; } float HighDistance = Lect.Distance(transform.position, firstHigh); for (int i = 1; i < movePositions.Length; i++) { if (movePositions[i].position.Equals(currentDestination) || movePositions[i].position.Equals(previousDestination)) { continue; } float currentDistance = Lect.Distance(transform.position, movePositions[i].position); if (HighDistance < currentDistance) { positionNumber = i; HighDistance = currentDistance; } } currentDestination = movePositions[positionNumber].position; return(currentDestination); }
public void GetTarget(int _damage, Transform _boss) { if (Lect.DistanceCheck(transform, playerTransform, hitDistance)) { return; } if (!damageFlag) { // 플레이어에게 대미지 if (!playerHit.IsInvincible) { playerHit.FrontBackCheck(playerTransform, _boss); playerHit.SwordHit(1); if (Flat.Instance.GetGround()) { playerHit.BeHitSword(); } else { playerHit.BeHitAir(); } player.DecreaseHp(_damage); } if (!damageInterval.Equals(0) && !damageFlag) { damageFlag = true; StartCoroutine(TimeSpan()); } } }
private void EditarUsuario_Load(object sender, EventArgs e) { Mantenimiento llenar = new Mantenimiento(); llenar.llenarPst(comboBox1); users us = new users(); SqlDataReader Lect; using (SqlConnection Cone = Conexion.generarConexion()) { Cone.Open(); SqlCommand comando = new SqlCommand("select [Descripcion] from [dbo].[Estados/Entidad] where [IDEntidad] = 1 ", Cone); Lect = comando.ExecuteReader(); while (Lect.Read()) { comboBox2.Items.Add(Lect["Descripcion"].ToString()); } Cone.Close(); } comboBox1.SelectedItem = txtPuesto.Text; comboBox2.SelectedItem = txtEstado.Text; }
private IEnumerator Rotate() { while (true) { Lect.Rotate(transform, player.position, rotateSpeed); yield return(new WaitForFixedUpdate()); } }
private void Pattern1() { if (Lect.DistanceCheck(transform, player, rushDistance)) { // 근접 딜레이 초기화 meleeDelay = false; //조건 1. 플레이어와의 거리가 일정 이상일때 if (currentArmor > 0) { // 조건1_1. 잔여 탄창 1 이상 // 공격 활성화, 원거리 공격 ActionControl(BossActions.Attack, true); action[BossActions.Attack].Action(true); // 가까운 위치로 이동, 이후 초기화 StartCoroutine(WaitForNextAction(BossActions.Attack, BossActions.Move, true)); } else { // 조건1_2. 잔여 탄창 0 이하 // 이동 활성화, 가까운 위치로 이동, 재장전 ActionControl(BossActions.Move, true); action[BossActions.Move].Action(true); ArmorRecharge(); // 이후 초기화 StartCoroutine(WaitForNextAction(BossActions.Move, BossActions.Finish, false)); } } else { //조건 2. 플레이어와의 거리가 일정 미만일때 if (meleeDelay) { // 조건2_1. 근접 딜레이가 있을 때 // 이동 활성화, 먼 위치로 이동, 근접 딜레이 초기화 ActionControl(BossActions.Move, true); action[BossActions.Move].Action(false); meleeDelay = false; // 먼 위치로 이동, 이후 초기화 StartCoroutine(WaitForNextAction(BossActions.Move, BossActions.Move, false)); } else { // 조건2_2. 근접 딜레이가 없을 때 // 공격 활성화, 근접 공격, 근접 딜레이 ActionControl(BossActions.Attack, true); action[BossActions.Attack].Action(false); meleeDelay = true; // 이후 초기화 StartCoroutine(WaitForNextAction(BossActions.Attack, BossActions.Finish, false)); } } }
private IEnumerator LookTarget() { while (enabled) { Lect.Rotate(transform, control.player.position, rotateSpeed); transform.rotation = new Quaternion(0, transform.rotation.y, 0, transform.rotation.w); yield return(new WaitForFixedUpdate()); } }
private IEnumerator Shoot() { while (true) { int count = 0; while (count < attackCount) { count++; Vector3 dest = Lect.RandomPosOnCenter(player.position, 0f, 2f); line.enabled = true; line.SetPosition(1, dest + Vector3.up * 5f); if (Vector3.Distance(player.position, dest) < 0.5f) { //맞았을 경우 대미지 if (!playerHit.IsInvincible) { playerHUD.DecreaseHp(damage); //playerHit.FrontBackCheck(player, transform); //playerHit.GunHit(1); if (Flat.Instance.GetGround()) { playerHit.BeHitGun(); } else { playerHit.BeHitAir(); } } } float val2 = 1f; while (val2 > 0f) { line.SetPosition(0, transform.position); val2 -= Time.fixedDeltaTime * attackSpeed; line.startWidth = val2; line.endWidth = val2; yield return(new WaitForFixedUpdate()); } line.enabled = false; } yield return(new WaitForSeconds(Mathf.Abs(attackCycle))); } }
public void llenarPuesto(ComboBox cb) { SqlDataReader Lect; using (SqlConnection Cone = Conexion.generarConexion()) { SqlCommand comando = new SqlCommand("select DESC_PUESTO from PUESTO", Cone); Lect = comando.ExecuteReader(); while (Lect.Read()) { cb.Items.Add(Lect["DESC_PUESTO"].ToString()); } } }
void Update() { if (Input.GetKeyDown(KeyCode.Escape) && !isPause) { background.SetActive(true); isPause = true; Lect.SetCursor(false, true); Time.timeScale = 0f; } else if (Input.GetKeyDown(KeyCode.Escape) && isPause) { ResumeButton(); } else if (Input.GetKeyDown(KeyCode.F1) && isPause) { ToBriefing(); } }
public void llenarTipoDis(ComboBox cb) { SqlDataReader Lect; using (SqlConnection Cone = Conexion.generarConexion()) { Cone.Open(); SqlCommand comando = new SqlCommand("select Descripcion from TipoDispositivo", Cone); Lect = comando.ExecuteReader(); while (Lect.Read()) { cb.Items.Add(Lect["Descripcion"].ToString()); } Cone.Close(); } }
public void llenarCB(ComboBox cb, string x, string y) { SqlDataReader Lect; using (SqlConnection Cone = Conexion.generarConexion()) { Cone.Open(); SqlCommand comando = new SqlCommand(x, Cone); Lect = comando.ExecuteReader(); while (Lect.Read()) { cb.Items.Add(Lect[y].ToString()); } Cone.Close(); } }
public ModificarDispositivo() { InitializeComponent(); /*Mantenimiento man = new Mantenimiento(); * * man.llenarPst(comboBox2);*/ SqlDataReader Lect; using (SqlConnection Cone = Conexion.generarConexion()) { Cone.Open(); SqlCommand comando = new SqlCommand("select [Descripcion] from [dbo].[Estados/Entidad] where [IDEntidad] = 2 ", Cone); Lect = comando.ExecuteReader(); while (Lect.Read()) { comboBox1.Items.Add(Lect["Descripcion"].ToString()); } Cone.Close(); } /************************/ SqlDataReader Lect1; using (SqlConnection Cone = Conexion.generarConexion()) { Cone.Open(); SqlCommand comando = new SqlCommand("select NOM_EMPLEADO from USUARIO", Cone); Lect1 = comando.ExecuteReader(); while (Lect1.Read()) { comboBox2.Items.Add(Lect1["NOM_EMPLEADO"].ToString()); } Cone.Close(); } /************************/ }
private void Form2_Load(object sender, EventArgs e) { tipo.Items.Add("MEDICO"); tipo.Items.Add("ENFERMERIA"); tipo.Items.Add("GENERAL"); SqlDataReader Lect; using (SqlConnection Cone = Conexion.generarConexion()) { Cone.Open(); SqlCommand comando = new SqlCommand("SELECT [Nombre],[FechaIngreso],[TipoEmpleado],[TipoContrato],[TieneProfilactica], IDEmpleado FROM Empleado where Nombre = '" + nombre.Text + "'", Cone); Lect = comando.ExecuteReader(); while (Lect.Read()) { fecha1.Value = Lect.GetDateTime(1); tipo.SelectedIndex = Lect.GetInt32(2) - 1; if (Lect.GetString(3) == "P") { radP.Checked = true; } else { radC.Checked = true; } if (Lect.GetString(4) == "SI") { radsi.Checked = true; } else { radno.Checked = true; } idEmp = Lect.GetInt32(5); } Cone.Close(); } }
public void llenarModelo(ComboBox cb, int Marca) { cb.Items.Clear(); SqlDataReader Lect; using (SqlConnection Cone = Conexion.generarConexion()) { Cone.Open(); SqlCommand comando = new SqlCommand("select Descripcion from Modelo where IDmarca = " + Marca + "", Cone); Lect = comando.ExecuteReader(); while (Lect.Read()) { cb.Items.Add(Lect["Descripcion"].ToString()); } Cone.Close(); } }
public Vector3 RandomNavmeshLocation(float _radius) { if (player == null) { player = GameObject.FindGameObjectWithTag("Player").transform; } Vector3 randomDirection = Lect.RandomPosOnCenter(player.position, _radius, _radius); Vector3 finalPosition = GetClosePosition(); randomDirection += player.position; NavMeshHit hit; if (NavMesh.SamplePosition(randomDirection, out hit, _radius, 1)) { finalPosition = hit.position; } return(finalPosition); }
protected void SetDest1() { Vector3 temp = ifCenterNull; if (player != null) { if (player.gameObject.activeSelf) { temp = player.position; } } float dis = (transform.position - dest).sqrMagnitude; while (dis < 50f) { dest = Lect.RandomPosOnCenter(temp, minDis, maxDis); dis = (transform.position - dest).sqrMagnitude; } dest = new Vector3(dest.x, 0f, dest.z); }
//Para llenar stringbox public void stringfiller(string cb, string x, string y) { SqlDataReader Lect; cb = ""; using (SqlConnection Cone = Conexion.generarConexion()) { Cone.Open(); SqlCommand comando = new SqlCommand(x, Cone); Lect = comando.ExecuteReader(); while (Lect.Read()) { cb += (Lect[y].ToString()) + "\n"; } Cone.Close(); } }
protected virtual IEnumerator Move() { while (true) { if (wait) { nav.SetDestination(transform.position); Lect.Rotate(transform, dest, control.rotateSpeed); } float dis = (transform.position - dest).sqrMagnitude; if (dis < stopDistance || !nav.hasPath) { SetDestination(); } Lect.Rotate(transform, dest, control.rotateSpeed); yield return(null); } }
protected virtual void Look() { Lect.Rotate(transform, look, rotateSpeed); }
private void Awake() { background.SetActive(false); Lect.SetCursor(true, false); isPause = false; }
private void Awake() { Lect.SetCursor(false, true); timeSpan = 0.5f; }
public void updater() { Cursor.Current = Cursors.WaitCursor; //Convenios Start conveniosTXT.Text = ""; xd = Mantenimiento.returnInt("SELECT [IDEmpleado] FROM [Empleado] where [Nombre] ='" + enfCmb.Text + "'"); SqlDataReader Lect; using (SqlConnection Cone = Conexion.generarConexion()) { Cone.Open(); SqlCommand comando = new SqlCommand("SELECT top 10 FechaInicio FROM Convenio where IDEmpleado = " + xd + "and month(FechaInicio) = month(GETDATE()) order by FechaInicio DESC", Cone); Lect = comando.ExecuteReader(); while (Lect.Read()) { dateconv = DateTime.Parse(Lect["FechaInicio"].ToString()); conveniosTXT.Text += dateconv.ToString("dd-MM-yyyy hh:mm tt") + "\n"; } Cone.Close(); } //ConveniosEnd //CalendarReset for (int i = radCalendar1.SpecialDays.Count - 1; i >= 0; i--) { radCalendar1.SpecialDays.Remove(radCalendar1.SpecialDays[i]); } //Counters permiso.Text = Mantenimiento.lookerSt("select count(IDpermiso) from Permiso where month(FechaInicio) = month(getdate()) and year(FechaInicio) = year(getdate()) and IDEmpleado =" + xd + ""); incapacidad.Text = Mantenimiento.lookerSt("select count(IDIncapacidad) from Incapacidad where month(FechaInicio) = month(getdate()) and year(FechaInicio) = year(getdate()) and IDEmpleado =" + xd + ""); //CalendarPainter Mantenimiento bol = new Mantenimiento(); if (bol.Buscar("select * from Vacaciones where IDEmpleado =" + xd + " and TipoVacacion = 'Ordinaria'") == false) { vac1.Text = "--/--/----"; prof.Text = "--/--/----"; } else { //Ordinaria START f1 = DateTime.Parse(Mantenimiento.lookerSt("select top 1 Inicio from Vacaciones where IDEmpleado =" + xd + " and TipoVacacion = 'Ordinaria' order by IDVac desc")); f2 = DateTime.Parse(Mantenimiento.lookerSt("select top 1 Final from Vacaciones where IDEmpleado =" + xd + " and TipoVacacion = 'Ordinaria' order by IDVac desc")); vac1.Text = f1.ToString("dd-MM-yyyy") + " - " + f2.ToString("dd-MM-yyyy"); double xi = (f2 - f1).TotalDays; for (int i = 0; i <= xi; i++) { DateTime date1 = f1; DateTime data2 = date1.AddDays(0 + i); Telerik.WinControls.UI.RadCalendarDay day = new Telerik.WinControls.UI.RadCalendarDay(data2); radCalendar1.SpecialDays.Add(day); radCalendar1.ElementRender += radCalendar1_ElementRender; } //Ordinaria END //Profilactica START if (Mantenimiento.lookerSt("select TieneProfilactica from Empleado where IDEmpleado =" + xd + "") == "SI") { if (bol.Buscar("select * from Vacaciones where IDEmpleado =" + xd + " and TipoVacacion = 'Profilactica'") == false) { //MessageBox.Show("No tiene vacaciones profilacticas asignadas"); prof.Text = "--/--/----"; } else { pro1 = DateTime.Parse(Mantenimiento.lookerSt("select top 1 Inicio from Vacaciones where IDEmpleado =" + xd + " and TipoVacacion = 'Profilactica' order by IDVac desc")); pro2 = DateTime.Parse(Mantenimiento.lookerSt("select top 1 Final from Vacaciones where IDEmpleado =" + xd + " and TipoVacacion = 'Profilactica' order by IDVac desc")); prof.Text = pro1.ToString("dd-MM-yyyy") + " - " + pro2.ToString("dd-MM-yyyy"); } } double xr = (pro2 - pro1).TotalDays; for (int i = 0; i <= xr; i++) { DateTime date1 = pro1; DateTime data2 = date1.AddDays(0 + i); Telerik.WinControls.UI.RadCalendarDay day = new Telerik.WinControls.UI.RadCalendarDay(data2); radCalendar1.SpecialDays.Add(day); radCalendar1.ElementRender += radCalendar1_ElementRender; } //Profilactica END radCalendar1.FocusedDate = f1; } Cursor.Current = Cursors.Default; }