/// <summary> /// 第二击 /// </summary> public void Two() { float distance = role.attackDistance + dican; List <Role> enemys = new List <Role>(); foreach (Role go in SpawnManager.Instance.enemyList) { if (go.Group == role.Group) { continue; } if (go.id == role.id) { continue; } float temp = Vector3.Distance(go.transform.position, role.transform.position); if (temp <= distance) { enemys.Add(go); //distance = temp; } } foreach (Role enemy in enemys) { Vector3 targetPos = enemy.transform.position; targetPos.y = role.transform.position.y; role.transform.LookAt(targetPos); SkillSystem skill = enemy.GetComponent <SkillSystem>(); skill.AddOp(OpCode.Demage, role, (int)(role.atk * atk2), (int)KoType.KNOCK_DOWN); } }