Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

why i cannot edit source code under runtime scritps?

Discussion in 'Unity Render Streaming' started by chopin1998, Jan 24, 2022.

  1. chopin1998

    chopin1998

    Joined:
    Jan 29, 2019
    Posts:
    20
    i wanna edit VideoStreamSender.cs to change the low profile of default bitrate (seems only 300kbps).

    But once i change the code and unity recompile it, the file restore to orignal version? the code is generated by other code?

    How can I edit this?

    Thank you!
     
  2. kazuki_unity729

    kazuki_unity729

    Unity Technologies

    Joined:
    Aug 2, 2018
    Posts:
    803
    The package downloaded from Unity Package Manager is managed by Unity Editor, so editing scripts in the package is not allowed.

    If you want to edit scripts yourself, you need to copy the package to your local folder. See below.
    https://docs.unity3d.com/Manual/upm-ui-local.html
     
  3. chopin1998

    chopin1998

    Joined:
    Jan 29, 2019
    Posts:
    20
    that's cool, i git clone the package, import from local, now i can edit the code now.

    Thank you!

    if i wanna fix the bitrate temporally, i can modity "VideoStreamSender.cs" @line50

    Code (CSharp):
    1. encoding.maxBitrate = 1000000;
    right?
     
  4. kazuki_unity729

    kazuki_unity729

    Unity Technologies

    Joined:
    Aug 2, 2018
    Posts:
    803