예제 #1
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();
                }
            });
        }
예제 #2
0
        void OnTriggerEnter(Collider other)
        {
            DropSingleArea da = other.GetComponent <DropSingleArea>();

            if (da)
            {
                dropAreaActive = da;
            }
        }
예제 #3
0
        void OnTriggerExit(Collider other)
        {
            DropSingleArea da = other.GetComponent <DropSingleArea>();

            if (da && da == dropAreaActive)
            {
                dropAreaActive.DeactivateMatching();
                dropAreaActive = null;
            }
        }
예제 #4
0
 public void AddArea(DropSingleArea area)
 {
     areas.Add(area);
     dropAreaSetPosition();
 }