You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -14,9 +14,8 @@ One more thing, Facebook Integration for Cocos2d-JS have brought a huge opportun
14
14
15
15
* Added new 3D features: Skybox and Terrain.
16
16
* Upgraded support of Cocos editor to the latest version.
17
-
* Added `enumerateChildren` function which support powerful children searching with name and patterns.
18
-
* Added `cc.sys.isObjectValid` for detecting famous `Invalid Native Object` issue.
19
-
* Reactivated Firefox remote debug functionality with SpiderMonkey v33, refer to the [manual document](http://cocos2d-x.org/docs/manual/framework/native/v3/js-remote-debugger/en).
17
+
* Added `enumerateChildren` function which support powerful children searching in the child node tree with name and patterns.
18
+
* Added `cc.sys.isObjectValid` for detecting node's validity to prevent the famous `Invalid Native Object` issue.
20
19
21
20
## Notice
22
21
@@ -28,7 +27,7 @@ For JSB build, there are some restrictions :
#Upgrade guide from Cocos2d-JS v3.5 to Cocos2d-JS v3.6
2
+
3
+
## 0. Upgrade to Cocos2d-JS v3.5
4
+
5
+
If you are still using Cocos2d-html5 or previous version of Cocos2d-JS, you may need to read the previous upgrade guides first : [Historic upgrade guides](../../en.md)
6
+
7
+
## 1. [Native Exclusive] New 3D features
8
+
9
+
We have bound two new 3D features to JSB, the skybox and the terrain. Please note that they are native engine exclusive features, you can not use 3D classes in the web engine. We are not planning to support 3D for the web in the near future.
10
+
11
+
New 3D classes or objects are listed here:
12
+
13
+
```
14
+
jsb.Terrain
15
+
jsb.TextureCube
16
+
jsb.Skybox
17
+
```
18
+
19
+
To know how to use the new 3D modules, please refer to the following documents:
20
+
21
+
- Cocos [3d module's API reference](http://www.cocos2d-x.org/reference/native-cpp/V3.5/dir_0cec398151724e9e1c180a4e8f99801b.html)
22
+
- Cocos [Camera API reference](http://www.cocos2d-x.org/reference/native-cpp/V3.5/d6/d2b/classcocos2d_1_1_camera.html)
23
+
- Cocos [Light API reference](http://www.cocos2d-x.org/reference/native-cpp/V3.5/d2/d85/classcocos2d_1_1_base_light.html)
24
+
- Test cases in the Cocos2d-JS v3.6 package, run it with projects in `build` folder or using `cocos run` command under `samples/js-tests` folder. You can refer to the following test cases:
25
+
- BillBoardTest: source code in `samples/js-tests/src/BillBoardTest`.
26
+
- Camera3DTest: source code in `samples/js-tests/src/Camera3DTest`.
27
+
- LightTest: source code in `samples/js-tests/src/LightTest`.
28
+
- Sprite3DTest (include Skybox test): source code in `samples/js-tests/src/Sprite3DTest`.
29
+
- TerrainTest: source code in `samples/js-tests/src/TerrainTest`.
30
+
- Cocos2d-JS v3.5 ported [FantasyWarriors 3D source code](https://github.com/joshuastray/fantasywarrior)
31
+
32
+
## 2. New API `cc.sys.isObjectValid`
33
+
34
+
We have provided a new API : `cc.sys.isObjectValid` for detecting whether an object is still valid. The detection is different for web engine and native engine.
35
+
36
+
```
37
+
var valid = cc.sys.isObjectValid(object);
38
+
```
39
+
40
+
In the web engine, the object is valid as long as it's not `null` or `undefined`.
41
+
42
+
In native engine, this API will return true if the JS object and the correspond native object are both valid. Our developers always complain about `Invalid Native Object` error, well, this is because in the native engine, a bound cocos object reference to a JavaScript object and a Native C++ object. JavaScript objects' life cycle is automatically managed by JavaScript garbage collection mechanism, while the native objects' life cycle is managed by Cocos2d reference count system. So it's possible that an object's JavaScript reference still exist, but its C++ reference may already be released in the native environment. At this point, if your code try to access to the native methods of this object, it will report `Invalid Native Object` error.
43
+
44
+
This new API can help you out to detect whether an object have been released in runtime, it's useful for avoiding potential issues and especially useful for debugging and finding out the real issue in your code.
45
+
46
+
## 3. Cocos Console support output directory
47
+
48
+
In the new version, Cocos Console support fully output directory with `-o` option.
49
+
50
+
```
51
+
cocos compile -p web -m release -o ../www_released/
52
+
```
53
+
54
+
This command can publish the web version to `../www_released/` folder. It accepts both relative path and absolute path.
0 commit comments