protected override void OnDestroy() { base.OnDestroy(); if( instance == this )//for undo support instance = null; }