When using VS to develop a u3d project, look at the declaration of a variable, such as the gameobject variable of a component, and see the following code
A look seems a bit dizzy, this code what meaning ah, just a public gameobject gameobject {get;}
This is a bit like a concise declaration of attributes:
But is that the truth? Tested, not so
Write a small program to verify that you know.
First write a DLL program, and then write a test program to reference the DLL, in the test program to use go to definition, we see that no matter how complex the properties defined in the DLL, go to definition can only see simple set; Get
The DLL program code is as follows:
Public classimsg { Public Virtual voidPrint () {}}Sealed Public classxmsg:imsg {stringmsg; Public stringMSG {Set { if(Msg. Length = =0) {msg="Init string"; } Else{msg=value; } } Get { returnmsg; } } Public Sealed Override voidPrint () {Console.WriteLine (msg); }
The code for the test program referencing the DLL is as follows:
class program { staticvoid Main (string[] args) { new Xmsg (); " Hello " ; Ox. Print (); } }
Using go To definition for xmsg we see the following code:
namespace classlibrary1{ publicsealedclass xmsg:imsg { public xmsg (); Public string Get Set ; } Public Sealed Override void Print ();} }
When we try to open the location of this file, we get the following, which is the temporary file generated by vs.
This shows that this file is only vs to us to preview the code for the definition of temporary generated files, not to be able to practice the source, such a file in the project is not normal execution, because it and our program original file has been too much difference.
GO to definition behind operation "VS2015 C #"