Search Unity

Undocumented (but public) DefaultExecutionOrder attribute

Discussion in 'Documentation' started by any_user, May 9, 2018.

  1. Rabadash8820

    Rabadash8820

    Joined:
    Aug 20, 2015
    Posts:
    94
    Then don't. You still don't need to hijack an existing thread.


    That is a personal issue that doesn't belong on this thread.

    Believe me, I've felt your frustration with Unity. I feel it almost every day lol. If you're done with Unity, then be done; no judgement here. But venting on the forums just gets everybody heated and helps no one.
     
    imwundev likes this.
  2. seoyeon222222

    seoyeon222222

    Joined:
    Nov 18, 2020
    Posts:
    187

    Is it really "same rules exactly"?
    - [DefaultExecutionOrder( value )]
    - Project Settings Add Script Execution Order (value)
    I'm having trouble with these two way causing different results.
    I was able to reproduce this in a light sample project.

    But there is no official document on this.
    So I'm reluctant to report because I'm not sure if this is a bug.
    There is an A class that inherits MonoBehaviour.
    There is B who inherits A
    Scene has GameObejct with B attached.
    Modifying A's DefaultExecutionOrder way, it works as intended.
    However, if you modify Project Settings way, with the same value, it does not work as intended.

    I'm not going to go deeper on this because I've roughly figured out the cause and the solution.

    Anyway
    I know this thread is about "documents",
    I don't want to discuss here a solution to the suspected bug.

    I'm just writing Reply because CharlesWard(Unity) comments on the DefaultExecutionOrder are in this thread.
     
  3. OxDEADFACE

    OxDEADFACE

    Joined:
    Jul 6, 2017
    Posts:
    33
    Back on topic, how hard is it really to add a new documentation page? Isn't most of the first pass generated by comments?

    oh wait just checked, the UnityEngine.CoreModule.dll has no comments for the DefaultExecutionOrder class... so that's why it's taken 5 years! :)

    Even if the content is literally just "See related page: https://docs.unity3d.com/Manual/class-MonoManager.html", at least that meets the minimum effort.

    My boring story = I've been using this attribute for years now, and now that I need to backport some internal package code to support a bunch of older Unity versions, I'm having to go figure out minimum versions for certain APIs. Anything and everything without even minimum-effort documentation is proving to be a real pain in the arse...
     
  4. tonytopper

    tonytopper

    Joined:
    Jun 25, 2018
    Posts:
    226
    Still undocumented.

    Another issue here is the values don't show up on the Script Execution Order in the Project Settings options, which from a UX standpoint, they should. That page in the Project Settings really should be a source of truth for Script Execution Order information in your project.

    Maybe DefaultExecutionOrder classes should be displayed in the Project Settings but be disabled since contradictory values in two places might be a headache.
     
    FlightOfOne and bdovaz like this.
  5. VirtusH

    VirtusH

    Joined:
    Aug 18, 2015
    Posts:
    95
    I personally wouldn't recommend using this attribute, it genuinely does not work for me and has caused me a LOT of pain.

    Right in the .meta files for my scripts, I can see no execution order defined and my scripts execute in the wrong order. :)