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
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

C# Compiler Should unity use csx as monobehaviour script instead of cs?

Discussion in 'Experimental Scripting Previews' started by Thaina, May 28, 2017.

  1. Thaina

    Thaina

    Joined:
    Jul 13, 2012
    Posts:
    1,158
    csx is the new way to write C# as script file. Which I think it better suit the way unity use a file as monobehaviour

    So I think we should have new standard way. We could write normal class that not a monobehaviour as .cs and deprecate also upbringing the old MonoBehaviour written in cs into csx
     
  2. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,921
    This is not something we have discussed internally, but we will keep it in mind. My biggest concern initially is how other tooling in the .NET ecosystem will handle .csx files (e.g. code editors). Thanks for the suggestion!
     
    Thaina likes this.
  3. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,204
    A monobehavior is a component though. It doesn't behave like a script at all. (ie - it doesn't execute when you run it). I think this would just confuse people and wouldn't fit the purpose of .csx.