added method overloading and custom models

This commit is contained in:
shinichi
2020-09-18 14:23:43 +02:00
parent 8fd3322c63
commit 6e09b87f60
2 changed files with 28 additions and 6 deletions

View File

@@ -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
{
id = "scene/node/add",
@@ -74,10 +90,10 @@ namespace RH_Engine
{
model = new
{
file = "data\\NetworkEngine\\models\\bike\\bike.fbx",
file = fileLocation,
cullbackfaces = true,
animated = false,
animation = "data\\NetworkEngine\\models\\bike\\bike_anim.fbx"
animated = animatedBool,
animation = animationLocation
},
}
}