示例#1
0
 private void OnTriggerEnter2D(Collider2D col)
 {
     if (col.tag == "PLAYER")
     {
         ItemSlotManager.GetInstance().AttachItemInSlot(this);
         gameObject.SetActive(false);
     }
 }
示例#2
0
 private void OnTriggerEnter2D(Collider2D col)
 {
     if (col.tag == "PLAYER")
     {
         statManager = col.GetComponent <PlayerStatManager>();
         ItemSlotManager.GetInstance().AttachItemInSlot(this);
         gameObject.SetActive(false);
     }
 }
示例#3
0
文件: Key.cs 项目: CBorange/MimePark
 private void OnTriggerEnter2D(Collider2D col)
 {
     if (col.tag == "PLAYER")
     {
         playerTrans = col.gameObject.transform;
         gameObject.SetActive(false);
         StageDataManager.GetInstance().HaveKey += 1;
         ItemSlotManager.GetInstance().AttachItemInSlot(this);
     }
 }
示例#4
0
 public void UseItemInSlot()
 {
     if (AttachedItem != null)
     {
         if (!AttachedItem.ItemActive())
         {
             return;
         }
         if (AttachedItem.IsConsumable)
         {
             ItemImage.gameObject.SetActive(false);
             AttachedItem = null;
             ItemSlotManager.GetInstance().AttachAbleSlot.Insert(0, SlotIndex);
         }
     }
 }