- Home /
 
               Question by 
               patrik-org · Nov 09, 2014 at 08:06 PM · 
                uieditor-scriptingeventunity4.6event-handling  
              
 
              Unity UI 4.6 - Programmatically adding events - EventTrigger.delegates is null
I'm creating an editor extension (AssetPostprocessor) that creates some gameObjects, adds the EventTrigger component to them and tries to add a EventTrigger.Entry. The problem is that the EventTrigger.delegates is null at this point. If I assign a new List to it, the list is overwritten at some point and the entries I've added are removed. At what point is the delegates-list created and when do I know I can start to add entries to it?
I add events using the code suggested here: http://gamedev.stackexchange.com/a/83029/14547 (under "Finally, to dynamically add events"), and it works if I add the events in the gameObject's Awake()/Start() method but I want to add them so they are set in the editor not during runtime.
               Comment
              
 
               
              Your answer
 
 
              koobas.hobune.stream
koobas.hobune.stream 
                       
                
                       
			     
			 
                