Resolves an issue where gizmos cannot be displayed with the Inspector panel assignment as an argument under the custom editor

Source: Internet
Author: User

Prior to writing a small script for planning children's shoes, in order for them to use it quickly understand the usage, customize the editor, rewrite the script's Inspector panel layout and display logic.

But the problem is that once the custom Editor,gizmo drawing contains parameters that are assigned by the editor, it cannot be used. That is, if I want gizmos.drawline (from * param, to * param), where Param assigns a parameter to the editor, the Gizmo will always use the default value. I think it is also very well understood that the extension of the thing Gizmo is of course not known. So Google a bit, after several twists and turns (mainly did not find the same as my problem, but found their own handle Gizmo method). The final resolution version is as follows:
1 [Drawgizmo (gizmotype.selected |  Gizmotype.selectedorchild)]2privatestaticvoid  Handlemygizmo ( Transform Atransform, Gizmotype atype) {3        //  at this time, you can do whatever you want!  4        //  can get other editor-assigned serialization properties for gizmos5        //  But it's important to note that this approach is global and needs to be tested for your specific script 6 }

The effect is good, just need to select the object will be displayed, of course, there are children shoes can also add gizmotype.notselected achieve and gizmos the same effect

Resolves an issue where gizmos cannot be displayed with the Inspector panel assignment as a parameter in the custom editor

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.