Touch in Phase ended

Hi there
I have a sprite on screen . i use two separate code for TouchPhase.Began and TouchPhase.Ended . i like to run code when i touch up on sprite ( in TouchPhase.Ended ) but when i touching other position on screen and move my finger on sprite and then up my code get run .

if (Input.touchCount == 1)
		{
			
			Vector3 wp = Camera.main.ScreenToWorldPoint(Input.GetTouch(0).position);
			Vector2 touchPos = new Vector2(wp.x, wp.y);

			Vector2 touchp = touchPos ; 

			if (Input.GetTouch (0).phase == TouchPhase.Began) {
				touchp = Input.GetTouch (0).position;  

			}


			if (coll2D == Physics2D.OverlapPoint (touchPos)  ) {

				if (Input.GetTouch (0).phase == TouchPhase.Began) {
					SpRenderer.color = new Color (1f, 1f, 1f, 0.7f);
				}

				if (Input.GetTouch (0).phase == TouchPhase.Ended && coll2D == Physics2D.OverlapPoint (touchp)) {
					
					if (transform.position.y == StartPosition)
						CanMoveUp = true; 
					if (transform.position.y == TargetPosition)
						CanMoveDown = true; 

					SpRenderer.color = new Color (1f, 1f, 1f, 1f);
				}

			} else if (coll2D != Physics2D.OverlapPoint (touchPos)) {
				SpRenderer.color = new Color (1f, 1f, 1f, 1f);
			}
		}

please help me . i need that