예제 #1
0
        protected void StartDying()
        {
            CAnimations
            .Spark(icon.transform.position)
            .SetColor(icon.color)
            .SetListener(this);

            CAnimations
            .Transform(icon.transform.position)
            .SetColor(icon.color)
            .SetListener(this);

            icon.SetState(EState.Hidden);
        }
예제 #2
0
        public void OnEndMoveComplete(CIcon icon)
        {
            if (IsFinished())
            {
                return;
            }

            icon.SetState(EState.Idle);
            moving.Remove(icon);

            if (IsFinished() && listener != null)
            {
                listener.OnMoveEnd();
            }
        }
예제 #3
0
        public bool AddMove(CIcon icon, Vector3 pos)
        {
            if (icon.transform.position == pos)
            {
                return(false);
            }
            else
            {
                moving.Add(icon);

                icon.SetState(EState.Movement);
                icon.gameObject.transform
                .DOMove(pos, CGame.Config.match.gems.movingTime)
                .OnComplete(() => OnEndMoveComplete(icon));

                return(true);
            }
        }