Hello Guest

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - VeTaLkO

Pages: [1]
1
Support / Re: tk2dExternal does not exist
« on: July 24, 2015, 10:10:01 am »
Hi, i have the same issue.

// Is tk2dEditor.dll in version control?
Should it be? I cant find it in solution itself.
Also, if to open asset store page and check package content from there (just in case i had removed it accidentally), there are only 2 dlls: tk2dExternal and tk2dSkin

2
Support / Re: Draggable sprite/button?
« on: August 11, 2014, 10:33:38 pm »
As this thread is quite high in google (and it has 1.7K views), i decided to add my answer here.

So, just in case someone will found it useful, final code is

Code: [Select]
void Update ()
{
CheckButtonInput();

if (selectedObject != null)
{
newPosition = mainCamera.ScreenToWorldPoint(Input.mousePosition);
newPosition.z = 0;
selectedObject.transform.position = newPosition - selectedDelta;
}
}


void CheckButtonInput()
{
if (Input.GetMouseButtonDown(0))
{
Ray ray = mainCamera.ScreenPointToRay (Input.mousePosition);
RaycastHit hit;
if (Physics.Raycast(ray, out hit, 1000))
{
if (hit.collider.tag == "Card")
{
Debug.Log("Found a Card at " + hit.point);
selectedObject = hit.collider.gameObject;
selectedDelta = hit.point - hit.collider.transform.position;
}
else
{
Debug.Log("Found something " + hit.collider.tag);
selectedObject = null;
}
}
else
{
Debug.Log("Found nothing");
}
}

if (Input.GetMouseButtonUp(0))
{
Debug.Log("Releasing");
selectedObject = null;
}
}

Pages: [1]