void AddOrSet(UnitAI uai, Command c) { if (Input.GetKey(KeyCode.LeftShift)) { uai.AddCommand(c); } else { uai.SetCommand(c); } }
public void CreateIntercept(Entity source, Entity target, bool isAdd) { Intercept intercept = new Intercept(source, target); UnitAI uai = source.GetComponent <UnitAI>(); if (isAdd) { uai.AddCommand(intercept); } else { uai.SetCommand(intercept); } }
void HandleMove(Vector3 point) { Move m = new Move(SelectionMgr.inst.selectedEntity, hit.point); UnitAI uai = SelectionMgr.inst.selectedEntity.GetComponent <UnitAI>(); //AddOrSet(uai, m); if (Input.GetKey(KeyCode.LeftShift)) { uai.AddCommand(m); } else { uai.SetCommand(m); } }