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