private void OnEnable()
        {
            Undo.undoRedoPerformed   += OnUndoRedo;
            SceneView.duringSceneGui += DuringSceneGUI;
            instance     = target as GTextureStamper;
            Tools.hidden = true;

            instance.Internal_UpdateFalloffTexture();
            instance.Internal_UpdateLayerTransitionTextures();
            previewPropertyBlock = new MaterialPropertyBlock();
            GCommon.RegisterBeginRender(OnCameraRender);
            GCommon.RegisterBeginRenderSRP(OnCameraRenderSRP);

            GCommon.UpdateMaterials(instance.GroupId);
            UpdatePreview();
        }
Beispiel #2
0
        private void DrawStampGUI()
        {
            string label = "Stamp";
            string id    = "stamp" + instance.GetInstanceID().ToString();

            GEditorCommon.Foldout(label, true, id, () =>
            {
                instance.Mask = EditorGUILayout.ObjectField("Mask", instance.Mask, typeof(Texture2D), false) as Texture2D;

                EditorGUI.BeginChangeCheck();
                instance.Falloff = EditorGUILayout.CurveField("Falloff", instance.Falloff, Color.red, new Rect(0, 0, 1, 1));
                if (EditorGUI.EndChangeCheck())
                {
                    instance.Internal_UpdateFalloffTexture();
                }
                instance.Channel = (GTextureStampChannel)EditorGUILayout.EnumPopup("Channel", instance.Channel);
            });
        }