• Time: 2:00-11:00AM(Mon.-Fri.) Central Eu Time
  • Email: shopify@bseed.com

Understanding Touch Control in Unity

par Shopify API sur April 03, 2023

Understanding Touch Control in Unity

Touch control is a feature in Unity that lets you add on-screen buttons to your game. You can use these for simple left-right controls or create more complex controls that use your mouse and keyboard.

A touch control can be a button, a track pad, or a combination of both. Each one has its own set of properties that can be changed at runtime, and all are able to be sprites, sized and placed in the scene.

When the user touches a touch control, it sends data to a Rewired.CustomController component which can then be used to process the input data and provide output to a game object, a custom event system or a Canvas.

This can be done by using the Rewired Input Manager in the Inspector or creating a Custom Controller Map in the Player and assigning it to the Touch Controller component. Once the Custom Controller is created, it will also automatically create a Rewired Input Manager and a Canvas in the scene if no Rewired Input Manager or Canvas already exists there.

Capacitive sensors are the most common type of touch sensor in most products and devices. They consist of a glass layer with a conductive coating on the underside. When a finger or stylus presses down on the glass, it contacts the coating and measures the capacitance of both layers at the point of contact.

Resistive sensors, on the other hand, have two layers; a flexible plastic front surface and a glass or hard plastic back surface that is coated with conductive material (usually Indium Tin Oxide). When a finger presses down on this front layer, it touches the coating on the second layer and measures the resistance of both the layers at the point of contact.

There are a few different types of resistive touch sensors, and each has its own set of properties that can be configured at runtime. The most cost effective is the wire resistive touch sensor, but the more expensive are the piezoelectric, magnetic and electrostatic touch sensors.

Generally, these devices are much more sensitive than a standard touch screen and require some degree of circuitry to keep them from interfering with other circuits in the device. This can cause the devices to be expensive and unwieldy, making them less popular than their capacitive counterparts.

Other types of touch controls are more specialized and may be better suited for specific uses. They may have more features than a standard touch screen, such as multiple switches or sliders or rotary interfaces.

These can be based on either a self-capacitance approach where the touch sensor forms a capacitor to ground or mutual capacitance where multiple sensors are placed in close proximity to each other and interact via a ground ring or hatched ground behind each of them.

Both of these types are capable of providing a range of gestures, from pinching to sweeping and rotating. These capabilities are useful in a variety of applications, but it is important to choose the right sensor for your project.

Laisser une réponse

Les commentaires doivent être approuvés avant de s'afficher


RETOUR AU SOMMET