public void AddDropText(ILivingLetterData newElement, string text) { DropSingleArea dropSingleArea = Instantiate(dropAreaPrefab); dropSingleArea.transform.SetParent(transform, false); dropSingleArea.transform.position = Camera.main.transform.position; dropSingleArea.Init(newElement, text, container); container.AddArea(dropSingleArea); letters[newElement] = dropSingleArea; }
void OnTriggerExit(Collider other) { DropSingleArea dropArea = other.GetComponent <DropSingleArea>(); if (dropArea && (dropArea == currentDropArea)) { currentDropAreaWidget.SetMatchingOutline(false, false); currentDropAreaWidget = null; currentDropArea = null; } }
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); } } }