private void LockObject(RoomObject obj, Item item) { switch (item.objectType) { case ObjectType.Key: Key key = item.GetComponent <Key>(); obj.SetUpObject(true, key); break; case ObjectType.Note: Note note = item.GetComponent <Note>(); obj.SetUpObject(true, note); break; case ObjectType.Other: obj.SetUpObject(true, item.objectType); break; } }