private void OnTriggerExit2D(Collider2D col) { CellObject temp = col.gameObject.GetComponentInChildren <CellObject>(); if (temp != null && temp.DropAtType == panelType) { temp.DropAtType = temp.cellObjectType; } }
void OnTriggerEnter2D(Collider2D col) { CellObject temp = col.gameObject.GetComponentInChildren <CellObject>(); if (temp != null) { temp.DropAtType = panelType; } }
private void InstantiateCellObject(GameObject cellPrefabs, Transform grid, ObjectContainedInventory item, EquipWeaponAt equipWeaponAt = EquipWeaponAt.Primary) { GameObject gameCellObject = Instantiate(cellPrefabs); gameCellObject.transform.SetParent(grid, false); CellObject cellObject = gameCellObject.GetComponentInChildren <CellObject>(); cellObject.Inventory = inventory; cellObject.Control = this; cellObject.InstantiateCellObjectFromCell(item); if (cellPrefabs == cellEquippedWeaponPrefabs) { cellObject.EquipAt = equipWeaponAt; } }