Пример #1
0
        public override void OnInspectorGUI()
        {
            bool previewCreated = PreviewSection();

            float pegOffset = renderer.PegOffset;
            float pegAngle  = renderer.PegAngle;
            float pegSize   = renderer.PegSize;
            float radius    = renderer.Radius;

            base.OnInspectorGUI();

            if (pegAngle != renderer.PegAngle ||
                pegOffset != renderer.PegOffset ||
                radius != renderer.Radius)
            {
                renderer.SetPegTransform();
            }

            if (pegSize != renderer.PegSize)
            {
                renderer.SetPegSize();
            }

            if (GUI.changed && !previewCreated)
            {
                DestroyPreviews();
            }
        }
Пример #2
0
 private void Awake()
 {
     renderer = target as DiskBase <T>;
     Undo.undoRedoPerformed += () =>
     {
         DestroyPreviews();
         renderer.SetPegTransform();
         renderer.SetPegSize();
     };
 }