void OnTriggerEnter(Collider other) { if (letter.GetCurrentState() == letter.HangingState) { DropSingleArea singleArea = other.GetComponent <DropSingleArea>(); if (singleArea) { var dropArea = singleArea.transform.parent.GetComponent <DropAreaWidget>(); // dirty hack if (dropArea == null) { return; } currentDropAreaWidget = dropArea; currentDropArea = singleArea; var activeData = dropArea.GetActiveData(); var draggedData = GetComponent <LivingLetterController>().Data; bool matching = FastCrowdConfiguration.Instance.IsDataMatching(activeData, draggedData); dropArea.SetMatchingOutline(true, matching); } } }
void OnTriggerExit(Collider other) { DropSingleArea dropArea = other.GetComponent <DropSingleArea>(); if (dropArea && (dropArea == currentDropArea)) { currentDropAreaWidget.SetMatchingOutline(false, false); currentDropAreaWidget = null; currentDropArea = null; } }
public void DropOnArea(DropAreaWidget area) { var currentData = area.GetActiveData(); if (currentData != null) { var myData = GetComponent <LivingLetterController>().Data; bool matching = FastCrowdConfiguration.Instance.IsDataMatching(currentData, myData); if (onDropped != null) { onDropped(matching); } } }
void Update() { rayOffset.x = Mathf.Lerp(rayOffset.x, 0, Time.deltaTime); rayOffset.z = Mathf.Lerp(rayOffset.z, 0, Time.deltaTime); if (isDragging) { OnDrag(); } else { if (currentDropAreaWidget != null) { currentDropAreaWidget.SetMatchingOutline(false, false); currentDropAreaWidget = null; currentDropArea = null; } } }