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);
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Perform movement of "wheel" of letters to find, and change the position to a "next one".
        /// </summary>
        /// <param name="_dropArea"></param>
        /// <param name="_position"></param>
        /// <param name="_callback"></param>
        void positionigAreaDropElement(DropSingleArea _dropArea, DropAreaPositions _position, TweenCallback _callback = null)
        {
            float    durantion = 0.4f;
            Sequence _sequence = DOTween.Sequence();
            bool     needFade  = false;

            if (_position == DropAreaPositions.CompletedPos)
            {
                needFade = true;
            }

            // - Actual elimination
            _dropArea.transform.DOLocalRotate(getRotation(_position), durantion);
            _sequence.Append(_dropArea.transform.DOLocalMove(getPosition(_position), durantion)).OnComplete(delegate()
            {
                if (needFade)
                {
                    _sequence.Append(_dropArea.GetComponent <MeshRenderer>().materials[0].DOFade(0, durantion));
                    _sequence.Append(_dropArea.LetterLable.transform.DOLocalMove(new Vector3(getPosition(_position).x, -2, getPosition(_position).z), durantion));
                    // pro only
                    // sequence.Append(Aree[actualAreaIndex].LetterLable.DOFade(0, 0.4f));
                    //if (_dropArea.DrawSprite)
                    //    _dropArea.DrawSprite.DOFade(0, 0.4f);
                    if (_dropArea.DrawText)
                    {
                        _dropArea.DrawText.DOFade(0, 0.4f);
                    }
                }
                if (_callback != null)
                {
                    _callback();
                }
            });
        }
Exemplo n.º 3
0
        void OnTriggerEnter(Collider other)
        {
            DropSingleArea da = other.GetComponent <DropSingleArea>();

            if (da)
            {
                dropAreaActive = da;
            }
        }
Exemplo n.º 4
0
        void OnTriggerExit(Collider other)
        {
            DropSingleArea da = other.GetComponent <DropSingleArea>();

            if (da && da == dropAreaActive)
            {
                dropAreaActive.DeactivateMatching();
                dropAreaActive = null;
            }
        }
        void OnTriggerExit(Collider other)
        {
            DropSingleArea dropArea = other.GetComponent <DropSingleArea>();

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

                currentDropAreaWidget = null;
                currentDropArea       = null;
            }
        }
Exemplo n.º 6
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;
        }
        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;
                }
            }
        }
Exemplo n.º 8
0
 public void AddArea(DropSingleArea area)
 {
     areas.Add(area);
     dropAreaSetPosition();
 }