Exemplo n.º 1
0
        public string GetValidName(VehicleComponentType type)
        {
            string name = type.ToString() + " ";

            switch (type)
            {
            case VehicleComponentType.Body:
            {
                name += (Bodies.Count + 1).ToString();
            }
            break;

            case VehicleComponentType.Spring:
            {
                name += (Springs.Count + 1).ToString();
            }
            break;

            case VehicleComponentType.Damper:
            {
                name += (Dampers.Count + 1).ToString();
            }
            break;

            default:
                break;
            }

            return(name);
        }
Exemplo n.º 2
0
 public VehicleComponentSeed(VehicleComponentSeed other)
 {
     this.id            = other.id;
     this.localPosition = other.localPosition;
     this.localRotation = other.localRotation;
     this.type          = other.type;
 }
Exemplo n.º 3
0
    private VehicleComponent AddChild(VehicleComponentType type, uint id)
    {
        switch (type)
        {
        case VehicleComponentType.CoreBlock: return(AddChild(Prefabs.CoreBlock, id));

        case VehicleComponentType.AttachableBlock: return(AddChild(Prefabs.AttachableBlock, id));

        case VehicleComponentType.Wheel: return(AddChild(Prefabs.Wheel, id));

        case VehicleComponentType.Booster: return(AddChild(Prefabs.Booster, id));

        case VehicleComponentType.BlockDLC:
        {
            var dlc = DLCManager.PatchDayOne;
            if (!dlc.IsLoaded)
            {
                throw new Exception("Missing DLC");
            }

            return(AddChild(dlc.Block, id));
        }

        default: Debug.LogError("Invalid type"); break;
        }

        return(null);
    }
Exemplo n.º 4
0
 public VehicleComponentSeed()
 {
     this.type = Type;
 }
Exemplo n.º 5
0
 private VehicleComponent AddChild(VehicleComponentType type)
 {
     return(AddChild(type, GenerateID()));
 }