Component order on a game object changed on unity editor restart
Hi! I'm working on an editor script that's managing my image effects on the camera. It adds required components to the game object. For those effects a special order is required, so that SSAO and bloom are applied before tone mapping and so on. When I add the components everything is fine. But when I close Unity (the editor application) and open Unity again the order has changed. All components are there but all of my added components, add by hand and added via my editor script are in a reversed order.
Example:
Before:
Transform
Camera
AudioListener
Script A (added by hand)
Script B (added by hand)
Script C (added by hand)
MyImageEffectsControllerScript with custom inspector
Script 1 (added by MyImageEffectsControllerScript's custom inspector)
Script 2 (added by MyImageEffectsControllerScript's custom inspector)
Script 3 (added by MyImageEffectsControllerScript's custom inspector)
After restarting Unity:
Transform
Camera
AudioListener
Script 3 (added by MyImageEffectsControllerScript's custom inspector)
Script 2 (added by MyImageEffectsControllerScript's custom inspector)
Script 1 (added by MyImageEffectsControllerScript's custom inspector)
MyImageEffectsControllerScript with custom inspector
Script C (added by hand)
Script B (added by hand)
Script A (added by hand)
Any help is appreciated. Thanks!