Small white _unity Engine _ variable

Source: Internet
Author: User
Tags modifier

1     //variables that declare different modifiers in a script2     intNUM1;3     Private intnum2;4     protected intnum3;5      Public intnum4;6      Public intNUM5 = -;//The common type, which is displayed in the panel, is the NUM5 is serialized, saved up7 8[Serializefield]//customizable Extenders for private NUM6 serialization9     Private intNUM6 =Ten;Ten  One  A[Hideininspector]//let the shared variables not show -  Public intNUM7 =Ten;

    • Analytical:
  1. The default modifier is privateandnum1 is not displayed
  2. Private modifier variables are not displayed on the panel
  3. Protected modified variables are not displayed on the panel num3
  4. the public modified variables are displayed on the panel, the variables are serialized, and the num4 will display the corresponding type default value 0
  5. The public modifier type variable is assigned a value that displays the corresponding assignment NUM5
  6. [Serializefield] : Yes, you can not Inspect the variables displayed in the panel are displayed
  7. [Hidlelnspecter]: can be displayed in the Inspect Panel, has been serialized variables hidden

serialization: When reading again The variables that are serialized in Unity are valued and do not need to be assigned again because it has been saved. The next time you read, it is the value of your last assignment. That controls the attitude Property State

[Serializefield] Inherit from property Attitude , forcing Unity serializes a private (a private property can be serialized in Inspector display in the panel)

[Hidlelnspecter] makes a variable not appear in the Inspector panel, but is serialized. Will not be displayed, nor will it be called externally

Small white _unity Engine _ variable

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.