Ejemplo n.º 1
0
    public void Skill_Q_2_Update()
    {
        var skillTargetUnit = controlUnit.skillDict[SkillType.Q].GetSkillTarget();

        if (Vector3.Distance(controlUnit.GetPosNoY(), skillTargetUnit.GetPosNoY()) <= 0.1f)
        {
            (skillTargetUnit as HeroUnit).RemoveStatus(StatusType.Q);
            controlUnit.skillDict[SkillType.Q].SetSkillTarget(null);
            (controlUnit as HeroUnit).PlayAnim(AnimParamType.Trigger, "Q_2_End");
            return;
        }
        controlUnit.SetForward((skillTargetUnit.GetPosNoY() - controlUnit.GetPosNoY()).normalized);
        controlUnit.SetPos(Vector3.MoveTowards(controlUnit.GetPosNoY(), skillTargetUnit.GetPosNoY(), Time.deltaTime * 10));
    }