The integration of Unity3d face test

Source: Internet
Author: User
Tags modifiers object model

The first part

1.Please describe the difference between a value type and a reference type
Answer: difference:
1. The value type is stored in the memory stack, the reference type data is stored in the memory heap, and the memory unit holds the address stored in the HEAP.
2. Value type access is fast, reference type access is SLOW.
3. Value types represent actual data, and reference types represent pointers and references to data stored in the memory heap.
4. Stack of memory is automatically freed, heap memory is. NET will be released by the GC from the DYNAMIC.
5. Value types inherit from system.valuetype, and reference types inherit from System.object.
Refer to Http://www.cnblogs.com/JimmyZhang/archive/2008/01/31/1059383.html
2.c#what is the base class for all reference types in
A: The base class of the reference type is the base class of the System.Object value type is System.ValueType
also, value types are implicitly inherited from System.Object
3.Please outlineArrayListand thelist<int>The main difference
A: ArrayList has an unsafe type ' (arraylist will treat all data inserted as Object)
Packing and unpacking operations (time Consuming)
The list is an interface, and ArrayList is a class that implements the interface and can be Instantiated.
4.Please outlineGC(garbage Collection) Causes and describes how to avoid them?
Answer: GC reclaims memory on Heap
Avoid: 1) reduce the number of times new objects are created
2) use common objects (static Members)
3) change the string to StringBuilder
5.Please describeInterfacedifferent from the abstract class
A: The abstract class indicates that there may already be some concrete definitions of the methods in the class, but the interface is the interface that the father-in-law can only define individual methods, not the specific implementation code in the member Method.
A class is a subclass that is inherited by a method that is not necessarily implemented in a subclass when the parent class already has an actual function, and the subclass can override the method of the parent class by directly referencing the method of the parent class.
When implementing an interface, you must implement all the methods in the interface, and you cannot omit any of them.


Reference http://www.cnblogs.com/seapub/archive/2012/08/08/2628433.html
6. How many temporary objects does the following code produce in the run?

A: actually, in C #, The first line is going to be wrong (it's possible in java). This should be initialized:

String b = new string (new char[]{' a ', ' b ', ' C '});
7. What happens when the following code is running? How to avoid it?

