Unity: how to imitate the lighting of a mesh as it appears in the editor view

I have a camera that shows a "bird's eye view" of a mesh generated procedurally, like this:

camera looking down on the mesh

Currently in the view of the editor (right), the pitch is exactly as I would like it. However, in the game (left), I have not managed to make it appear as I would like:

game view next to the stage

I used a directional light above, which caused the effect when the center of the mesh appears "shiny". I have therefore looked at some articles and questions on the forum and decided to instead use ambient lighting by changing the settings in Window> Render> Lighting Settings, but here is the result:

ambient lighting, mesh looks dark

This is the material that I use (EDIT: I'm using a particle shader because the staining of my meshes is based on changing mesh colors. ):

material parameters

I tried to play with different types of materials, but I could not get better results. My question is: how can I configure my game to use the same lighting as used in the editor?

Thanks in advance

Custom Button PropertyDrawer of the Unity Editor

I have a PropertyDrawer, everything goes well except one feature: I do not know how to add a button and I rather use a checkbox

Screen capture

use UnityEngine;
use UnityEditor;
using System.Collections;

[CustomPropertyDrawer (typeof (InteractiveObject))]
class InteractiveObjectPropertyDrawer: PropertyDrawer {

public override void OnGUI (Rect position, SerializedProperty property, GUIContent label) {

EditorGUI.BeginProperty (position, label, property);
position = EditorGUI.PrefixLabel (position, GUIUtility.GetControlID (FocusType.Passive), label);
var indent = EditorGUI.indentLevel;
EditorGUI.indentLevel = 0;
Rect colorRect = new Rect (position.x, position.y, 40, position.height);
Rect unitRect = new Rect (position.x + 50, position.y, 90, position.height);
Rect nameRect = new Rect (position.x + 150, position.y, position.width - 150, position.height);

EditorGUI.BeginChangeCheck ();
EditorGUI.PropertyField (colorRect, property.FindPropertyRelative ("show"), GUIContent.none);
if (EditorGUI.EndChangeCheck ()) {
RenderSettings.skybox.SetColor ("_ highlight", property.FindPropertyRelative ("id"). ColorValue);

EditorGUI.PropertyField (unitRect, property.FindPropertyRelative ("name"), GUIContent.none);
EditorGUI.PropertyField (nameRect, property.FindPropertyRelative ("name"), GUIContent.none);
EditorGUI.indentLevel = indent;
EditorGUI.EndProperty ();

How can I add a button there?

visual editor – How to insert a media button in gutenberg

I am working on WordPress using the Gutenberg editor using this code. I've added a custom media button in the classic editor. add_action ('media_buttons', & # 39; add_my_media_button & # 39 ;, 15); but do not see these buttons in the editor Gutenberg. My question is how to add a multimedia button to Gutenberg or how to display a multimedia button previously added to Gutenberg.

Need content editor


I need writers of cheap and quality content. My price is $ 0.5 per 100 words. Only quality authors will be accepted. You can get regular work if you provide good quality items. PM me with an example of work, if you are interested.

How to get a customer for a photo editor?

I own a company where we provide a photo editing service. We mainly focus on clipping path, image masking, photo masking, color correction, photo restoration, multipath clipping, shadowing, and more. But I can not find an efficient client. So, how can I get a customer?

Plugin Editor – Breaks when switching between visual and text

I have developed a plugin that inserts a shortcode, now I want to reverse the process.
I have it to find and replace the shortcode with an image. So I have it when you hover over the image, it places a link overlay to open an editor window to edit, and so on. which only works on the load (the switch between Visual and Text and vice versa) adds nothing. the superposition.

j & # 39; uses

            editor.on (& # 39; BeforeSetContent & # 39; function (event) {
event.content = replaceShortcodes (event.content);
generateOverlay (editor)

editor.on (& # 39; PostProcess & # 39; function (event) {
if (event.get) {
event.content = restoreShortcodes (event.content);

I use JQuery to generate hover flyover (unless someone else does it)

function generateOverlay (publisher) {
//event.preventDefault ();
if (! $ ("# content_ifr"). content (). find (".wp-ip-image"). parent (). hasClass ("wp-ip-container")) {
$ ("# content_ifr"). contents (). find (& # 39; .wp-ip-image & # 39;). parent (). wrap (& # 39;
& # 39;) } var wp_ip_img = $ ("# content_ifr"). happy (). find (& # 39 ;. wp-ip-image & # 39;) wp_ip_img.hover ( a function () { post_id = $ (this) .data (& # 39; post-id & # 39;); blog_id = $ (this) .data (& # 39; blog-id & # 39;); $ (this) .css ('cursor', 'pointer'); $ (this) .before (& # 39;
& # 39;) $ (this) .parent (). find ("# wp-ip-div -" + blog_id + "-" + post_id) .hover ( a function () { $ (this) .css ('cursor', 'pointer'); $ (this) .html (getPostData (post_id, blog_id)) $ (this) .find (& # 39 ;. wp-preview-ip & # 39;). unbind (). click (function (e) { postContent (editor, $ (this) .data (& # 39; url & # 39;)); }); $ (this) .find (& # 39 ;. wp-remove-ip & # 39;). unbind (). click (function (e) { $ ("# content_ifr"). contents (). find ("# wp-ip-div -" + id_blog + "-" + post_id) .parent (). remove () }); $ (this) .find (& # 39 ;. wp-edit-ip & # 39;). unbind (). click (function (e) { insertPosts (editor, blog_id, post_id, wp_ip_img.data ('wp-insert-post')) }); } a function () { $ (this) .remove () $ (this) .css ('cursor', 'default'); } ) } a function () { $ (this) .css ('cursor', 'default'); } ) } `

when I switch to Visual, it replaces the shortcode and then executes generateOverlay (editor) it happens to wp_ip_img.hover (... and do not run beyond even if he can find wp_ip_img

if someone has any ideas

Unity editor, horizontal line in the inspector

Public static class EditorGUILayoutUtility
public static readonly Color DEFAULT_COLOR = new Color (0f, 0f, 0f, 0.3f);
public static read-only Vector2 DEFAULT_LINE_MARGIN = new Vector2 (2f, 2f);

public const float DEFAULT_LINE_HEIGHT = 1f;

public static vacuum HorizontalLine (color, float height, margin Vector2)
GUILayout.Space (margin.x);

EditorGUI.DrawRect (EditorGUILayout.GetControlRect (false, height), color);

GUILayout.Space (margin.y);
blank static public HorizontalLine (Color Color, Floating Height) => EditorGUILoutUtility.HorizontalLine (color, height, DEFAULT_LINE_MARGIN);
blank static public HorizontalLine (Color color, Vector2 margin) => EditorGUILoutUtility.HorizontalLine (color, DEFAULT_LINE_HEIGHT, margin);
public static static HorizontalLine (float height, Vector2 margin) => EditorGUILoutoutUtility.HorizontalLine (DEFAULT_COLOR, height, margin);

public static empty HorizontalLine (Color color) => EditorGUILoutoutUtility.HorizontalLine (color, DEFAULT_LINE_HEIGHT, DEFAULT_LINE_MARGIN);
public static static HorizontalLine (float height) => EditorGUILoutoutUtility.HorizontalLine (DEFAULT_COLOR, height, DEFAULT_LINE_MARGIN);
public static static HorizontalLine (Vector2 margin) => EditorGUILoutoutUtility.HorizontalLine (DEFAULT_COLOR, DEFAULT_LINE_HEIGHT, margin);

public static empty HorizontalLine () => EditorGUILayoutUtility.HorizontalLine (DEFAULT_COLOR, DEFAULT_LINE_HEIGHT, DEFAULT_LINE_MARGIN);

#end if


public override void OnInspectorGUI ()
base.OnInspectorGUI ();

EditorGUILayout.BeginVertical ();

EditorGUILayoutUtility.HorizontalLine (new Vector2 (20f, 20f));

EditorGUILayout.EndVertical ();

Will give this result.

Draw a line Result

design mistletoe – Recommended method for nested 2D rectangles that can be edited in an editor


  • The user can resize, move and add boxes at will
  • A box can have an infinite amount of sub-boxes
  • The modification of sub-boxes is currently done by opening another window.
  • Subboxes usually fill all "space" in the parent box


  1. How to view sub-boxes without overloading the user's information?
  2. How to allow the user to edit sub-boxes in the same window without getting a lot of input error?


I am creating a basic layout editor, which allows me to create an infinite number of boxes with an infinite number of sub-boxes.

Real application

The user is supposed to manipulate (move and resize) all these boxes as he wishes. All of this works pretty well so far, but to actually edit a "sub-box", I currently have to open another instance of the editor, which only pertains to that specific box.


I want the user to be able to edit sub-boxes in the same window as the parent boxes, without overloading it with information or cluttering it with invalid input actions (for example, change the size of a sub-box while it's a parent box) was supposed to be moved).
the problem becomes more and more clear when we look at what these nested hierarchies might mean:
A possible "configuration"

c # – Development of a game engine editor

I am currently developing a game engine in C ++, and while I am working on it, I would also like to start working on the editor, because I think is an important tool for making designers work, but I do not do it. I do not know where to start.

I've already studied GUI development frameworks such as QT (though I do not necessarily need a multiplatform support) and WPF and I know how they work, but What I do not know, is how to design (or should I say develop) an application that can interface with my engine to update elements such as available resources and materials, place objects in the game world, create classes with a visual scripting language and display the rendering of the engine in one of its own windows (the window).

If someone could steer me in the right direction, I would have a lot more than you.

Help us find ways to automatically edit a nano editor file

So I wondered if there was a way to write a script that would automatically modify some nano files. anything that I can store on a usb or even on the hard drive of the computer that I use can be recovered automatically ..

Hope this makes sense … a bit like a autorun macro ..

No matter who? Thanks in advance …