- Home /
Question by
ZeWitcher · Oct 04, 2013 at 07:14 PM ·
editorselectionattributeexecuteineditmode
Problem with ExecuteInEditMode
Hello everyone,
I use [ExecuteInEditMode] attribute to make live editor components. My problem is that Update is called even if the transform is not selected. This makes Unity think that a change has been made and wants me to save when exiting Unity. One solution is to use the Selection class to check if the transform is selected before making changes but I was wondering if it is possible to create a custom attribute that calls Update only if transform or any of its children are selected.
In addition to this question, how can I make my component automatically select its transform if any of the children are selected?
Thanks in advance :)
Comment