A: A run-time error occurs because foreach is Read-only. Cannot be modified while Traversing.
8.Please describe the key wordsSealedfunctions used in class declarations and function declarations
A: Class declarations can prevent other classes from inheriting this class, and declaring in a method prevents derived classes from overriding this Method.
9.Please outlinePrivate, public,protected,Internalthe Difference
For:
Public: open for any class and member, unrestricted access
Private: public only for this class
Protected: exposes the class and its derived classes
Internal: the class can only be accessed in the assembly that contains the class
Protected internal:protected + Internal
.How is reflection implemented?
A: Review metadata and collect the ability to type information about it.
Reference Http://blog.163.com/[email protected]/blog/static/1424776762011612115124188/
reflection, in the opinion of the individual, is to get the properties and methods in the Assembly.
Implementation Steps:
1, Import using system.reflection;
2,assembly.load ("assembly") Loads the assembly, and the return type is a Assembly
3, foreach (type type in assembly. GetTypes ())
{
String T = Type. Name;
}
Get the names of all classes in the assembly
4,type Type = assembly. GetType ("assembly. class name"); Gets the type of the current class
5,activator.createinstance (type); Create this type instance
6,methodinfo MInfo = Type. GetMethod ("method name"); Get Current method
7,minfo.invoke (null, Method parameter);
. Netwith theMonothe relationship?
Answer: Mono Official homepage
Mono is a software platform designed to allow developers to easily create
Cross platform Applications. Sponsored by Xamarin, Mono was an open source
Implementation of Microsoft's. NET Framework based on the ECMA standards for C # and the Common Language Runtime.
Mono is an Open-source cross-platform tool for. net, just like a Java virtual machine, Java itself is not a cross-platform language, but running on a virtual machine enables cross-platform.. NET can only run under windows, Mono enables Cross-platform runs,
can run on Linux,unix,mac OS and so On.
.Brief IntroductionUnity3dThe name of the language supported as a script
A: Unity's scripting language is run on The. net platform of mono and can be used With. net libraries, which also provides a good solution for issues such as xml, databases, regular expressions, and so On.
The scripts in unity are compiled, and they run Fast. These three languages actually function and run the same speed, the difference is mainly reflected in the language characteristics.
Javascript: Unlike javascript, which is commonly used in web pages, it can run quickly after compiling, and there will be a lot of differences in syntax.
C#
Boo: it can be seen as a variant of the Python language, and it blends the features of Ruby and C #, which are statically typed languages
13.unity3dDo you support writing multithreaded programs? What do you need to pay attention to if supported?
Answer: Reference http://www.unitymanual.com/3821.html
Only components that can access Unity3d from the main thread, objects and Unity3d system calls
Support: if you have to deal with a lot of things at the same time or interact with unity objects small can use thread, otherwise use COROUTINE.
Note: there is a lock keyword in C # to ensure that only one thread can access a specific object in a specific time period
14.unity3dthe co-process andC #What is the difference between threads?
Answer: http://blog.csdn.NET/kongbu0622/article/details/8775037
A multithreaded program runs multiple threads at the same time, and only one is running at any given time, and the running co-worker is suspended only when necessary. Threads other than the main thread cannot access Unity3d objects, components, methods.
Unity3d does not have a multi-threading concept, but Unity also gives us a way to Startcoroutine (co-program) and loadlevelasync (asynchronous load level) background loading scenarios. Why is startcoroutine called co-operation, the so-called synergy, is when you in the Startcoroutine function body processing a piece of code, the use of yield statements to wait for the results, this period does not affect the continuation of the main program, you can work together. While Loadlevelasync allows you to load new resources and scenes in the background, so again using synergy, you can use loading bar or animation to prompt the player game is not dead, while the background of collaborative loading matters asynchronous[e?? Synchronous Synchronization.
15.u3dThe name of the component in which to record the spatial geometry of the node, and its parent class name
A: The Transform parent class is Component
.briefly describe the effect of four yuan, four yuan on the advantages of Euler angle?
A: Four dollars is used to represent rotation
Advantages relative to Euler's angle:
1) can be rotated incrementally
2) avoid the Universal lock
3) There are two ways of expressing a given azimuth, each of which is negative (there are countless ways to express Euler angles).
.what is the point multiplication, cross-multiplication, and normalization of vectors?
1) the point multiplication describes the similarity of two vectors, the larger the result, the more similar the two vectors are, and the projection
2) the vector obtained by the fork is perpendicular to the original two Vectors.
3) normalization vector: used in the relationship only direction, do not care about the size of the time
.the significance and attention point of matrix multiplication
Used to represent linear transformations: rotation, scaling, projection, panning, affine
Attention to the creep of matrices: the accumulation of errors
.Why people are looking for on mobile devicesu3dnativeGUIan alternative solution
Not beautiful, Ongui is very time-consuming, inconvenient to use, Drawcall
.please briefly describe how to maintain at different resolutionsUIthe consistency
Ngui a good solution to this, the screen resolution of the adaptive, the principle is to calculate the screen aspect ratio with the original preset screen resolution to find a comparison value, and then modify the size of the CAMERA.
Native GUI http://unity3d.9ria.com/?p=2587
NGUI http://blog.csdn.Net/mfc11/article/details/17681429
.WhyDynamic Fontin theUnicodethe environment is better thanStatic Font
Unicode is a character encoding scheme developed by international organizations that can accommodate all the words and symbols in the WORLD.
When using dynamic fonts, unity will not pre-generate a character texture with all Fonts. When you need to support Asian languages or larger fonts, if you use normal textures, the font texture will be very large.
22.Renderthe role? DescriptionMeshrenderand theSkinnedmeshrenderthe relationship with different
A renderer is what makes an object appear on the Screen.

