public void OnPointerUp(PointerEventData pointerEventData) { if (dragging != null && pointerEventData.button == 0) { dragging.StopDragging(); dragging = null; } }
void OnCountChange() { if (waiting == null && count > 0) { GameObject created = GameObject.Instantiate(deployedMercPrefab, transform); waiting = created.GetComponent <DeployedMerc>(); waiting.behaviour = behaviour.Copy(); waiting.parent = this; } else if (waiting != null && count <= 0) { Destroy(waiting.gameObject); waiting = null; } }