protected IEnumerator Build(Vector3Int i_pos) { if ((inventory.Get_Item_Quantity() >= 1) && (vision.Is_Pos_Seen(i_pos)) && (memory.Check_Pos(i_pos) == 0)) { Block_Interactable temp_block = vision.Grab_Seen_Interactable(i_pos); while (!vision.Is_Pos_Seen(i_pos)) { Look_At_Point(i_pos); yield return(null); } } else { does_wall_build = false; next_state = Check_Priorities(); yield break; } Build_Wall(i_pos); does_wall_build = false; next_state = Check_Priorities(); yield return(null); }
// Update is called once per frame void Update() { if (inventory.Get_Item_Quantity() <= 0) { switch (depletion_action) { case ACTION.REGEN: { Regen_Action(); break; } case ACTION.DESTROY: { Destroy_Action(); break; } default: { Debug.LogWarning("Invalid depletion action detected! This is not supposed to happen!"); break; } } } }
public bool Take_Item(string i_type, int i_quantity) { if (target.Get_Item_Quantity() >= i_quantity) { if ((i_type == item_type) && (target.Get_Type() == i_type)) { item_quantity += i_quantity; target.item_quantity -= i_quantity; return(true); } } return(false); }