暂无描述
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

VirtualTextureInputMaterialSlot.cs 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using System;
  2. using System.Collections.Generic;
  3. using UnityEditor.Graphing;
  4. using UnityEditor.ShaderGraph.Drawing.Slots;
  5. using UnityEditor.ShaderGraph.Internal;
  6. using UnityEngine;
  7. using UnityEngine.UIElements;
  8. namespace UnityEditor.ShaderGraph
  9. {
  10. [Serializable]
  11. class VirtualTextureInputMaterialSlot : VirtualTextureMaterialSlot
  12. {
  13. public VirtualTextureInputMaterialSlot()
  14. {
  15. }
  16. public VirtualTextureInputMaterialSlot(
  17. int slotId,
  18. string displayName,
  19. string shaderOutputName,
  20. ShaderStageCapability stageCapability = ShaderStageCapability.All,
  21. bool hidden = false)
  22. : base(slotId, displayName, shaderOutputName, SlotType.Input, stageCapability, hidden)
  23. {
  24. }
  25. public override VisualElement InstantiateControl()
  26. {
  27. return null;
  28. }
  29. public override string GetDefaultValue(GenerationMode generationMode)
  30. {
  31. var matOwner = owner as AbstractMaterialNode;
  32. if (matOwner == null)
  33. throw new Exception(string.Format("Slot {0} either has no owner, or the owner is not a {1}", this, typeof(AbstractMaterialNode)));
  34. return matOwner.GetVariableNameForSlot(id);
  35. }
  36. public override void AddDefaultProperty(PropertyCollector properties, GenerationMode generationMode)
  37. {
  38. }
  39. public override void GetPreviewProperties(List<PreviewProperty> properties, string name)
  40. {
  41. }
  42. public override void CopyValuesFrom(MaterialSlot foundSlot)
  43. {
  44. }
  45. }
  46. }