"Dumb Wood Unity" starter Tour 002: Don't talk about objects, let's talk about components

Source: Internet
Author: User

Today, someone asked me a question that has always been a problem: why do wood look so handsome?(Jor: Not a blind man asked a question casually, as for? )This, people don't ask me this question, I really do not know how to answer, I tried a lot of ugly methods, but all failed.


1. Still talking about the subject? We have a popular component here. Someone must have told you that in an object-oriented world, everything is an object. Now, you're going to go into Unity's world, and here, don't talk about objects, because, everything is a component.

cough, regular.(Jor: It's serious, not formal!) ), what is a component? In fact, the component is also the object, but the encapsulated object, a human can be from the foot, feet, hands, body, tail, wing composition.(Jor: You have tails, your whole family has tails ...) )Humans themselves this class is empty, it contains the other parts of the components, thus combining into a complete human, with human normal functions, such as walking, flying, drifting and so on.

We open the Unity Editor, open your new test project, by default there is a "Main Camera" object, click on it, you will see a bunch of properties on the right. Don't be afraid,

The arrow refers to the place, "add Component" is the meaning of "adding components", because it is afraid that everyone can not see, so the use of more than 2 arrows.(Jor: Do you think everyone is blind?) )That is, we can add many components to an object, which is made up of components such as scripts, sounds, coordinates, and materials that can be added to other objects as components.

in short, remember a key, five words: Everything is a component, everything is a component, everything is a component.

Well, more, we own Baidu, Google, lol go.

2. Language and Code Editor selection unity supports C # and JavaScript as scripting languages, and theoretically both of them can be chosen, depending on the actual situation of the people. If you are already familiar with JS, then choose JS, and vice versa. Wood Personal preference for C #, because it belongs to the more authentic programming language, JS is a scripting language, the wood of this series of tutorials will use C # as the development language.

If you think you can write code in the Unity editor, you're wrong, and the script code has to be written in another editor. Before unity by default is using Mono editor, I personally feel super hard to use, is super hard to use, super hard to use!(Jor: Be good, don't be noisy)

Now, Unity takes precedence over visual Studio, and I like to use vs because I'm used to it. It is recommended that you use VS2015 because it will bring the VS Tool for Unity, and you can debug the code on breakpoints.

But, for some reason, my notebook is always unable to debug, home and the company's desktop is no problem, if anyone knows why, please tell me, thank you very much.

3. The end of this article is very short, not finished, but I have another article to explain our favorite things--helloworld.

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

"Dumb Wood Unity" starter Tour 002: Don't talk about objects, let's talk about components

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.