public void PlaceObject(GameObject go, ObjectSpawnZone targetZone) { MovableObject candidate = go.GetComponentInChildren <MovableObject>(); if (candidate != null) { PlaceObject(candidate, targetZone); return; } switch (targetZone) { case ObjectSpawnZone.Desk: PlaceObjectOnDesk(go); break; case ObjectSpawnZone.DrawerTop: case ObjectSpawnZone.DrawerBottom: case ObjectSpawnZone.Outbox: PlaceObjectInCenter(go); break; case ObjectSpawnZone.OutOfBounds: PlaceObjectOutOfBounds(go); break; default: break; } }
public void PlaceObject(MovableObject obj, ObjectSpawnZone targetZone) { switch (targetZone) { case ObjectSpawnZone.Desk: PlaceObjectOnDesk(obj); break; case ObjectSpawnZone.OutOfBounds: PlaceObjectOutOfBounds(obj.gameObject); break; case ObjectSpawnZone.DrawerTop: StartCoroutine(PlaceObjectInDrawer(obj, DrawerTray.top)); break; case ObjectSpawnZone.DrawerBottom: StartCoroutine(PlaceObjectInDrawer(obj, DrawerTray.bottom)); break; case ObjectSpawnZone.Outbox: StartCoroutine(PlaceObjectInOutbox(obj)); break; default: break; } }