Reworked ModelList for Bike. Missing Sprocket
This commit is contained in:
@@ -22,12 +22,15 @@ public class ModelList
|
||||
new List<Port>
|
||||
{
|
||||
new Port(Definitions.PORT_BIKE_FRAME, new Vector3(0,1,0), "idBikeFrame"),
|
||||
new Port(Definitions.PORT_BIKE_FRAME2, new Vector3(0,1,0), "idBikeFrame2"),
|
||||
new Port(Definitions.PORT_BIKE_SPROCKET, new Vector3(0.007933f, 0.444f, -0.1614f), "idBikeSprocket"),
|
||||
new Port(Definitions.PORT_BIKE_PEDAL_L, new Vector3(-0.1252177f, 0.5490288f, -0.312027f), "idBikePedalL_1"),
|
||||
new Port(Definitions.PORT_BIKE_PEDAL_R, new Vector3(0.1410843f, 0.3393247f, -0.01154391f), "idBikePedalR_1"),
|
||||
new Port(Definitions.PORT_BIKE_STEER, new Vector3(0.002989591f, 1.214713f, 0.4860705f), Quaternion.Euler(-30f, 0f, 0f), "idBikeHandlebars"),
|
||||
new Port(Definitions.PORT_BIKE_WHEEL, new Vector3(-0.01431298f, 0.4673222f, -0.7874681f), "idBikeWheel_Back1"),
|
||||
new Port(Definitions.PORT_BIKE_WHEEL, new Vector3(0.01984263f, 0.4673225f, 0.9462124f), "idBikeWheel_Front1"),
|
||||
new Port(Definitions.PORT_BIKE_WHEEL_B, new Vector3(-0.01431298f, 0.4673222f, -0.7874681f), "idBikeWheel_Back1"),
|
||||
new Port(Definitions.PORT_BIKE_WHEEL_B2, new Vector3(-0.01431298f, 0.4673222f, -0.7874681f), "idBikeWheel_Back2"),
|
||||
new Port(Definitions.PORT_BIKE_WHEEL_F, new Vector3(0.01984263f, 0.4673225f, 0.9462124f), "idBikeWheel_Front1"),
|
||||
new Port(Definitions.PORT_BIKE_WHEEL_F2, new Vector3(0.01984263f, 0.4673225f, 0.9462124f), "idBikeWheel_Front2"),
|
||||
new Port(Definitions.PORT_BIKE_DRIVER, new Vector3(0f, 1.25f, -0.65f), Quaternion.Euler(70f, 0f, 0f), "nuke"),
|
||||
}
|
||||
),
|
||||
@@ -157,12 +160,36 @@ public class ModelList
|
||||
null
|
||||
),
|
||||
new ChildModel(
|
||||
Definitions.PORT_BIKE_WHEEL,
|
||||
"30\" Rim",
|
||||
"bike30inchAlloy",
|
||||
Resources.Load<Mesh>("Plagues/Mesh/Hex"),
|
||||
Resources.Load<Material>($"Material/Default"),
|
||||
null
|
||||
Definitions.PORT_BIKE_WHEEL_B,
|
||||
"30\" Rim",
|
||||
"idBikeWheel_Back1",
|
||||
Resources.Load<Mesh>("Plagues/Mesh/Hex"),
|
||||
Resources.Load<Material>($"Material/Default"),
|
||||
null
|
||||
),
|
||||
new ChildModel(
|
||||
Definitions.PORT_BIKE_WHEEL_B2,
|
||||
"30\" Rim",
|
||||
"idBikeWheel_Back2",
|
||||
Resources.Load<Mesh>("Plagues/Mesh/Hex"),
|
||||
Resources.Load<Material>($"Material/Default"),
|
||||
null
|
||||
),
|
||||
new ChildModel(
|
||||
Definitions.PORT_BIKE_WHEEL_F,
|
||||
"30\" Rim",
|
||||
"idBikeWheel_Front1",
|
||||
Resources.Load<Mesh>("Plagues/Mesh/Hex"),
|
||||
Resources.Load<Material>($"Material/Default"),
|
||||
null
|
||||
),
|
||||
new ChildModel(
|
||||
Definitions.PORT_BIKE_WHEEL_F2,
|
||||
"30\" Rim",
|
||||
"idBikeWheel_Front2",
|
||||
Resources.Load<Mesh>("Plagues/Mesh/Hex"),
|
||||
Resources.Load<Material>($"Material/Default"),
|
||||
null
|
||||
),
|
||||
new ChildModel(
|
||||
"bikePedalR",
|
||||
@@ -222,102 +249,20 @@ public class ModelList
|
||||
* ██ ██ ██ ██ ██ ██
|
||||
* ██████ ██ ██ ██ ███████
|
||||
*/
|
||||
ModelLoader.LoadChildModelsFromPackedModel(
|
||||
ChildModels,
|
||||
new string[7] // port
|
||||
{
|
||||
Definitions.PORT_BIKE_FRAME,
|
||||
Definitions.PORT_BIKE_SPROCKET,
|
||||
Definitions.PORT_BIKE_PEDAL_L,
|
||||
Definitions.PORT_BIKE_PEDAL_R,
|
||||
Definitions.PORT_BIKE_STEER,
|
||||
Definitions.PORT_BIKE_WHEEL,
|
||||
Definitions.PORT_BIKE_WHEEL,
|
||||
},
|
||||
new string[7] //human name
|
||||
{
|
||||
"Frame",
|
||||
"Sprocket",
|
||||
"Left Pedal",
|
||||
"Right Pedal",
|
||||
"Handlebars",
|
||||
"Back Wheel",
|
||||
"Front Wheel",
|
||||
},
|
||||
new string[7] //id
|
||||
{
|
||||
"idBikeFrame",
|
||||
"idBikeSprocket",
|
||||
"idBikePedalL_1",
|
||||
"idBikePedalR_1",
|
||||
"idBikeHandlebars",
|
||||
"idBikeWheel_Back1",
|
||||
"idBikeWheel_Front1",
|
||||
},
|
||||
Resources.LoadAll<Mesh>($"Model/Bicycle/Models/Low-Poly Bicycle"),
|
||||
new Material[7] //mat
|
||||
{
|
||||
Resources.Load<Material>($"Material/AluminiumPolished"),
|
||||
Resources.Load<Material>($"Material/AluminiumPolished"),
|
||||
Resources.Load<Material>($"Material/AluminiumPolished"),
|
||||
Resources.Load<Material>($"Material/AluminiumPolished"),
|
||||
Resources.Load<Material>($"Material/AluminiumPolished"),
|
||||
Resources.Load<Material>($"Material/AluminiumPolished"),
|
||||
Resources.Load<Material>($"Material/AluminiumPolished"),
|
||||
},
|
||||
new Vector3[7]
|
||||
{
|
||||
Vector3.zero,
|
||||
Vector3.zero,
|
||||
Vector3.zero,
|
||||
Vector3.zero,
|
||||
Vector3.zero,
|
||||
Vector3.zero,
|
||||
Vector3.zero,
|
||||
|
||||
},
|
||||
new Quaternion[7]
|
||||
{
|
||||
Quaternion.identity,
|
||||
Quaternion.identity,
|
||||
Quaternion.identity,
|
||||
Quaternion.identity,
|
||||
Quaternion.identity,
|
||||
Quaternion.identity,
|
||||
Quaternion.identity,
|
||||
},
|
||||
new Vector3[7] // scale
|
||||
{
|
||||
Vector3.one,
|
||||
Vector3.one,
|
||||
Vector3.one,
|
||||
Vector3.one,
|
||||
Vector3.one,
|
||||
Vector3.one,
|
||||
Vector3.one,
|
||||
},
|
||||
new List<Port>[7] // ports
|
||||
{
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
},
|
||||
new List<Color>[7] // colors
|
||||
{
|
||||
DefaultColors,
|
||||
DefaultColors,
|
||||
DefaultColors,
|
||||
DefaultColors,
|
||||
DefaultColors,
|
||||
DefaultColors,
|
||||
DefaultColors,
|
||||
},
|
||||
0 //dont skip the first mesh, TODO: 'repair'
|
||||
);
|
||||
List<ModelElement> modelElements = new List<ModelElement>();
|
||||
modelElements.Add(new ModelElement(Definitions.PORT_BIKE_FRAME, "Frame", "idBikeFrame", Resources.Load<Material>($"Material/AluminiumPolished"), Vector3.zero, Quaternion.identity, Vector3.one, null, DefaultColors));
|
||||
modelElements.Add(new ModelElement(Definitions.PORT_BIKE_FRAME2, "Frame2", "idBikeFrame2", Resources.Load<Material>($"Material/AluminiumPolished"), Vector3.zero, Quaternion.identity, Vector3.one, null, DefaultColors));
|
||||
modelElements.Add(new ModelElement(Definitions.PORT_BIKE_PEDAL_L, "Left Pedal", "idBikePedalL_1", Resources.Load<Material>($"Material/AluminiumPolished"), Vector3.zero, Quaternion.identity, Vector3.one, null, DefaultColors));
|
||||
modelElements.Add(new ModelElement(Definitions.PORT_BIKE_PEDAL_R, "Right Pedal", "idBikePedalR_1", Resources.Load<Material>($"Material/AluminiumPolished"), Vector3.zero, Quaternion.identity, Vector3.one, null, DefaultColors));
|
||||
modelElements.Add(new ModelElement(Definitions.PORT_BIKE_STEER, "Handlebars", "idBikeHandlebars", Resources.Load<Material>($"Material/AluminiumPolished"), Vector3.zero, Quaternion.identity, Vector3.one, null, DefaultColors));
|
||||
modelElements.Add(new ModelElement(Definitions.PORT_BIKE_SPROCKET, "Sprocket", "idBikeSprocket", Resources.Load<Material>($"Material/AluminiumPolished"), Vector3.zero, Quaternion.identity, Vector3.one, null, DefaultColors));
|
||||
modelElements.Add(new ModelElement(Definitions.PORT_BIKE_WHEEL_B, "Back Wheel", "idBikeWheel_Back1", Resources.Load<Material>($"Material/AluminiumPolished"), Vector3.zero, Quaternion.identity, Vector3.one, null, DefaultColors));
|
||||
modelElements.Add(new ModelElement(Definitions.PORT_BIKE_WHEEL_B2, "Back Wheel2", "idBikeWheel_Back2", Resources.Load<Material>($"Material/AluminiumPolished"), Vector3.zero, Quaternion.identity, Vector3.one, null, DefaultColors));
|
||||
modelElements.Add(new ModelElement(Definitions.PORT_BIKE_WHEEL_F, "Front Wheel", "idBikeWheel_Front1", Resources.Load<Material>($"Material/AluminiumPolished"), Vector3.zero, Quaternion.identity, Vector3.one, null, DefaultColors));
|
||||
modelElements.Add(new ModelElement(Definitions.PORT_BIKE_WHEEL_F2, "Front Wheel2", "idBikeWheel_Front2", Resources.Load<Material>($"Material/AluminiumPolished"), Vector3.zero, Quaternion.identity, Vector3.one, null, DefaultColors));
|
||||
|
||||
ModelLoader.LoadChildFromPackedModel(ChildModels, modelElements,
|
||||
Resources.LoadAll<Mesh>($"Model/Bicycle/Models/Low-Poly Bicycle"),0);
|
||||
|
||||
/*
|
||||
* ███████ ██████ ██ ██████ █████ ██████ ██ ██
|
||||
|
||||
Reference in New Issue
Block a user