Cocos [who] make science who will run the floor

Copyright notice:

This article Original starting in the following website, you are free to reprint, but must include the full copyright notice

Blog Park MogooStudio: https://www.cnblogs.com/MogooStudio/
CSDN blog MogooStudio: https://blog.csdn.net/nmjkl001/

Final results

Here Insert Picture Description

Source Share

  • The following steps may differ with details of the source code, source code everything to prevail
  • CocosCreator Version: 2.1.2, be sure to use a large version of this engine runs
  • Source Address: https://github.com/MogooStudio/Runningfloor

Simple Steps

1. Create a Project (slightly)

2. Material box

  • Creating a Material box
  • Effect of the material property is provided for the box builtin-unit (built without illumination)
  • Check USE_DIFFUSE_TEXTURE (utility diffuse texture), click Apply
  • Drag the texture to texture in diffuseTexture
    Here Insert Picture Description

3. preform box

  • Creating 3D node Box, named box
  • Creating box.js script, see the contents of source code
  • Drag box.js script to the next preform box
  • Drag material to the preform MeshRanderer box assembly in the following Materials
  • Drag the folder prefab generated preform
    Here Insert Picture Description

4. Management node mgr

  • Create an empty node mgr, set the 3D node to node
    Here Insert Picture Description
  • X node is set about 480, y coordinate is 300, z coordinates 0

5. Canvas node

  • Creating main.js script, see the contents of source code
  • Drag main.js script to the next node Canvas
  • Drag mgr node assembly corresponding to the script main.js
  • Drag box preform to the corresponding component script main.js

6. Camera

  • Mode to set the main camera 3D, z coordinate to 800
  • Removing ortho check, set to 60 fov

my contact information:

QQ: 2161044579
E-mail: [email protected]
Github: https://github.com/MogooStudio

Guess you like

Origin www.cnblogs.com/MogooStudio/p/11597400.html