Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by ali201910 · Nov 05, 2019 at 04:41 PM · uieditorfonts

How to find all missing fonts and fix them

A Unity project has had some changes in font and caused some fonts to be missing in prefabs and components. Is there an easy way to find all of the missing fonts so that we can reattach them?

alt text

missing-font.png (1.2 kB)
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by GrayLightGames · Nov 05, 2019 at 06:37 PM

Googling returned this site... have you tried this yet? https://www.gamasutra.com/blogs/LiorTal/20141208/231690/Finding_Missing_Object_References_in_Unity.php

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image ali201910 · Nov 05, 2019 at 09:32 PM 0
Share

Unfortunately the solution in the link did not seem to find missing fonts, but did help in that it helped find missing scripts: ![alt text][1] [1]: /storage/temp/148379-missing-scripts.png

I had found an updated version (for Unity 5.4+) of the gamasutra script at https://gist.github.com/ProG$$anonymous$$/a40acd8ebbb91eb7b2295e65d5eb42c8 and combined it with some of the changes in the gamasutra article's comments. Thank you for sharing, as finding missing scripts is helpful.

I think that for Fonts, I need something that finds missing Properties.

Since the editor is able to find them and show $$anonymous$$issing (Font) ins$$anonymous$$d, I am hoping there is a similar way to do it through an editor script, or maybe just through the editor somewhere.

Fonts seem to be stored in YA$$anonymous$$L as: m_FontData: m_Font: {fileID: value, guid: value, type: value} m_FontSize: etc...

missing-scripts.png (6.8 kB)
avatar image GrayLightGames ali201910 · Nov 05, 2019 at 10:04 PM 0
Share

Bummer, do you know which components you're looking for? I just tried pulling Text objects and checking GetInstanceID() for 0 and font for null like the linked script was doing and I got results... I did some testing and if missing, the instance ID is non-zero and the font is null. Little bit clumsy, but it worked for me. You could probably modify it to check all components if they have a font property, then run the check. If you're just targeting Text and a couple other components, just add a couple more if checks on the components and you'll be there. Hope that helps!

 foreach (var tempObj in Object.FindObjectsOfType(typeof(GameObject)))
         {
             GameObject tempGO = (GameObject)tempObj;
             Text tempText = tempGO.GetComponent<Text>();
             if (tempText != null && tempText.font.GetInstanceID() != 0 && tempText.font == null)
             {
                 Debug.Log(tempText.name + " has font ID " + tempText.font.GetInstanceID() + " " + (tempText.font == null));
             }
         }

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

220 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Make a pop up panel asking if I am sure I want to buy a specific item 0 Answers

How to instantiate multiple sprites without creating animation? 1 Answer

Creating variable height controls in the Editor 0 Answers

UI element not snapping into the middle of parent? 2 Answers

How do I set rect pivot? 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges