Пример #1
0
    async public UniTask <int> MoveToWtihNavInfo(Vector2Int destination)
    {
        Vector2Int[] path = navInfo.GetPath(destination);
        moveComponent.RequestMove(path);
        await MyUniTaskExtensions.WaitUntilEvent(moveComponent.eFinishPath);

        return(path.Length);
    }
Пример #2
0
 /// <summary>
 /// 不通过寻路径直走向终点
 /// </summary>
 /// <param name="destination">终点</param>
 async public UniTask MoveToDirectly(Vector2Int destination)
 {
     Debug.Log("MoveToDirectly " + destination);
     moveComponent.RequestDirectMove(destination);
     location = destination;
     moveComponent.eFinishPath.AddListenerForOnce(EnterLocation);
     await MyUniTaskExtensions.WaitUntilEvent(moveComponent.eFinishPath);
 }
Пример #3
0
 async public UniTask ThrowToAsync(Vector2Int destination)
 {
     eBeForceMove.Invoke();
     Debug.Log("ThrowTo" + destination);
     moveComponent.RequestJumpMove(destination);
     location = destination;
     moveComponent.eFinishPath.AddListenerForOnce(EnterLocation);
     await MyUniTaskExtensions.WaitUntilEvent(moveComponent.eFinishPath);
 }
Пример #4
0
    public async UniTask <PlayerSkill> GetSkillAsync(List <PlayerSkill> candidateSkills)
    {
        UIManager.instance.skillDisplayView.gameObject.SetActive(true);
        UIManager.instance.skillDisplayView.SwitchSkillButton(candidateSkills);
        PlayerSkill result = await MyUniTaskExtensions.WaitUntilEvent(UIManager.instance.skillDisplayView.eClickSkill);

        UIManager.instance.skillDisplayView.CleanSkillButton();
        UIManager.instance.skillDisplayView.gameObject.SetActive(false);
        return(result);
    }
Пример #5
0
    public async UniTask <T> GetNextClickChessAsync <T>() where T : GChess
    {
        GActor temp;

        do
        {
            temp = await MyUniTaskExtensions.WaitUntilEvent(eSelectMessage) as T;
        } while (temp != null && !(temp is T));
        return(temp as T);
    }
Пример #6
0
 public async UniTask CreateProjectileParticle()
 {
     if (prefabProjectileParticle)
     {
         GameObject    go = Instantiate(prefabProjectileParticle);
         VFXController t  = go.AddComponent <VFXController>();
         t.observer = vfXObserver;
         if (instant)
         {
             t.InitInstantProjectile(origin, destination);
         }
         else
         {
             var p = MyUniTaskExtensions.WaitUntilEvent(t.eHit);
             t.InitProjectile(origin, destination, speed);
             await p;
         }
     }
 }