private void DrawStampGUI()
        {
            string label = "Stamp";
            string id    = "stamp" + instance.GetInstanceID().ToString();

            GEditorCommon.Foldout(label, true, id, () =>
            {
                instance.Stamp   = EditorGUILayout.ObjectField("Mask", instance.Stamp, typeof(Texture2D), false) as Texture2D;
                instance.Channel = (GGeometryStamper.GStampChannel)EditorGUILayout.EnumPopup("Channel", instance.Channel);
                EditorGUI.BeginChangeCheck();
                instance.Falloff = EditorGUILayout.CurveField("Falloff", instance.Falloff, Color.red, new Rect(0, 0, 1, 1));
                if (EditorGUI.EndChangeCheck())
                {
                    instance.Internal_UpdateFalloffTexture();
                }

                instance.Operation = (GStampOperation)EditorGUILayout.EnumPopup("Operation", instance.Operation);
                if (instance.Operation == GStampOperation.Lerp)
                {
                    instance.LerpFactor = EditorGUILayout.Slider("Lerp Factor", instance.LerpFactor, 0f, 1f);
                }
                instance.AdditionalMeshResolution = EditorGUILayout.IntSlider("Additional Mesh Resolution", instance.AdditionalMeshResolution, 0, 10);
                instance.InverseStamp             = EditorGUILayout.Toggle("Inverse", instance.InverseStamp);
                instance.UseFalloffAsBlendFactor  = EditorGUILayout.Toggle("Blend Using Falloff", instance.UseFalloffAsBlendFactor);
            });
        }
        private void OnEnable()
        {
            Undo.undoRedoPerformed   += OnUndoRedo;
            SceneView.duringSceneGui += DuringSceneGUI;
            instance     = target as GGeometryStamper;
            Tools.hidden = true;

            instance.Internal_UpdateFalloffTexture();
            GCommon.RegisterBeginRender(OnCameraRender);
            GCommon.RegisterBeginRenderSRP(OnCameraRenderSRP);
            UpdatePreview();
        }
        private void OnEnable()
        {
            Undo.undoRedoPerformed += OnUndoRedo;
            instance     = target as GGeometryStamper;
            Tools.hidden = true;

            instance.Internal_UpdateFalloffTexture();
            previewPropertyBlock = new MaterialPropertyBlock();
            GCommon.RegisterBeginRender(OnCameraRender);
#if UNITY_2019
            GCommon.RegisterBeginRenderSRP(OnCameraRenderSRP);
#endif
            UpdatePreview();
        }