public Order(Vector3 b)//Move { thing = GameObject.Instantiate(GameMaster.singleton.orderThingPrefab).GetComponent <OrderThing>(); thing.transform.position = b; type = OrderType.Move; positionTarget = b; }
public void DoSelectStuffWithUnits(List <Unit> list) { OrderThing.HideAll(); if (Input.GetKey(KeyCode.LeftShift)) { foreach (var unit in list) { if (unit.isSelected) { if (list.Count == 1) { selectedUnits.Remove(unit); unit.metkaOfThis.enabled = false; unit.isSelected = false; } } else { selectedUnits.Add(unit); unit.metkaOfThis.enabled = true; unit.isSelected = true; } } } else { foreach (var unit in selectedUnits) { unit.metkaOfThis.enabled = false; unit.isSelected = false; } selectedUnits.Clear(); foreach (var unit in list) { selectedUnits.Add(unit); unit.metkaOfThis.enabled = true; unit.isSelected = true; } } RedoRepresentative(); foreach (var p in selectedUnits) { if (p.currentOrder != null && p.currentOrder.thing != null) { p.currentOrder.thing.mr.enabled = true; } foreach (var ord in p.subscribedOrders) { if (ord != null && ord.thing != null) { ord.thing.mr.enabled = true; } } } }