Пример #1
0
    public override void PutItemIn(ItemBase iItemType, CharacterItemController iPlayerInfo)
    {
        base.PutItemIn(iItemType, iPlayerInfo);
        if (itemOne == null)
        {
            itemOne = iItemType;
            itemOne.transform.parent   = this.transform;
            itemOne.transform.position = itemOnAnilPosition.transform.position;
            itemOne.GetComponent <Rigidbody>().constraints = RigidbodyConstraints.FreezeAll;
            iPlayerInfo.RemoveItem();
        }
        else if (itemOne.WhatItemTierAmI == ItemTiers.TIER2 && iItemType.WhatItemTierAmI == ItemTiers.TIER2)
        {
            Recipe tRecipeToMake = RecipeHolder.Instance.ReturnRecipeFromItem(itemOne, iItemType);
            if (tRecipeToMake != null)
            {
                _isSomeoneInteracting = true;
                CreateRecipe(tRecipeToMake);
                iPlayerInfo.RemoveItem();
                Destroy(itemOne.gameObject);
                Destroy(iItemType.gameObject);
                ClearAnvilItem();
                ItemBase tItemBase = CollectHandout().GetComponentInChildren <ItemBase>();
#if UNITY_EDITOR
                Debug.Log(tItemBase);
#endif
                iPlayerInfo.PickItemUp(tItemBase);
            }
        }
    }
Пример #2
0
 public void Interact(CharacterItemController iCharacterController)
 {
     if (!iCharacterController.amIHoldingAnItem)
     {
         iCharacterController.PickItemUp(Instantiate(itemToSpawn).GetComponentInChildren <ItemBase>());
     }
 }
Пример #3
0
 public override void PutItemIn(ItemBase iItemType, CharacterItemController iPlayerInfo)
 {
     base.PutItemIn(iItemType, iPlayerInfo);
     if (iItemType.whatItemAmI == requestedItem)
     {
         Destroy(iItemType.gameObject);
         iPlayerInfo.RemoveItem();
         GameObject tItem = CollectHandout();
         iPlayerInfo.PickItemUp(tItem.GetComponentInChildren <ItemBase>());
     }
 }
Пример #4
0
 public override void Interact(CharacterItemController iItemController)
 {
     if (_isSomeoneInteracting)
     {
         return;
     }
     base.Interact(iItemController);
     if (iItemController.amIHoldingAnItem)
     {
         PutItemIn(iItemController.itemIAmHolding, iItemController);
     }
     else if (itemOne != null)
     {
         iItemController.PickItemUp(itemOne);
         ClearAnvilItem();
     }
 }
Пример #5
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();
     }
 }
Пример #6
0
 public void Interact(CharacterItemController iItemController)
 {
     iItemController.PickItemUp(this);
 }