Mesh refers to the mesh of the model (the component with the same name is used to adjust the grid properties), Meshfilter is generally used to get the model grid components, and Meshrender is used to render the grid components,
Summary of the implementation principle of skinnedmesh
http://blog.csdn.net/n5/article/details/3105872
What happens when you place multiple Camera in a scene and are active at the same time?
A: The game interface can see a lot of camera mix
25.Prefab the role? How do I use it properly under the device of a mobile environment?
A: Prefab is used when instantiating, mainly for objects that are often used, properties are easy to modify
Http://www.cnblogs.com/88999660/archive/2013/03/15/2961663.html
How to destroy a unityengine.object and its subclasses
Answer: Destory
Why is there a data loss on the component in unity3d?
A: The object bound on the component has been deleted.
How to safely migrate asset data between different projects ? Three different methods
For:

Migrating the Assets directory with the library directory

Export Package

Assets Server features with Unity
29.MeshColliderand otherColliderone of the main points of difference?
A: Meshcollider is also based on the V3 vertex ~ ~ ~ or with the Boxcollider,boxcollider itself is based on algorithms, no face Concept.
.what happens when a small, high-speed object hits another larger object? How to avoid it?
Penetration (collision Detection Failure)
Http://forum.unity3d.com/threads/3353-collision-detection-at-high-speed
(collision body becomes larger, fixedupdate, code limit)
31.OnEnable,Awake,StartWhat is the order of the runtime? What can happen repeatedly in the same object cycle?
Answer: awake-"onenable-" Start
Onenable can occur repeatedly in the same cycle
Http://answers.unity3d.com/questions/217941/onenable-awake-start-order.html
.Please outlineonbecamevisibleandonbecameinvisiblethe timing of the occurrence, and the meaning of this pair of callback functions?
Answer: when the object is visible and Switched. Can be used for calculations that only need to be made when the object is Visible.
33.unity3dHow do I know what data needs to be loaded in the scene?
Answer: the topic is to obtain the meaning?
Resource.load
Assetbundle
34.MeshRenderinMaterialand thesharedmaterialthe difference?
Modifying the sharedmaterial will change the appearance of all objects using this material and also change the material settings stored in the Project.
Modifying the material returned by sharedmaterial is not recommended. If you want to modify the Shader's material, use material instead.

Part II

1. describe what kinds of game animations are and how it works.

There are mainly joint animation, single mesh model animation (keyframe animation), skeletal Animation.

The joint animation divides the character into several independent parts, one part corresponds to a mesh model, part of the animation is connected to a whole animation, the role is more flexible Quake2 used in this Animation.

The single network model animation is composed of a complete mesh model, which records the original position of each vertex and its change amount in the key frame of the animation sequence, then the interpolation operation realizes the animation effect, and the character animation is more Realistic.

Skeletal animation, widely used in animation, the integration of the advantages of the above two ways, bones by role characteristics of a certain level of structure, connected by joints, can do relative motion, the skin as a single mesh outside the skeleton, determine the role of the Appearance. Each vertex of the skin mesh is affected by the bone to achieve perfect animation. (skeletal Animation is a development of joint animation, now basically use skeletal animation to achieve character Animation)

2.alpha Blend Working principle

Actual display color = foreground color *alpha/255 + background color * (255-alpha)/255

3. Calculation formula of diffuse in lighting calculation

Actual illumination intensity i= ambient light (iambient) + diffuse reflection light (idiffuse) + specular highlight (ispecular);

Ambient light: iambient= aintensity* acolor; (aintensity indicates ambient light intensity, acolor indicates ambient light color)

Diffuse reflection light: Idiffuse = dintensity*dcolor*n.l;

(dintensity represents diffuse intensity, Dcolor represents diffuse light color, n is the normal vector for that point, and L is the light Vector)

Specular reflection light: Ispecular = sintensity*scolor* (r.v) ^n;

(sintensity indicates specular light intensity, Scolor represents specular light color, R is the reflection vector of light, V is the Observer vector, N is called specular light Index)

4.lod what is, What are the pros and cons

LOD technology is the abbreviation of levels of detail, which means a multi-level of detail. Lod technology refers to the location and importance of the object model node in the display environment, determines the resource allocation of object rendering, reduces the number of Non-important objects and the detail degree, and obtains the efficient rendering Operation.

Pros: models that render different details can be dynamically selected based on distance

