Hello…
the idea is this. I am very compfortable in Maya using MEL/Python. Seems logical to me to leverage the assetpostprocessor using attributes in maya to edit script attributes.
Meaning, setting attribute in maya, using the post processor I will need to addComponent (done that already) the script and using other attributes to edit the script attributes.
My question is, how do I edit these attributes? And how can I edit array attributes?
class MyPostprocessor extends AssetPostprocessor {
function OnPostprocessGameObjectWithUserProperties (
go : GameObject,
propNames : String[],
values : System.Object[]){
for (var i : int = 0; i < propNames.Length; i++) {
var propName : String = propNames[i];
var value : Object = values[i];
modelImporter = assetImporter as ModelImporter;
// adds TDTK creep
if (propName == "isCreep")
{
if (value.GetType() == boolean)
{
unitCreep = go.AddComponent("UnitCreep");
}
}
if (propName == "isCreepAttack")
{
if (value.GetType() == boolean)
{
unitCreepAttack = go.AddComponent("UnitCreepAttack");
}
}
}
}
}
thanks in advance