/// <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(); } }); }
void OnTriggerEnter(Collider other) { DropSingleArea da = other.GetComponent <DropSingleArea>(); if (da) { dropAreaActive = da; } }
void OnTriggerExit(Collider other) { DropSingleArea da = other.GetComponent <DropSingleArea>(); if (da && da == dropAreaActive) { dropAreaActive.DeactivateMatching(); dropAreaActive = null; } }
public void AddArea(DropSingleArea area) { areas.Add(area); dropAreaSetPosition(); }