Exemple #1
0
 private void GatherStart()
 {
     ProgressBar.Instance.New(GatherAgent.GatheringInfo.GatherTime, GatherDone, GatherCancel, "采集中");
     IsGathering = true;
     UIManager.Instance.EnableInteract(false);
     doneAgent = null;
 }
Exemple #2
0
 private void GatherDone()
 {
     PlayerManager.Instance.PlayerController.Animator.SetInteger(animaNameHash, -1);
     GatherAgent.GatherSuccess();
     IsGathering = false;
     doneAgent   = GatherAgent;
     StartCoroutine(UpdateDistance());
 }
Exemple #3
0
 public void CanGather(GatherAgent gatherAgent)
 {
     if (!gatherAgent || doneAgent)
     {
         return;
     }
     GatherAgent = gatherAgent;
     GatherAble  = true;
     UIManager.Instance.EnableInteract(true, gatherAgent.GatheringInfo.name);
 }
Exemple #4
0
 private IEnumerator UpdateDistance()
 {
     while (doneAgent)
     {
         if (Vector3.Distance(PlayerManager.Instance.PlayerTransform.position, doneAgent.transform.position) >= lootInvaildDistance)
         {
             doneAgent = null;
             yield break;
         }
         yield return(null);
     }
 }