public void OnDrag(PointerEventData eventData) { ScrollCamera.Instance.CanScroll = false; this.transform.position = CursorWorldPosition; switch (_eTypeProduct) { case eProduct.House_1: ButtonPanel.Instance.EditTextDefinition(_eTypeProduct.ToString(), _eSizeProduct.ToString()); break; case eProduct.House_2: ButtonPanel.Instance.EditTextDefinition(_eTypeProduct.ToString(), _eSizeProduct.ToString()); break; case eProduct.House_3: ButtonPanel.Instance.EditTextDefinition(_eTypeProduct.ToString(), _eSizeProduct.ToString()); break; case eProduct.House_4: ButtonPanel.Instance.EditTextDefinition(_eTypeProduct.ToString(), _eSizeProduct.ToString()); break; } Vector3 mousePosition = Camera.main.ScreenToWorldPoint(Input.mousePosition); TileMap.Instance.GetCurrentTile(gameObject.transform.position); gameObject.transform.position = new Vector3(mousePosition.x - deltaMouse.x, mousePosition.y - deltaMouse.y, 0); }
public void OnPointerDown(PointerEventData eventData) { switch (eTypeProduct) { case eProduct.House_1: ViewShopWindow.Instance.CloseShoopWindow(); TileMapManager.Instance.BuyObjectInShop(eTypeProduct.ToString()); break; case eProduct.House_2: ViewShopWindow.Instance.CloseShoopWindow(); TileMapManager.Instance.BuyObjectInShop(eTypeProduct.ToString()); break; case eProduct.House_3: ViewShopWindow.Instance.CloseShoopWindow(); TileMapManager.Instance.BuyObjectInShop(eTypeProduct.ToString()); break; case eProduct.House_4: ViewShopWindow.Instance.CloseShoopWindow(); TileMapManager.Instance.BuyObjectInShop(eTypeProduct.ToString()); break; } }