Пример #1
0
    void Remove_completed_chassis()
    {
        foreach (VehiclePart_CHASSIS _CHASSIS in REG_viableChassis)
        {
            if (_CHASSIS.vehicleIsComplete)
            {
                int indexOfCompletedChassis = REG.storageLines[0].slots.IndexOf(_CHASSIS);
                REG.Clear_slot(0, indexOfCompletedChassis);
                Factory.INSTANCE.VehicleComplete(_CHASSIS);
                completedVehicles++;

                _CHASSIS.transform.position = transform.position + new Vector3(completedVehicles % 10, 0f, -1 - Mathf.FloorToInt(completedVehicles / 10));
            }
        }
    }
Пример #2
0
 void Attach_parts()
 {
     for (int _slotIndex = 0; _slotIndex < REG.lineLength; _slotIndex++)
     {
         var _PART = REG.storageLines[0].slots[_slotIndex];
         if (REG_viableParts.Contains(_PART))
         {
             for (int _chassisIndex = 0; _chassisIndex < REG_viableChassis.Count; _chassisIndex++)
             {
                 if (REG_viableChassis[_chassisIndex].AttachPart(_PART.partConfig, _PART.gameObject))
                 {
                     _PART.ClearDestination();
                     REG_viableParts.Remove(_PART);
                     Factory.INSTANCE.PartAttached(_PART.partConfig, this);
                     REG.Clear_slot(0, _slotIndex);
                     break;
                 }
             }
         }
     }
 }