Search Unity

Ignore missing script warnings

Discussion in 'Scripting' started by PatHightree, Aug 31, 2018.

  1. PatHightree

    PatHightree

    Joined:
    Aug 18, 2009
    Posts:
    297
    I've got an assed bundle created by a 3rd party which spams 1000's of missing script warnings at load time.
    This is due to the fact that the dll the script depends on is missing.

    I hope to improve load times by ignoring the warning message.
    I have found this trick to disable specific warnings by means of listing the warning numbers in a smcs.rsp file.
    Now I need the warning number of the missing script warning.... anybody know how to obtain that ?

    Thanks in advance,
    Patrick
     
  2. Doug_B

    Doug_B

    Joined:
    Jun 4, 2017
    Posts:
    1,596
    It will be the number that is displayed as part of the warning message itself.

    So for example, to disable this warning :
    warning CS0649: Field '<class>.<member>' is never assigned to, and will always have its default value null
    , you can use
    #pragma warning disable 649
    .
     
  3. PatHightree

    PatHightree

    Joined:
    Aug 18, 2009
    Posts:
    297
    That's the problem, there's no number displayed because it is a Unity asset warning, not a C# compilation warning.

    All that is displayed is:
    "The referenced script on this Behaviour is missing!"
     
    Last edited: Sep 7, 2018
  4. Doug_B

    Doug_B

    Joined:
    Jun 4, 2017
    Posts:
    1,596
    Have you tried something like this script to find all missing links? Then you can remove them from the offending objects.

    Alternatively, are you able to approach the asset vendor to get a fixed version?
     
    FernandoHC likes this.
  5. PatHightree

    PatHightree

    Joined:
    Aug 18, 2009
    Posts:
    297
    AH, thanks for pointing out that script, that's gonna come in handy !
    I'll have access to the source asset soon, then I'll be able to trouble shoot it and inform the author on what to fix.

    I was looking for alternatives on how to curb the amount of error messages, as these seem to be affecting the load times of the asset.