Version: 5.3 (switch to 5.4b)
ЯзыкEnglish
  • C#
  • JS

Язык программирования

Выберите подходящий для вас язык программирования. Все примеры кода будут представлены на выбранном языке.

Image.eventAlphaThreshold

Предложить изменения

Успех!

Благодарим вас за то, что вы помогаете нам улучшить качество документации по Unity. Однако, мы не можем принять любой перевод. Мы проверяем каждый предложенный вами вариант перевода и принимаем его только если он соответствует оригиналу.

Закрыть

Ошибка внесения изменений

По определённым причинам предложенный вами перевод не может быть принят. Пожалуйста <a>попробуйте снова</a> через пару минут. И выражаем вам свою благодарность за то, что вы уделяете время, чтобы улучшить документацию по Unity.

Закрыть

Отменить

Руководство
public var eventAlphaThreshold: float;
public float eventAlphaThreshold;

Описание

The alpha threshold specifying the minimum alpha a pixel must have for the event to be passed through.

The alpha is decided from the image sprite only, while the alpha of the Image Graphic.color is disregarded.

alphaEventThreshold is defaulted to 1. Events inside the rectangle are always passed through regardless of alpha. In order for lower values to work, the sprite used by the Image must have readable pixels. This can be achived by enabling Read/Write enabled in the advanced Texture Import Settings for the sprite and disabling atlassing for the sprite.


        
using UnityEngine;
using System.Collections;
using UnityEngine.UI; // Required when Using UI elements.

public class ExampleClass : MonoBehaviour {

public Image theButton;

// Use this for initialization void Start () { theButton.eventAlphaThreshold = 0.5f; } }