- Home /
It may not be updated even if I appoint ExecuteInEditMode
I use ExecuteInEditMode.
I am editing it, and update is called.
However, Update of Editor is not called even if I change a window size of View.
I use width and height of Screen in Update.
When a window size of View changed, does not Update come to be called?
(By the way, it seems to be done call when I place a lot of objects.)
// ※For example, at the time of GUITexture
@script ExecuteInEditMode()
var m_Pixel : Vector2;
function Update () {
transform.localPosition.x = m_Pixel.x / Screen.width;
transform.localPosition.y = m_Pixel.y / Screen.height;
}
Any help would be appreciated, Thanks!
Answer by Statement · Dec 07, 2011 at 12:48 PM
The editor get updates when user make interactions. For that reason it's a bit awkward to use ExecuteInEditMode. If you really need something to be done every frame, you should look into making an Editor script for your object.
O$$anonymous$$. Thank you.
In that case Editor class OnSceneGUI Is it used?
It was not updated when it was this.
I misunderstand some?
Your answer
