Tag Archives: c#

Unity Component.isActiveAndEnabled Analysis of exact meaning

The following results are the test conclusions.

Isactive in hierachy is equivalent to whether a GameObject is active or not, which is the same as a simple understanding.

Isactive andenabled requires three conditions:

The isactiveinheerachy of

    GameObject is true, and onenable
is being or has been called

So:

    in onenable of a script, isactive andenabled is always true. In ondisable of a script, isactive andenabled is always false

 

Test example: place a GameObject in the scene and two scripts below. Set GameObject and scripts to be active. In the process of running the scenario, in the script that calls onenable first, you can find that your isactive andenabled is true, but another script’s isactive andenabled is false.

So: there is no script to call onenable, though gameObject.isActiveInHierachy Is true, and enabled is true, but isactive andenabled is false.

 

Compiler error message: cs1056: unexpected character handling

Error generation:
always returns an error when compiling a pre-existing program code using VS2015. strange In some added to the end of the class file some [] [] [] [], prompt Unexpected character, ‘application error.

A compilation error as shown in the title was caused by a special full-corner character in C# code. > special full-corner characters are not displayed and saved in UTF-8 format, and the compiler cannot correctly recognize such characters, resulting in compilation errors.

solution:
set the file open mode of VS 2015, make it contains a file with the Angle of all special characters use utf-8 format to open.
>
1) In Solution Explorer, select the file that needs special opening. 2) Right-click the mouse button to pop up the menu, select “Open Mode”, and use “Charp Editor with Encoding” to open.

Reproduced in: https://blog.51cto.com/studybao/2048899

Three methods of referencing DLL in Visual Studio 2015

Copy the DLL file to the directory where the executable is located
 
2. Transfer engineering attributes ->; Configure properties ->; Debugging – & gt; Change the working directory to the directory where the DLL files reside
 
3. Transfer engineering attributes ->; Configure properties ->; Debugging – & gt; Set the environment to the Path= DLL directory, for example: Path=$(SolutionDir)bin
 

Reproduced in: https://www.cnblogs.com/buyishi/p/10236780.html

Prompt “failed to load file or assembly” when VTK uses renderwindowcontrol

Possible reasons:

The Activiz.net library downloaded on the CPU version does not match the local CPU version

>

download Activiz.net source code compilation of anyCPU version of the library.

Activiz.net source: https://github.com/bitzhuwei/Kitware.VTK.git

>
>
>
>
>
>
>
>
>
>
>
>

2, select Kitware project right click modify project properties – “build -” target platform anyCPU compilation

=
=
=
=

OpenGL learning notes and other learning thinking

Recently, I have not written a blog for many days, which is a very bad habit. If you don’t summarize what you learn every day, you basically forget it all. So keep blogging.
Review of C# programming basics
Three key words:

    new: (1) : Create object. To carve out a space in the heap (the object is a reference type, so it carve out space in the heap), to create an object in the carve out space, and to call the class’s no-argument constructor

(2) : completely hide the parent class method of the same name means to inherit the child class and the parent class method of the same name, need to completely hide the parent class method of the use
2. This: (1) : Refers to the object of the current class, especially when used in constructors. That’s what this means
(2) : inherit its own constructor (usually inherit the most complete constructor)
3. Base: (1) : When a constructor from a parent class is used for inheritance
Interface design: (1) : the menu bar has data resources, satellite resources, service resources, plug-in resources, thematic space, global target, resource search
(2) : open, image mode, map mode, chart mode, 3D terrain, place name management, basic data setting, automatic hiding, full screen, help, login, exit
(3) : tool set includes: area measurement tool, text information lead and organization association, manual correction, image data management in application, distance measurement tool, spatial viewable area analysis, global basic image download
(4) : Title bar WPF, global target, display boundary line, landing, meteorological and hydrological data display, new sky empty box.
What is not clear: which space is used for the full screen display (that is, the toolbar is hidden and the top logo bar is removed) and the toolset?Decreases the transparency of the control if the implementation mouse is not over it.
 
OpenGL: Let’s look at functions first. Learning OpenGL for so long, the feeling is to know the OpenGL rendering process and all kinds of small details, and then is to learn all kinds of functions
1: Readback data from the cache object: GlGetBufferSubData
2. Direct access to data in cache: Glenum Target, Glenum Access
GlumMapBuffer () = glumMapBuffer ()
More accurate access mode: GlmapBufferRange (Glenum Target, GlintPtr Offset, GlSizeiPtr Length, GlBitField Access);
5: abandon part or data in the cache object: glinvalidateBufferData glinvalidateBufferSubData () ()
Style (GLuint index,GLint size,GLenum type, GLboolean normalized, GLsizei stide, const GLvoid*pointer); The initialized property pointer index is passed to this function.
Integer vertex property: glVertexAttribiPointer () does not perform an automatic conversion to a floating point number
Double vertex attribute: glVertexAttriblPointer () whose type must be DOUBLE
9: Compressed format of vertex attributes: ????????
The vertex properties of each property can be set using the GlvertexAttrib *() series of parameters
11: OpenGL drawing command: includes two parts
1: GlDrawElements (GLenum mode,GLsizei count, GLenum type,Const GLvoid* indices) uses count elements to define a set of geometric primitives. The element’s index value is stored in a cache bound up to GL_ELEMENT_ARRAY_BUFFER. Indices defines the offset address in the element array cache. This function reads information about vertices from the currently enabled array of vertex properties and uses them to build the primitive type specified by mode. The index data from the element array cache is used to index each vertex attribute array 2: non-indexed form: basic drawing command: glDraWarRays () directly selects and uses the vertex attributes in their own order in the cached object.
 

Reproduced in: https://www.cnblogs.com/Audient/p/7643832.html

When IntelliJ idea is programmed, 1. Black thick line or black cursor appears; 2. The solution of carriage return unable to wrap. (practical recommendation method 2)

Intellij idea programming 1. Black thick lines or black cursor 2. A solution that cannot wrap a line by carriage return. (Practical Recommendation Method 2)

reason: it is usually caused by accidentally pressing insert. Some computers abbreviate insert, putting Del and Ins together, and Ins is the insert key.
Method 1. Click Intellij Idea on the upper left corner of the main interface, File> Settings> The diagram below * * * *
Put him on the Use block caret, and you can get back to your old self. ***

Method 2 (recommended) : Press and hold the Fn+ INSERT key to restore directly.
note: do not press Fn+insert if Use block caret is checked, otherwise the enter key will fail to wrap.
PS: restore the enter enter key newline function solution:
cancel Use block caret in the check box (default is no check, no change can be ignored), and then hold down Fn+insert key, so that the cursor and return will return to the original.

SevenZipSharp

github:https://github.com/tomap/SevenZipSharp
The compression ratio is very high, with a 32-bit core of 64 bits

if (Environment.Is64BitProcess)
{
      SevenZipBase.SetLibraryPath("7z64.dll");
}
else
{
      SevenZipBase.SetLibraryPath("7z.dll");
}

Reference: https://www.cnblogs.com/gdouzz/p/7090710.html