Cons: heavier the burden of art, to prepare different details of the same model, the same will slightly increase the capacity of the Game.

5. Two methods of shadow judgment how it works

The shadow consists of two parts: Umbra and Penumbra

Umbra: areas on the surface that are not directly irradiated by the light source (all-black, clearly defined Areas)

Penumbra: areas on the surface that are directly irradiated by certain light sources but are not directly irradiated by all specific light sources (semi-dark Areas)

Method of seeking shadow region: do two blanking process

Each light source is hidden at a time to find the area L is not visible to the light source;

At once, the position of the viewpoint is hidden, and the surface s which is visible to the viewpoint is Obtained.

Shadow Area= L∩s

There are two types of shadows: self shadow and cast shadow

Self-shadowing: the light is not illuminated by the object itself, and some of it can be met.

Working principle: using the method of back culling, that is, assuming the position of the viewpoint in the point light source.

Cast Shadow: A shadow caused by an opaque object that obscures the light so that the object or area behind the object is not exposed to light.

Working principle: from the light source to all the objects can meet the projection of light, these faces projected into the scene to get the projected surface, and then the projection surface and other planes in the scene to cross out the shadow polygon, save the Shadow polygon information, and then the scene by the point of view of the corresponding processing to get the required views (using space to change time , each time only a shadow calculation based on the position of the viewpoint is required, eliminating the need for a blanking process)

This method is not valid if the dynamic light source.

5.Vertex Shader What is it? How to calculate?

A vertex shader is a program that executes on the GPU to replace the transformation and Lighting,vertex shader primary manipulation vertices in a fixed pipeline.

Vertex Shader completed the transformation of the input vertices from local space to homogeneous space (homogeneous spaces), homogeneous space, The next space in projection space. In the meantime there are several processes of World transformation, view transformation and projection transformation and Lighting.

6.MipMap What is it? Role?

A common technique in mapping rendering of three-dimensional computer graphics is called Mipmapping. To speed up rendering and reduce image aliasing, the map is processed into a series of pre-computed and optimized images that are called MIP maps or mipmap.

7. There are several ways to implement 2d games with u3d?

1. Using the Engine's own GUI

2. Set the camera to orthographic and use the patch as a 2d element

3. Using Third-party plugins: NGUI, 2dToolkit

8.u3d what is the difference between a collider and a trigger?

Collider Collider will have collision effect, Istrigger = false, can call oncollisionenter/stay/exit function

Trigger Trigger has no collision effect, Istrigger = true, can call ontriggerenter/stay/exit function

9. necessary conditions for collision of objects

Object A must be accompanied by (collider+rigidbody) or charactercontroller, and the other object must have at least collider

10.CharacterController the difference between the rigidbody and the

Rigidbody has the characteristics of completely real physics, and Charactercontroller can be said to be limited rigidbody, with certain physical effects but not completely true.

one . There are several stages in the event of an object collision, the corresponding function of each

Three stages, oncollisionenter/stay/exit function

12.u3d , several ways of exerting force are described.

Rigidbody. addforce/addforceatposition, all of Rigidbody's member functions

What is called chain joint

Hinge Joint, He can simulate two objects with a chain connected together, can maintain two objects within a fixed distance of each other to move without force, but reached a fixed distance will generate Tension. (simply said is the Spring)

What is the function called by the object to spin?

Transform. Rotate

What is the function called when the object rotates around a certain point?

Transform. Rotatearound

16.u3d provides a class for saving read data (playerprefs), listing functions for saving read shaping data

Playerprefs.setint and Playerprefs.getint

17.unity3d provides several light sources, what are the respective

Parallel lights: Directional Light

Spotlight: Spot Light

Point lights: dot Light

Regional light source: area lights (for baking only)

18.unity3d There is a life cycle from wake-up to destruction, please list several important methods that the system calls ITSELF.

awake–>onenable–> start–> update–> fixedupdate–> lateupdate–> ongui–> reset–> ondisable– > OnDestroy

What system function is the physical update generally in?

