added method overloading and custom models
This commit is contained in:
@@ -61,9 +61,25 @@ namespace RH_Engine
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public string ModelCommand()
|
public string AddBikeModel()
|
||||||
{
|
{
|
||||||
string namename = "bike";
|
return AddModel("bike", "data\\NetworkEngine\\models\\bike\\bike.fbx", null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public string AddModel(string nodeName, string fileLocation)
|
||||||
|
{
|
||||||
|
return AddModel(nodeName, fileLocation, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public string AddModel(string nodeName, string fileLocation, string animationLocation)
|
||||||
|
{
|
||||||
|
string namename = nodeName;
|
||||||
|
bool animatedBool = false;
|
||||||
|
if (animationLocation != null)
|
||||||
|
{
|
||||||
|
animatedBool = true;
|
||||||
|
}
|
||||||
|
|
||||||
dynamic payload = new
|
dynamic payload = new
|
||||||
{
|
{
|
||||||
id = "scene/node/add",
|
id = "scene/node/add",
|
||||||
@@ -74,10 +90,10 @@ namespace RH_Engine
|
|||||||
{
|
{
|
||||||
model = new
|
model = new
|
||||||
{
|
{
|
||||||
file = "data\\NetworkEngine\\models\\bike\\bike.fbx",
|
file = fileLocation,
|
||||||
cullbackfaces = true,
|
cullbackfaces = true,
|
||||||
animated = false,
|
animated = animatedBool,
|
||||||
animation = "data\\NetworkEngine\\models\\bike\\bike_anim.fbx"
|
animation = animationLocation
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -108,7 +108,13 @@ namespace RH_Engine
|
|||||||
|
|
||||||
Console.WriteLine(ReadPrefMessage(stream));
|
Console.WriteLine(ReadPrefMessage(stream));
|
||||||
|
|
||||||
command = createGraphics.ModelCommand();
|
command = createGraphics.AddBikeModel();
|
||||||
|
|
||||||
|
WriteTextMessage(stream, command);
|
||||||
|
|
||||||
|
Console.WriteLine(ReadPrefMessage(stream));
|
||||||
|
|
||||||
|
command = createGraphics.AddModel("car", "data\\customModels\\TeslaRoadster.fbx");
|
||||||
|
|
||||||
WriteTextMessage(stream, command);
|
WriteTextMessage(stream, command);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user