Search Unity

Information regarding undocumented Unity features

Discussion in 'Open Projects' started by DSivtsov, Dec 22, 2020.

  1. DSivtsov

    DSivtsov

    Joined:
    Feb 20, 2019
    Posts:
    151
    In project code time to times used undocumented different Unity features, can anyone to describe that they do:

    1. in EditorInitialisationLoader.cs
    Code (CSharp):
    1.     public int targetFramerate = 0; // For debugging purposes
    2.     private void Awake()
    3.     {
    4.         Application.targetFrameRate = targetFramerate; // For debugging purposes
    Which the reason to set this parameter into 0?
    From Unity docs:
     
  2. davejrodriguez

    davejrodriguez

    Joined:
    Feb 5, 2013
    Posts:
    69
    Hah I was just looking at this section of code a couple nights ago and thought the 0 was a little odd. After testing, it seems that 0 behaves the same as -1. So for practical purposes, I don't think this is that big of a deal. We could maybe add a tooltip explaining the behavior for different values?

    Along these lines, would it be beneficial to be able to change the target frame rate during play mode instead of just on Awake? Found myself changing the value in the inspector expecting a frame rate change before remembering it is only set in Awake.
     
    cirocontinisio likes this.
  3. cirocontinisio

    cirocontinisio

    Joined:
    Jun 20, 2016
    Posts:
    884
    It's just a thing I left there as I was debugging something in case I needed to use it later, I don't think we need to build a feature out of it right now.
     
    davejrodriguez likes this.