fixedupdate, Every fixed frame is executed once, and update is different fixedupdate is rendered frame execution, if your rendering efficiency is low, fixedupdate calls will be followed Down. The Fixedupdate comparison is applicable to the calculation of the physics engine because it is related to each frame rendering. Update is more appropriate for Control.

what function is the mobile camera action in, and why is it in this function?

lateupdate, which is only tuned after all update finishes, is more appropriate for command script Execution. Official online example is the camera follow, all the update operation is done before the camera, or there may be a camera has been pushed, but the perspective of the role of the empty frame Appears.

What do we need to do to save memory when we need to create an object frequently in the game?

To be a pool, the game starts with a sufficient number of pre-instancing, and then takes it back when it's not Used.

What happens when a scene places multiple camera and is active at the same time

The actual picture is made up of multiple camera images, and the final synthesis effect is influenced by depth, Clear Flag, and culling mask.

Summary of the use and environment of prefab

In the game runtime instantiation, prefab equivalent to a template, to your existing footage, scripts, parameters to make a default configuration, in order to modify later, while prefab packaged content simplifies the operation of the export, easy to communicate with the Team.

How to destroy a Unityengine.object and its subclasses

Destroy

Why is there a case of data loss on the component u3d ?

Objects that are bound to the assembly are usually deleted.

26.u3d how to safely migrate asset data in different projects

Method 1, The Assets directory and the library directory can be migrated together,

Method 2, Export the package

Method 3, using the Assets Server feature with Unity

Part III

1 . What is a render pipeline?

Refers to a series of necessary actions to be taken on a display to display an Image. Many of the steps in the rendering pipeline are to transform a geometric object from one coordinate system to another.

The main steps are:

Raster-------------------------------with

2 . How to optimize memory?

There are many ways, such as

1. Compress the own class library;

2. Hide the objects that need to be used in the future, instead of destroy them directly;

3. Release the resources occupied by assetbundle;

4. Reduce the partial number of the model, reduce the number of bones in the model, reduce the size of the map;

5. Using a light map, using multi-level detail (LOD), using shaders (Shader), using presets (Prefab).

3 , how to dynamically load resources? (sometimes also ask the difference, specific please baidu)

1.resources.load ();

2.AssetBundle

4 , what is a synergistic program?

Enables the execution of the current program by opening another logical process while the main thread is Running. In other words, the open process is to open a thread. Can be used to control motion, sequence, and behavior of Objects.

5 , which plugins have you used?

(preferably more familiar with a few plug-ins, ask when good answer)

Fourth part

1. What is the inverse rotation animation method?

2. What are the properties of the object for collision detection?

3. Implementing a third role controller in code

4. realize the function of crane hanging object

5. What are the commands for acquiring, adding, and deleting components?

Get: getcomponent

Added: addcomponent

Delete: Destroy

6.animation.crossfade the command function is: (C)

A. Animation amplification B. Animation conversion C. Animation fade in to other animations

7.application.loadlevel the command is: (A)

A. Loading A level B. Loading A level asynchronously C. load action

8. What are the commands for debugging records to the console?

Debug.Log ();

9. What is the editor class storage path?

Under the Assets/editor folder in the project Directory.

What is the command to create a window that can be dragged using the native gui?

Gui. Dragwindow ();

11.localPosition what is the difference between the use and position?

Localposition: the location of its own position, relative to the Parent's Transformation. Position: position in world coordinates transform

meaning connection

Mathf.round rounding

Mathf.clamp restrictions

Mathf.lerp interpolation

Write a timer tool, starting from the hour, the format is: 00:00:00

Five Ways to write a animation

How to get an object on the script method

Gameobject.getcomponent<> ();

on the topic : Use the mouse to achieve in the scene drag objects, with the mouse wheel to zoom (with a cube).

Please describe the point multiplication of vectors, the cross-multiplication of vectors and the geometrical meanings of vector normalization.

The geometric meaning of the point multiplication is to calculate the angle between the two vectors and the projection in a certain direction;

The geometric meaning of the cross-multiplication is to create a vector perpendicular to the plane, triangle, or polygon; reference: http://blog.sina.com.cn/s/blog_9283b6f601017hfw.html

Fifth part

1 , what's wrong with Static before the constructor of the class?

