// Update is called once per frame void Update() { if (!isClickable || Game6Controller.GetInstance().IsPause()) { return; } bool TouchDown = TouchInterface.GetTouchDown(); bool TouchUp = TouchInterface.GetTouchUp(); Vector2 pos = TouchInterface.GetTouchPosition(); var isHit = GetComponent <Collider2D>().OverlapPoint(pos); if (TouchDown && isHit) { Game6Controller.GetInstance().StartDrag(this); } }
// Update is called once per frame void Update() { bool TouchDown = TouchInterface.GetTouchDown(); bool TouchUp = TouchInterface.GetTouchUp(); Vector2 pos = TouchInterface.GetTouchPosition(); var isHit = GetComponent <Collider2D>().OverlapPoint(pos); if (isHit) { isSelected = true; Game6Controller.GetInstance().SetSelectTile(this); } else if (isSelected) { isSelected = false; Game6Controller.GetInstance().DeselectTile(this); } }