Exemplo n.º 1
0
 public void endDragModual(Object caller)
 {
     ((GameObject)caller).transform.SetParent(modualParrent);
     if (towerModual != null)
     {
         towerModual.SetModual(caller);
         towerModual.MouseHoverExit();
         towerModual = null;
     }
 }
Exemplo n.º 2
0
    public void draggingModual(Object caller)
    {
        ((GameObject)caller).transform.position = Input.mousePosition;
        RaycastHit hit;
        Ray        ray = Camera.main.ScreenPointToRay(Input.mousePosition);

        if (Physics.Raycast(ray, out hit, 1 << 12))
        {
            Transform objectHit = hit.transform;

            if (towerModual != null)
            {
                towerModual.MouseHoverExit();
            }

            towerModual = hit.transform.gameObject.GetComponent <ITowerModual>();
            if (towerModual != null)
            {
                towerModual.MouseHoverEnter();
            }
        }
    }