The constructor is formatted as a public+ class name if you add static to the error (static constructors cannot have access Modifiers)
Cause: the static constructor does not allow access to modifiers, nor does it accept any parameters;
Static constructors execute only once, regardless of how many types of objects are created;
The runtime calls the static constructor before the runtime creates the class instance or accesses the static member for the first time;
A static constructor executes a constructor that precedes any instance level;
It is also obvious that this and base cannot be used to invoke Constructors.
2 , what are the advantages of C # string types over StringBuilder types?

If you are working with strings, you need to create a new string object each time using the method in string and assign a new memory address, while StringBuilder is modifying the string in the original memory. So in the case of string processing, it is recommended to use StringBuilder to save Memory. however, the methods and functions of the string class are still stronger than the StringBuilder class.

Because the string class is immutable (that is, any change to a string object is actually an object that creates another string class), it is recommended that you use the StringBuilder class when you need to make frequent changes to a string class Object. The principle of the StringBuilder class is to first open up a certain amount of memory space in memory, when changes to this StringBuilder class object, if the memory space is not large enough, this memory space will be expanded, rather than recreate an object, This way, if a string object is frequently manipulated, does not cause excessive memory waste, in fact, there is no very big difference, are used to store and manipulate strings, the only difference lies in Performance.

String is mainly used for public apis, good versatility, wide usage, high reading performance, and small memory Consumption.

StringBuilder is mainly used for splicing string, modified performance is Good.

But now the compiler has the string of the + operation is optimized to StringBuilder, so the general use of string can be

The string is immutable, so natural threads are Synchronized.

StringBuilder variable, non-threaded Synchronization.

http://zhidao.baidu.com/question/240364840.html?qbl=relate_question_0&word=String%C0%E0%D0%CD%B1% C8stringbuilder%c0%e0%d0%cd%b5%c4%d3%c5%ca%c6
3 , How does the C # function func (string a, string b) be written with a lambda expression?

Answer: https://msdn.microsoft.com/zh-cn/library/bb397687.aspx
4, Series 1,1,2,3,5,8,13 ... What is the nth digit? implementation of C # recursive algorithm

The general formula should be an = a (n-1) + a (n-2)

A3=2=1+1
A4=3=1+1+1
A5=1+1+1+2
A6=1+1+1+2+3
.........
an=1+1+1+2+3+...+ (n-2) + (n-3)
=2+ (n-2) (N-3)/2 (n>=3) This is the general formula, as for recursion? ...


5 , a simple game, monsters will move around \ attack \ death, The game character will move around, jump \ Attack \ Block \ death, will also accept the player input from the input instructions, NPC will move around, they can communicate with each other. please draw a UML diagram of the three characters Above.

For:
6 , NGUI button How to accept the user click and call the function, the exact method name is what

OnClick ()

It is mainly in the Uicamera script to judge the clicked object with the ray and call the onclick () onpress () function through sendmessage, it can be said that the Ngui button is called by sending the message this Way.
7 , how to tell if two planes intersect? cannot use collision body, say calculation method

For:

Https://www.baidu.com/s?wd= how to determine whether two planes intersect &rsv_spt=1&issp=1&f=3&rsv_bp=1&rsv_idx=2&ie= utf-8&tn=baiduhome_pg&rsv_enter=0&rsv_pq=abcac720000083b6&rsv_t=ecdctoxqnurcfx% 2fvm8mqdptiblttyo4hqjrz1ynsncxuqde6dm4ovlqt4hdhzjmh6gut&inputt=2590&oq=c%23%20lamb&rsv_n=2&bs= C%23%20lambda

8, < Angry Birds > given the initial speed, how to let the bird be affected by gravity and air resistance to draw a parabolic trajectory, say the specific calculation method.

Vector3 v represents the initial speed of V ' represents the current speed, assuming that the bird is along the z axis that is the transform.forward direction of movement of the mass of 1, then V ' =v-new Vector3 (0,g*t,f*t), transform. Translate (v ') is the parabolic motion (g for gravity acceleration do not use the actual need to debug themselves, F for Resistance also to debug settings, T for Time)

Unity3d face question integration

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.