public bool FindTarget() { List <GameObject> allobj = TargetChooser.FindTargetInSector(transform.position, m_SectorRadius, transform.forward, transform.position, m_SectorDegree); List <GameObject> unendure_objs = FiltUnEndureObj(allobj); if (m_TargetChoosePriority == TargetChoosePriority.kChooseMostForward) { m_Target = TargetChooser.GetMostForwardObj(transform.position, transform.forward, m_ColliderManager.FiltEnimy(unendure_objs)); } else { m_Target = TargetChooser.GetNearestObj(transform.position, m_ColliderManager.FiltEnimy(unendure_objs)); } if (m_Target == null) { return(false); } else { m_SkillMovement.SetFacePos(m_Target.transform.position); ControlTarget(m_Target); if (!SkillManager.AttatchNodeToNode(gameObject, m_ToggleNodeName, m_Target, m_TargetNodeName)) { m_Target = null; return(false); } Vector3 pos = m_Target.transform.position; DashFire.LogicSystem.NotifyGfxUpdatePosition(m_Target, pos.x, pos.y, pos.z); } return(true); }
public List <GameObject> GetEnimyInSector(Vector3 center, float radius, Vector3 direction, Vector3 degreeCenter, float degree) { List <GameObject> all_target = TargetChooser.FindTargetInSector(center, radius, direction, degreeCenter, degree); List <GameObject> targets = m_ColliderManager.FiltEnimy(all_target); return(targets); }
public override bool StartSkill() { if (!CanStart()) { m_CurTime = m_RepeatTimes; return(false); } m_CurTime += 1; if (m_CurTime > m_RepeatTimes) { m_CurTime = m_CurTime % m_RepeatTimes; } if (m_CurTime == 1) { List <GameObject> allobj = TargetChooser.FindTargetInSector(transform.position, m_SectorRadius, transform.forward, transform.position, m_SectorDegree); if (m_TargetChoosePriority == TargetChoosePriority.kChooseMostForward) { m_Target = TargetChooser.GetMostForwardObj(transform.position, transform.forward, FiltEnimy(allobj)); } else { m_Target = TargetChooser.GetNearestObj(transform.position, FiltEnimy(allobj)); } } if (m_Target == null) { m_CurTime = m_RepeatTimes; ForceStopSkill(); return(false); } else { m_SkillMovement.SetFacePos(m_Target.transform.position); } if (!base.StartSkill()) { m_CurTime = m_RepeatTimes; return(false); } m_ObjAnimation[m_SkillAnim.name].normalizedTime = 0; m_ObjAnimation[m_SkillAnim.name].speed = m_AnimSpeed; m_ObjAnimation[m_SkillAnim.name].wrapMode = WrapMode.ClampForever; if (m_CrossFadeTime == 0) { m_ObjAnimation.Play(m_SkillAnim.name); } else { m_ObjAnimation[m_SkillAnim.name].weight = m_StartWeight; m_ObjAnimation.CrossFade(m_SkillAnim.name, m_CrossFadeTime); } return(true); }
public void FindMoveTarget(string param_str) { string[] params_list = param_str.Split(' '); if (params_list.Length < 8) { return; } int index = 0; Vector3 center = new Vector3(); center.x = (float)System.Convert.ToDouble(params_list[index++]); center.y = (float)System.Convert.ToDouble(params_list[index++]); center.z = (float)System.Convert.ToDouble(params_list[index++]); float radius = (float)System.Convert.ToDouble(params_list[index++]); float degree = (float)System.Convert.ToDouble(params_list[index++]); bool isChooseClosest = System.Convert.ToBoolean(params_list[index++]); float toTargetDistanceRatio = (float)System.Convert.ToDouble(params_list[index++]); float toTargetConstDistance = (float)System.Convert.ToDouble(params_list[index++]); Vector3 world_center = transform.TransformPoint(center); List <GameObject> allobj = TargetChooser.FindTargetInSector(world_center, radius, transform.forward, world_center, degree); GameObject target = null; if (isChooseClosest) { target = TargetChooser.GetNearestObj(transform.position, FiltEnimy(allobj)); } else { target = TargetChooser.GetMostForwardObj(transform.position, transform.forward, FiltEnimy(allobj)); } SkillScript ss = m_SkillManager.GetCurPlaySkill(); if (ss != null) { ss.MoveTarget = target; ss.ToTargetDistanceRatio = toTargetDistanceRatio; ss.ToTargetConstDistance = toTargetConstDistance; } }