文档

Unity Engine

Unity Engine

RemoveGroup(string)

(Editor Only) Attempts to remove a texture mipmap limit group with the indicated groupName.
阅读时间1 分钟最后更新于 1 个月前

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule
public static void RemoveGroup(string groupName)

Parameters

groupName

Name of the texture mipmap limit group to remove.

Remarks

This operation fails and throws an exception if
groupName
is null or there is no texture mipmap limit group named
groupName
. If Unity finds a matching group, Unity removes it from all quality levels.
Unity does not modify textures bound to the removed group. These textures continue to point to the removed group as long as you do not update and re-import them yourself. If you do not adjust the relevant textures, they automatically fall back to the global texture mipmap limit.
#if UNITY_EDITORusing UnityEngine;using UnityEditor;public class Example : MonoBehaviour{ // Attempts to remove the texture mipmap limit group "MyGroup", if it exists in the project. [MenuItem("MyMenu/Remove TextureMipmapLimitGroup")] static void RemoveMyGroup() { const string textureMipmapLimitGroupName = "MyGroup"; if (TextureMipmapLimitGroups.HasGroup(textureMipmapLimitGroupName)) { TextureMipmapLimitGroups.RemoveGroup(textureMipmapLimitGroupName); } else { Debug.LogError($"Cannot remove texture mipmap limit group '{textureMipmapLimitGroupName}' as it does not exist!"); } }}#endif