コード例 #1
0
 public override void PutItemIn(ItemBase iInputItem, CharacterItemController iCharacterItemController)
 {
     if (iInputItem.whatItemAmI == requestedItem && !pIsCoroutineRunning)
     {
         StartTimeTillhandout();
         iCharacterItemController.RemoveItem();
         Destroy(iInputItem.gameObject);
     }
     else
     {
         iCharacterItemController.DropItem();
     }
 }
コード例 #2
0
 public override void Interact(CharacterItemController iItemController)
 {
     base.Interact(iItemController);
     if (iItemController.amIHoldingAnItem && _handoutReadyIcon.activeSelf)
     {
         iItemController.DropItem();
     }
     else if (!iItemController.amIHoldingAnItem && _handoutReadyIcon.activeSelf)
     {
         GameObject tObjectToHAndout = CollectHandout();
         tObjectToHAndout.GetComponentInChildren <Rigidbody>().constraints = RigidbodyConstraints.FreezeAll;
         ItemBase tItembase = tObjectToHAndout.GetComponentInChildren <ItemBase>();
         iItemController.PickItemUp(tItembase);
     }
     else if (iItemController.amIHoldingAnItem && !_handoutReadyIcon.activeSelf && !pIsCoroutineRunning)
     {
         PutItemIn(iItemController.itemIAmHolding, iItemController);
     }
     else
     {
         iItemController.DropItem();
     }
 }