void MoveThePlayer() { /*if (!isLocalPlayer) { return; }*/ if (Input.GetMouseButtonDown (0)) { if(isLocalPlayer){ Ray ray = Camera.main.ScreenPointToRay (Input.mousePosition); RaycastHit hit; if (Physics.Raycast (ray, out hit)) { GameObject PosEnemigo = hit.collider.gameObject; if(PosEnemigo.tag.Equals("Enemy") || PosEnemigo.tag.Equals("Boss")){ Debug.Log ("ENTRO...... " + PosEnemigo.transform.position); this.Enemigo = PosEnemigo.GetComponent<TagEnemy> (); this.transform.LookAt(this.Enemigo.transform.position); }else if (hit.collider is TerrainCollider) { player_ToPointDistance = Vector3.Distance (transform.position, hit.point); if (player_ToPointDistance >= 1.0f) { canMove = true; target_Pos = hit.point; } } } } } // if mouse button down if (canMove) { anim.SetFloat ("Walk", 1.0f); Vector3 target_Temp = new Vector3 (target_Pos.x, transform.position.y, target_Pos.z); transform.rotation = Quaternion.Slerp (transform.rotation, Quaternion.LookRotation (target_Temp - transform.position), 15.0f * Time.deltaTime); player_Move = transform.forward * moveSpeed * Time.deltaTime; if (Vector3.Distance (transform.position, target_Pos) <= 0.1f) { canMove = false; } } else { player_Move.Set (0f, 0f, 0f); anim.SetFloat ("Walk", 0f); } }
void ToTagEnemy(UserInfo user, string path) { if (te == null) { te = new TagEnemy(this); } te.Show(); var arr = path.Split(new char[] { '?' }); var filename = arr[0]; var indexes = new int[] { }; if (arr.Length > 1) { indexes = arr[1].Split(new char[] { ',' }).Select(item => int.Parse(item)).ToArray(); } //te.AddTag(@"E:\Users\Administrator\source\repos\WpfApp1\MyTool\bin\Debug\debug\fuhun\637160951978766004.bmp", user); te.AddTag(filename, user, indexes); SetTagEnemy(user, indexes); }
/// <summary> /// 清除标记敌人窗口 /// </summary> public void clearDestroyTags() { te = null; }