Version: 2021.2
언어: 한국어

Preset.GetDefaultPresetsForType

매뉴얼로 전환
public static DefaultPreset[] GetDefaultPresetsForType (Presets.PresetType type);

파라미터

type A valid default PresetType.

반환

DefaultPreset[] Returns a list of DefaultPreset from the PresetManager that match the specified PresetType.

설명

Gets an ordered list of DefaultPreset based on the specified PresetType.

using UnityEditor.Presets;
using System.Linq;

public static class PresetUility { public static void InsertAsFirstDefault(Preset preset) { var type = preset.GetPresetType(); if (type.IsValidDefault()) { var list = Preset.GetDefaultPresetsForType(type).ToList(); list.Insert(0, new DefaultPreset(string.Empty, preset)); Preset.SetDefaultPresetsForType(type, list.ToArray()); } } }