public void TakeItem(CarryItem item) { if (item.item_type == "Employee") { if (character.GetComponent <CharacterPlayer>()) { // Debug.Log(character.gameObject); ((CharacterPlayer)character).EmployeeAdd(item.gameObject.transform.position); item.Destroy(); } return; } if (item == held_item || take_item_timer < 0f) { return; } if (held_item != null) { DropItem(); } held_item = item; take_item_timer = -0.2f; item.Take(this); }
public void TakeItem(CarryItem item) { if (item == held_item || take_item_timer < 0f) { return; } if (held_item != null) { DropItem(); } held_item = item; take_item_timer = -0.2f; item.Take(this); }
public void TakeItem(CarryItem item) { if (take_item_timer < 0f) { return; } if (item.CanTake(gameObject)) { if (!item.HasBearer()) { //Drop current and take new item DropItem(); carry_item = item; item.Take(this); take_item_timer = -0.2f; } } }