Ejemplo n.º 1
0
    private bool isUnstoppable        = false;//冲刺时是否有伤害
    public void SetTargetPosition(Vector2 position)
    {
        Vector2 temp = player.transform.position;

        targetPosition = position - temp;
        if (targetPosition.magnitude > windThunderDistance)//冲刺最长距离为7
        {
            targetPosition.Normalize();
            targetPosition *= windThunderDistance;
        }

        movement.SetGravity(false);

        if (movement.IsFacingLeft())
        {
            targetPosition.x = -targetPosition.x;
        }
        //isUnstoppable = true;
    }