Rotate and Drag Problem

I am moving my object with onDrag, but there is a situation like this: I do not want to execute a drag if the sprites are rotated, but if the sprites are not rotated, I want drag to be executed. The Unity 2d code is shown below.

if( !drag )
{
	if( rota<13 )
	{
		rota = rota + 0.5f;
		//rectTransform.anchoredPosition += eventData.delta;
		mPosDelta = eventData.delta - mprevpos;
		transform.Rotate( 0 , 0 , rota , Space.Self );
	}
	else
	{
		this.transform.rotation = Quaternion.Euler( 0 , 0 , 180 );
		Invoke( nameof(Wait) , 3f );
	}
}
else
{
	rectTransform.anchoredPosition += eventData.delta;
}

Don’t you know the answer?