/// <summary> /// 获取正在被拖拽的技能类型 /// </summary> private int GetSkillTypeIDTouching(SkillTouch skillTouch) { for (int i = 0; i < skillTouches.Count; i++) { if (skillTouches[i] == skillTouch) { Debug.Log(i); return(SkillMsg.Instance.GetSkillTypeID(i)); } } return((int)SkillTypes.NoneTypeSkill); }
/// <summary> /// 技能释放方向图标移动 /// </summary> /// <param name="touch"></param> private void SkillIconMove(SkillTouch touch) { //hor = 遥感脚本中的localPosition.x float hor = touch.Horizontal; //ver = 遥感脚本中的localPosition.y float ver = touch.Vertical; Vector3 direction = new Vector3(hor, 0, ver); if (direction != Vector3.zero) { Show(); Debug.Log("s:" + GetSkillTypeIDTouching(touch)); SkillType(GetSkillTypeIDTouching(touch), direction); quaternions = Quaternion.LookRotation(direction); m_position = transform.position; } else { Hide(); transform.position = playPos; transform.rotation = playRot; } }