Inheritance relationships for common script classes of "Unity" (introductory article)

Source: Internet
Author: User

Objective

Beginners who learn the unity development engine are exposed to a large number of script classes, and the relationships between these classes are often easily overlooked.

In this paper, some common classes and their relationships in unity engine development are summarized briefly.


The starting address of the blog: Http://blog.csdn.net/duzixi


Unity common script class inheritance diagram



Knowing a little bit about unity development, there are 4 basic levels in the Unity Development Framework: Engineering (applications), scenes, game objects, and components.

In the script, the entire application and scene are controlled by the application class, and both the game object and the component class inherit from the object class.

In derived classes of the object class, there are also classes that most of them belong to resources and are part of the constituent components and game objects.

Some of the commonly used classes do not inherit from the object class in Unityengine, and the main function of these classes is to control the macro from a certain aspect.

In this sense, the application class and other classes with macroscopic control functions can be classified into one category.


In this way, the common scripting classes in unity can be easily divided into the following four categories:


First, macro control class

The main role is to do macro control on one aspect of the Unity program.

Including:

application--Application Classes

input--Input Class

gui--Graphics Output Class

physics--Physics engine class

resources--Resource Class

time--Time Class

Wait a minute


Second, the game object (Gameobject) class

Since unity is a component-oriented development pattern (not object-oriented), it can be seen from the inheritance relationships of classes:

For the Gameobject class there is not much ink, but more content is given to the following component class.


Third, component (Component) class

component classes in script development tend to correspond to the view panels in the graphical interface.

The details of each game object are set and manipulated with the help of component classes.

In a common component class, there are two inheritance relationships that need to be specifically mentioned:

(1) The role controller (Charactercontroller) class inherits from the Collider (Collider) class

(2) There is a set of classes that do not inherit directly from the component class, but inherit indirectly from the behavior class, including our well-known Monobehavior class

As for why this design class, in the introductory chapter is not discussed in depth. But we can first form a perceptual knowledge based on the existing cognition of these component classes.


Iv. Resource Categories

For beginners who are just getting started, resources are typically used directly after the graphical interface is imported.

There are not many scenarios for creating resources through scripts or modifying the resources themselves.

Personally, the mastery of resources is a very important step out of the beginner stage, and it is also an important means for code development to get rid of material limitations.


Post-language

On the way to color marked the foundation, expansion and advanced three categories.

This is for beginners, and for experienced unity developers, these commonly used classes should all belong to the "basics".

On the other hand, each person's learning route is different, the stage division will be not the same, for reference only.


The field is still shallow, welcome to the predecessors of the road to add.

Inheritance relationships for common script classes of "Unity" (introductory article)

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.