Texture.IncrementUpdateCount

Unity · Версия 2020.3 LTS · Scripting · Texture

Texture.IncrementUpdateCount

Объявление

public void IncrementUpdateCount();

Описание

Увеличить счетчик обновлений.

Вызывайте этот метод, когда вы обновляете текстуру со стороны графического процессора или хотите явно увеличить значение счетчика.

using UnityEngine;

public class RenderSomething
{
    RenderTexture m_RT;

    void Awake()
    {
        m_RT = new RenderTexture(512, 512, 0);
    }

    public void Render(Texture source)
    {
        Graphics.Blit(source, m_RT);
        // We updated the render target on the GPU, so increment the update counter
        m_RT.IncrementUpdateCount();
    }
}

Обновлено 17 ноября 2026 г.