Пример #1
0
        void DoNextCooridinateInTween()
        {
            if (mNextCoordinates.Count == 0)
            {
                return;
            }

            if (mMoveAnim != null && mMoveAnim.IsActive() && mMoveAnim.IsPlaying())
            {
                return;
            }

            var unit     = mNextCoordinates.Dequeue();
            var position = GameUtility.CoordinateToPosition(unit.Coordinate);

            mMoveAnim = DOTween.Sequence()
                        .Append(transform.DOMove(position, 0.5f))
                        .Join(transform.DOPunchScale(new Vector3(1.2f, 1.2f), 0.5f, 1))
                        .OnStart(() => m_Icon.sortingOrder = 999)
                        .OnComplete(() =>
            {
                m_Icon.sortingOrder = 1;
                unit.OnComplete?.Invoke();
                DoNextCooridinateInTween();
            })
                        .Play();
        }
 void DoSetCoordinate(Coordinate coordinate)
 {
     transform.position = GameUtility.CoordinateToPosition(coordinate);
 }