public override void OnMouseClick(int mouseButton, InputOrder inOrder) { if (inOrder.order.actors.Count != 0 || inOrder.order.subject != null) { inOrder.AddAsObject(this); inOrder.PerformOrder(); inOrder.Clear(); } }
void mouseDrag(int mouseKey) { List <Clickable> beds = new List <Clickable>(); List <Clickable> clickItems = new List <Clickable>(); foreach (Clickable clickables in FindObjectsOfType(typeof(Clickable)) as Clickable[]) { if (withinDrag(Camera.main.WorldToScreenPoint(clickables.transform.position))) { if (clickables as Bed != null) { beds.Add(clickables); } else { clickItems.Add(clickables); } } } if (beds.Count > 0 || clickItems.Count > 0) { if (clickItems.Count == 0) { foreach (Clickable bed in beds) { bed.OnMouseClick(100 + mouseKey, inputOrder); } } else { if (!Input.GetKey(KeyCode.LeftShift)) { inputOrder.Clear(); } foreach (Clickable item in clickItems) { item.OnMouseClick(100 + mouseKey, inputOrder); } } } }