Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Bug create Sprite Asset failed

Discussion in 'UGUI & TextMesh Pro' started by dujimache, Jul 20, 2021.

  1. dujimache

    dujimache

    Joined:
    Dec 17, 2011
    Posts:
    89
    Unity 2021.2.0b4
    Windows 10

    this happed when create a normal Sprite Asset, the created Sprite Asset doesn't have default material. and reported an error:
    ArgumentNullException: Value cannot be null.
    Parameter name: shader
    UnityEngine.Material..ctor (UnityEngine.Shader shader) (at <034e42dfc48f4911988983b3b27bcd25>:0)
    UnityEditor.TextCore.Text.SpriteAssetCreationMenu.AddDefaultMaterial (UnityEngine.TextCore.Text.SpriteAsset spriteAsset) (at <25d994ff94654526a66174847abc66e1>:0)
    UnityEditor.TextCore.Text.SpriteAssetCreationMenu.CreateSpriteAsset () (at <25d994ff94654526a66174847abc66e1>:0)


    upload_2021-7-20_21-4-23.png
     
  2. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    Are you trying to use TMP or UI Toolkit?

    In the case of UI Toolkit, when TextCore was migrated from a package to an internal module, the shaders contained in the package were never migrated which is why the above error occurs. There is a PR in flight to address this issue and the fix will be contained in a future Unity release.
     
  3. dujimache

    dujimache

    Joined:
    Dec 17, 2011
    Posts:
    89
    i want to use the sprite asset in UIToolkit, and the uitoolkit is internal module,not a package.