Highlighting the use of the system plug-in and some issues

Source: Internet
Author: User

The author uses the V4.0 version, which is very convenient to use.

1. Add highlighter script to objects that need to produce a highlight effect

2. Add a Highlightingrenderer script to the camera

3. Write your own control script and call the corresponding function in the highlighter script.

If you want to set the color yourself, you just need to add the parameters using the overload


Here is the script I wrote, hanging on the target object

Need to add physics Raycaster components to the camera

When the camera is seen, the target object is highlighted


Using Unityengine;
Using System.Collections;
Using Unityengine.eventsystems;
Using System;


namespace Highlightingsystem//must have, namespace
{
public class Eaychoose:monobehaviour, Ipointerenterhandler, Ipointerexithandler
{

public highlighter m_highlighter;

void Start ()
{
M_transform = This.transform;
M_highlighter = M_transform. Getcomponent}

public void Onpointerenter (Pointereventdata eventData)
{

Starthighlight ();
}

public void Onpointerexit (Pointereventdata eventData)
{
Endhighlight ();
}

void Starthighlight ()
{
M_highlighter. Flashingon ();//Call the start Highlight function of the Highlighte script
}

void Endhighlight ()
{
M_highlighter. Flashingoff ();//Call the end highlight function of the Highlighte script
}
}
}



When using this plugin, it is found that some machines need to set Edit/graphics emulations to No Emulation

Otherwise, the overall highlighting error will occur.

However, this may not be possible with Android2.0 below


There is another problem the author did not solve: split screen when, sometimes only a camera to produce a highlight effect, do not know how to solve

I hope the comrades can enlighten me.

The problem is solved, the previous call is the Flashingon () function, instead of calling Constanton (), no highlighting effect, but also barely able to achieve the desired effect


Also found a "solution" scenario, which reduces the chance of single rendering, and sometimes the single-screen rendering, but retains the expected shiny effect:
method is to set the highlighting render method of the camera to true when needed, and set to False when it is not required.



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.