void VehicleExecute(UnitTask.TaskType t, SelectionData SD) { if (!SD.IsVehicle()) { return; } bool ShouldSet = !QueueModDown; AddTaskToVehicle(t, SD._Vehicle, _hit.point, _hit.collider.gameObject, ShouldSet); }
void SelectObject(GameObject GO, SelectObjectFilter Filter = SelectObjectFilter.All, bool final = false) { SelectionData SD = new SelectionData(); SD._Object = GO.GetComponent <SelectableObject>(); if (!SD.IsValid()) { SD._Object = GO.GetComponentInParent <SelectableObject>(); if (!SD.IsValid()) { return; } } SD._Worker = GO.GetComponent <Worker>(); SD._Vehicle = GO.GetComponent <Vehicle>(); if (Filter == SelectObjectFilter.Workers) { if (!SD.IsWorker() && !SD.IsVehicle()) { return; } } SD._Building = GO.GetComponentInParent <Building>(); SD._Rock = GO.GetComponentInParent <RockScript>(); if (SD.ShouldBeCulled()) { if (!CPU_FOW.Get().MultiSampleFOW(GO.transform.position, MSSampleDistance)) { return; } } SD._Object.SetSelectionState(true); if (final && SD.IsWorker() && ShouldPlaySound()) { SD._Worker.PlaySelectionSound(); } if (final && SD.IsVehicle() && ShouldPlaySound()) { SD._Vehicle.PlaySelectionSound(); } CurrentSelectionObjects.Add(SD); }
void ExecuteOrder(UnitTask.TaskType t, SelectionData SD) { if (SD.IsWorker()) { WorkerExecute(t, SD); } else if (SD.IsVehicle()) { VehicleExecute(t, SD); } }