Страница 1 из 1

OnPostprocessGameObjectWithUserProperties

СообщениеДобавлено: 08 июл 2009, 21:33
gnoblin
Нашел прикольную функцию :D .
Код: Выделить всё
function OnPostprocessGameObjectWithUserProperties (root : GameObject, propNames : string[], values : object[]) : void
Description

Gets called for each GameObject that had at least one userpropery attached to it in the imported file.

The propNames is a string[] containing all the names of the properties found. The values is an object[] containing all the actual values. These can be of type string, Vector4, bool, string, Color, float, int.

Typical usecase for this feature is reading out "userdata" stored on objects in 3dmax/maya. Based on what is written in the text userdata for an object, you could decide to postprocess your GameObject in different ways. The sample below adds a simple BoxCollider component if the userdata string contains "addboxcollider".


Вопрос: где писать этот "User Property" в максе??

[ftp]http://unity3d.com/support/documentation/ScriptReference/AssetPostprocessor.OnPostprocessGameObjectWithUserProperties.html[/ftp]

Re: OnPostprocessGameObjectWithUserProperties

СообщениеДобавлено: 08 июл 2009, 21:53
Neodrop
Пиши вопрос на офф. форум в раздел Support.

Re: OnPostprocessGameObjectWithUserProperties

СообщениеДобавлено: 08 июл 2009, 22:39
Neodrop
Похоже, что этот обработчик при загрузке модели (импорте), должен получать данные из имени модели.
Хотя.. Не ясно до конца.. :-?

Re: OnPostprocessGameObjectWithUserProperties

СообщениеДобавлено: 09 июл 2009, 12:22
Fox Malder
Незнаю где это добавляется в максе, но в maya это не что иное как AddAtribute в атрибут едиторе, я пробовал , работает =)...Т.е. на объект (transform node) вешаем атрибут который благополучно видит юнити...

Re: OnPostprocessGameObjectWithUserProperties

СообщениеДобавлено: 09 июл 2009, 12:32
Neodrop
Скорее всего, практически тож самое и в Максе. Нужно проверить...

Re: OnPostprocessGameObjectWithUserProperties

СообщениеДобавлено: 09 июл 2009, 12:57
gnoblin
Если по объекту тыркнуть правой кнопкой по объекту, выбрать Object Properties, откроется окно в котором есть таб User Defined Properties.
Только пока не понял срабатывает или нет.