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); }
public void OnEndMoveComplete(CIcon icon) { if (IsFinished()) { return; } icon.SetState(EState.Idle); moving.Remove(icon); if (IsFinished() && listener != null) { listener.OnMoveEnd(); } }
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); } }