try to understand the problem with "Can't resolve symbol WithCancellation", ask me for…
- User
try to understand the problem with "Can't resolve symbol WithCancellation", ask me for more data if you need to solve the problem, here is the code: "using Cysharp.Threading.Tasks; using System.Collections.Generic; using System.Threading; using Common.Extensions; using Common.Interfaces; using DG.Tweening; using Match3.App; using UnityEngine;
namespace FillStrategies.Jobs { public class ItemsShowJob : Job { private const float ScaleDuration = 0.5f;
private readonly IEnumerable<IUnityItem> _items; public ItemsShowJob(IEnumerable<IUnityItem> items, int executionOrder = 0) : base(executionOrder) { _items = items; } public override async UniTask ExecuteAsync(CancellationToken cancellationToken = default) { var itemsSequence = DOTween.Sequence(); foreach (var item in _items) { item.SpriteRenderer.SetAlpha(1); item.SetScale(0); item.Show(); _ = itemsSequence.Join(item.Transform.DOScale(Vector3.one, ScaleDuration)); } await itemsSequence.SetEase(Ease.OutBounce).WithCancellation(cancellationToken); } }}"
- Assistant
It seems like you are facing a "Can't resolve symbol WithCancellation" issue in your C# script. This issue might be related to a missing namespace or improper configuration of the required libraries. Since the
WithCancellationmethod is an extension ofUniTask, I'll need to know which version of UniTask library you are using to help you further. Kindly, provide me with the UniTask version or any other library dependencies in your project. - User
i am installing match3 sdk and I am following these steps from https://github.com/ChebanovDD/Match3-SDK: ⚙️ Installation Dependencies:
Match3-SDK: UniTask Unity Match3-SDK: UniTask Unity Match3-Sample: UniTask, DOTween & Match3-SDK You can install Match3-SDK in one of the following ways:
- Install via Package Manager
The package is available on the OpenUPM.
Open Edit/Project Settings/Package Manager
Add a new Scoped Registry (or edit the existing OpenUPM entry)
Name package.openupm.com URL https://package.openupm.com Scope(s) com.cysharp.unitask com.chebanovdd.match3sdk Open Window/Package Manager
Select My Registries
Install UniTask and Match3-SDK packages
- Install via Git URL
You can add https://github.com/ChebanovDD/Match3-SDK.git?path=src/Match3.UnityPackage/Assets/Plugins/Match3 to the Package Manager.
- Assistant
Thank you for providing the information. Based on the installation steps mentioned, I can see that you are using the Cysharp.UniTask library. In the code snippet you provided, you have already imported the Cysharp.Threading.Tasks namespace, which should contain the
WithCancellationextension method.Here are a few suggestions to fix the "Can't resolve symbol WithCancellation" issue:
-
Make sure you have installed the UniTask package correctly. Follow the installation steps mentioned in the GitHub repository. If you installed it via Package Manager, double-check that the UniTask package is listed in the Package Manager, and its scope is properly set in your Project Settings. If you installed it via Git URL, ensure that the package is added to your Unity project.
-
Update UniTask to the latest version. It's possible that an older version of UniTask doesn't provide the
WithCancellationextension method. To update to the latest version, go to Window > Package Manager, find the UniTask package, and click the "Update" button if available.
-