示例#1
0
        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;
        }
示例#2
0
    void OnTriggerExit(Collider other)
    {
        DropSingleArea dropArea = other.GetComponent <DropSingleArea>();

        if (dropArea && (dropArea == currentDropArea))
        {
            currentDropAreaWidget.SetMatchingOutline(false, false);

            currentDropAreaWidget = null;
            currentDropArea       = null;
        }
    }
示例#3
0
    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;
            }
        }
    }
示例#4
0
    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);
            }
        }
    }