Hello, i have an drag drop item and a texture below.
I want the texture to be something like a border box for the drop item.
Whenever after dragging the item is released outside the texture it should be placed back to the place before dragging.
If it is released inside the texture, it should stay there.
I could'nt managed to get this working. My Texture has an bool which tells if the mousebutton is released on it
public class TextureScript : MonoBehaviour
{
public bool IsMouseOver = false;
// Use this for initialization
private void OnHover(bool isOver)
{
switch (isOver)
{
case true:
IsMouseOver = true;
Debug.Log("MouseIsOver");
break;
case false:
IsMouseOver = false;
break;
}
}
}
The drag item has some code where it creates a child.
void OnDragStart()
{
Debug.Log("Drop");
ButtonTemp = NGUITools.AddChild(gameObject.transform.parent.gameObject, gameObject);
NGUITools.SetActive(ButtonTemp, true);
}
How to notify the Item about the bool IsMousOver from the Texture ?
Or is there a better way ?
Thx in advance