is it possible to have a global/static variable in the AssetPostprocessor script

I am trying to figure out if there is a constructor/start/awake kinda event on this object, but the documentation needs a little further development it seems at the moment.

I need to have somekinda static value or something that I can count, because when I do multiple imports, I get the event pr. model (which is great btw), but I need to calculate how many + assign certain values to the model, depending on how many I already have.

This one fires nicely:

void OnPreprocessModel () 
{
   ModelImporter proc = (ModelImporter) assetImporter; 
   Debug.Log(proc.assetPath);
}

But is there any “before we start to import xx models” function that can initialize a counter etc.?

Edit #1
I would like to be able to have ZERO value before running the “Reimport” which can be fired with right mousebutton on any Ressource folder.

If its a static, it keeps going up and up and thats great while importing, but afterwards or before, I need to be able to set it back to zero for next run.

Reason is that I would like to build some kinda PROGRESS indicator for the import, like 234 of 3424 models.

Right now, my only option is to make a menu function that resets the static value or let the server return the “count”. But the server ALSO needs to know when to start over.

Lastly, I cant seem to get WWWform to work with AssetsImporter ??? cant corutines be spawned from within this?

Just define static variable (I don’t know syntax for JavaScript) and then use it. If you want Init call for your static variables, you can always create “static bool initialized = false;”, and then check for that in OnPreprocessModel and call your Init method if it hasn’t been initialized.

Maybe you could just define a constructor for your AssetPostprocessor, although I can’t remember how long Unity keeps the instance of each AssetPostprocessor.