Results 1 to 4 of 4

Thread: #pragma strict

  1. #1
    Join Date
    Apr 2007
    Location
    Seattle
    Posts
    214

    #pragma strict

    [#pragma strict]

    I have seen many people using this in their code on the unity forums. So I'm wondering what it means and why is it useful?

  2. #2
    Join Date
    Dec 2002
    Location
    Norway
    Posts
    450
    It's used in unityscript, and I believe it is to force you to write static code. Javascript is a dynamic language, and forcing the code to be static, saves resources at runtime.

  3. #3
    Join Date
    Apr 2007
    Location
    Seattle
    Posts
    214
    Quote Originally Posted by Metanol View Post
    It's used in unityscript, and I believe it is to force you to write static code. Javascript is a dynamic language, and forcing the code to be static, saves resources at runtime.
    Thanks for the info. That being the case then there is no reason to worry about it when writting in C# correct?

  4. #4
    Join Date
    Dec 2002
    Location
    Norway
    Posts
    450
    No, you don't have to worry about it in C#. I don't think it would be valid code, and it wouldn't have made a difference anyway, since C# is a statically typed language.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •