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) { bool matching = GetComponent <LivingLetterController>().Data == currentData; if (onDropped != null) { onDropped(matching); } } }
public void DropOnArea(DropAreaWidget area) { var currentData = area.GetActiveData(); if (currentData != null) { //bool matching = GetComponent<LetterObjectView>().Model.Data.Key == currentData.Key; bool matching = GetComponent <LetterObjectView>().Data == currentData; 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; } } }
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; //bool matching = dropArea.GetActiveData().Key == GetComponent<LetterObjectView>().Model.Data.Key; bool matching = dropArea.GetActiveData().Equals(GetComponent <LetterObjectView>().Data); dropArea.SetMatchingOutline(true, matching); } } }