Unity3d RPG game making with notes (2)

Source: Internet
Author: User

Hello everyone, I am a rock candy coffee, from Shandong, a junior Unity3d learner, recently through the Thai Course online learning "Unity3d RPG game development", write down something learned:

Water (Basic)

To add water to a river in the scene, here's a reminder that before Unity3d 5.0, you can find asset directly in the menu bar, click it Asset, click Import Package, and then click Water (Basic). The dialog box pops up and imports the resource bundle directly by clicking Import.

In the Unity3d 5.x release, the water pack is moved to environment, so you need to find environment in the import package, click the dialog box after you find water, click Imprort, import the resource bundle.

Skybox (Sky Box)

You can see the properties of the clear flags by clicking on the main Camera, which is supposed to be skybox,

However, we still need to add a Skybox plugin and drag the imported footage into it.

After that, the Sky box was finished.

Fog (Fog)We need to add a simple more fairy effect between the start of the game, so we add a hint of fog, and then let the lens by far and near an animated effect. Fog want to add, very simple, in the toolbar to find a window under the Lighting option, click will pop up a dialog box, the middle Scene option dropdown will find a Fog effect, check, you can see that Fog has three parameters: Fog Color "," Fog Mode "," Fog Density ", you can set their color, concentration. The linear, exponential, and Exp2 in "Fog Mode" are the influence factors that use different formulas to calculate fog.

(PS: "Fog mode" in the Linear mode will appear more "Linear Fog Start" and "Linear Fog End", this is used to control the fog distance. )

 

 

Moviecamera

The following is to achieve the lens from far and near the animation effect, first to create a C # script file named "MovieCamera.cs", assign it to Maincamera, and the z-coordinate of maincamera to 60;

Then write the code:

  

1 usingSystem.Collections;2 usingSystem.Collections.Generic;3 usingUnityengine;4 5  Public classMoviecamera:monobehaviour {6 7      Public floatSpeed = -;//Lens Movement Speed8     Private floatEndZ =- -;//lens termination z-coordinate9     //Use this for initializationTen     voidStart () { One          A     } -      -     //Update is called once per frame the     voidUpdate () { -         if(Transform.position.z < EndZ)//Has not reached the specified position and needs to be moved -         { -Transform. Translate (Vector3.forward * speed * time.deltatime);//Moving +         } -          +     } A}

If you feel too fast or too slow, you can change it directly in the properties of the Maincamera.

  

Unity3d RPG game making with notes (2)

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.