public void CantGather()
 {
     if (PickUpManager.Instance.dropItemListAgent && gatherInfoAgent && gatherInfoAgent.dropItemListAgent && PickUpManager.Instance.dropItemListAgent == gatherInfoAgent.dropItemListAgent)
     {
         PickUpManager.Instance.CantPick();
     }
     gatherInfoAgent = null;
     gatherName.text = string.Empty;
     canGather       = false;
     MyTools.SetActive(gatherName.transform.parent.gameObject, false);
     MyTools.SetActive(gatherButton.gameObject, false);
 }
 public void CanGather(GatherInfoAgent gatherInfoAgent)
 {
     if (PlayerInfoManager.Instance.PlayerInfo.IsFighting)
     {
         return;
     }
     this.gatherInfoAgent = gatherInfoAgent;
     gatherName.text      = gatherInfoAgent.Name;
     canGather            = true;
     MyTools.SetActive(gatherName.transform.parent.gameObject, true);
     MyTools.SetActive(gatherButton.gameObject, true);
 }
 private void Update()
 {
     if (gatherInfoAgent && gatherInfoAgent.dropItemListAgent &&
         gatherInfoAgent.dropItemListAgent.dropItemList != null &&
         gatherInfoAgent.dropItemListAgent.dropItemList.Count < 0)
     {
         gatherInfoAgent = null;
     }
     if (canGather && Input.GetButtonDown("Gather"))
     {
         OnGatherButtonClick();
     }
 }
示例#4
0
 // Use this for initialization
 void Start()
 {
     gatherInfoAgent = GetComponentInParent <GatherInfoAgent>();
     Collider[] colliders = GetComponents <Collider>();
     foreach (Collider collider in colliders)
     {
         if (collider.GetType() != typeof(MeshCollider))
         {
             trigger           = collider;
             trigger.isTrigger = true;
             break;
         }
     }
 }