public void endDragModual(Object caller) { ((GameObject)caller).transform.SetParent(modualParrent); if (towerModual != null) { towerModual.SetModual(caller); towerModual.MouseHoverExit(); towerModual = null; } }
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(); } } }