A fellow villager talked to me about the basic interview questions for a large company in Shanghai. The interview results were not satisfactory, but I still shared the interview questions. I sang the video for the first time and gave lectures to someone, I felt quite patient, but I found some disadvantages of beginner's entry-level learning, which may be a common phenomenon. This also verifies what I said earlier, sometimes the effect of watching video learning is not very good, and there is little exercise. I feel like I am "Understanding" when I look at the teacher, but I am not really familiar with it. I am not here to criticize someone, hope someone doesn't mind! 1. It is easy to satisfy and be impetuous. The so-called "Full bottle does not move, half bottle shake", when I talk about it, during demonstration operations, she always says I know, I understand, don't repeat it, but it's your turn to write it! When learning, we still need to keep a humble heart and learn with an open mind! 2. Careless. When I heard her say she understood it and she knew it, I wrote a question to test whether she had mastered it. Then I wrote it after a while, I don't feel right. I told her to "translate" what she wrote. Then I thought It was different from what I thought. Sometimes the same is true for the exam. I felt confident when I walked out of the test room, however, after the score, I thought it was incredible. I believe the teacher corrected the exam! In fact, what I want to say is careless!
After talking about this phenomenon, let's go to the topic and share a basic test question for a large game company in Shanghai!
1. What is the difference between Collider and Trigger in Unity?
The Collider has a collision effect. IsTrigger = false. You can call the OnCollisionEnter/Stay/Exit function.
Trigger has no collision effect. isTrigger = true. You can call the OnTriggerEnter/Stay/Exit function.
2. What are the necessary conditions for collision?
It must contain the collider and rigibody attributes or the character controller. In fact, the character controller includes the first two, and the other object must also contain the Collider and Collider classification: Grid collision, box dashboard, capsule dashboard, ball dashboard, and terrain dashboard!
3. What is the difference between CharacterController and Rigidbody?
Rigidbody is completely physical, and CharacterController is a restricted Rigidbody, which has certain physical effects but is not completely real.
4. How many stages are involved in an object collision, corresponding functions?
Three phases: OnCollisionEnter/Stay/Exit function
5. How many ways of applying pressure to an object during collision are described?
Rigidbody. AddForce/AddForceAtPosition, all member functions of rigidbody
6. What types of light sources does Unity3d provide?
Four types: DirectionalLight, PointLight, SpotLight, and AreaLight (used for baking)
7. Which system function is physical update generally in?
FixedUpdate is executed every time a fixed frame is drawn. Unlike update, FixedUpdate is used to render frames. If your rendering frame is inefficient, the number of FixedUpdate calls will decrease. FixedUpdate is suitable for physical engine computing because it is related to the rendering of each frame. Update is more suitable for control.
8. In which function does a Mobile Camera move? Why.
LateUpdate is called only after all updates are completed. It is suitable for Executing command scripts. In the example on the official website, the camera follows up after all update operations are completed. Otherwise, the camera may have been pushed forward, however, there is no empty frame for the role in the perspective.
9. Briefly describe the use of Prefab?
During Game runtime instantiation, prefab is equivalent to a template that makes a default configuration for your existing materials, scripts, and parameters for later modification, the prefab package simplifies the export operation and facilitates communication between teams.
10. Briefly describe the object pool. What do you think is suitable for using the object pool in FPS games?
The object pool stores a space for resources that need to be repeatedly called, such as objects, bullets, enemies, and any repeated objects that need to be frequently copied in the game.
11. I will not elaborate on the last question. It's not too early. You should take a nap. You can refer to this to imitate it:
1. When the server guard is standing normally, the server is idle;
Initialize the state machine and put the idle state into the state machine stack as the initial state. The state machine Stack: [idle]
2. When an attacker discovers the enemy and the enemy is within the range of range, the attacker starts to attack the enemy. At this time, the attacker enters the attack state;
Enter the Attack Status; state machine Stack: [attack] [idle]
3. When the enemy dies, the attacker stops the attack. At this time, the attacker returns to idle state;
Exit the current status; state machine Stack: idle]
4. At this time, the player issues an attack command. The attack command uses the key to point A distant ground place1, that is, there is no specific target attack. At this time, the attacker enters the mobile attack status;
Enters the mobile Attack Status; state machine Stack: [mobile attack] [idle]
5. During the movement, the attacker finds the enemy, so he wants to break away from the original path and go to the target enemy. At this time, the attacker enters the chasing status;
Enter the chasing status; state machine Stack: [chasing] [mobile attack] [idle]
6. When the distance between the gunshots and the enemy is less than their own range, the Gunshots stop and attack the enemy. At this time, the gunshots are under attack;
Switch to the attack status; state machine Stack: [attack] [mobile attack] [idle]
7. After the enemy dies, the gunshots re-seek the path to place1 and proceed. At this time, the gunshots return to step 4 and return to the mobile attack status.
Exit the current status; state machine Stack: [mobile attack] [idle]