The problems needing attention in Unityscript

Source: Internet
Author: User

1. A label is declared in the attribute, and the type is specified as CC. Label, not CC. Node.

For example:

scoredisplay: {            defaultnull,            type:cc. Label},

2. Attribute Alto declaration, do not need to specify the type, only need to indicate URL,URL:CC. AudioClip.

For example:

Scoreaudio: {            defaultnull,            url:cc. AudioClip        },

3. Play the Sound:

Cc.audioEngine.playEffect (thisfalse);

4. Staging a reference to an object

// staging a reference to a script Gamemanager object properties: {        Gamemanager: {            defaultnull,            false         }}

You can get the position of the player property in Gamemanager by This.gameManager.player.getPosition ().

5. Calculate the distance of two points: Cc.pdistance ()

6. Destroy a node: This.node.destory ();

7. Delayed loading of scene resources: If the option is turned on, all the maps, particles, and sounds that the scene relies on directly or indirectly will be delayed until the scene switches to load, making the scene switch greatly faster. After entering the scene, the player may see some resources appear, and when activating the new interface, the elements of the interface may be displayed, so this loading method is more suitable for web games.

8.Cocos Creator can be used in image format, currently includes JPG and PNG two kinds.

 

The problems needing attention in Unityscript

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.