mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-19 14:52:40 +08:00
@@ -40,4 +40,5 @@ var Prefab = cc.Class({
|
||||
}
|
||||
});
|
||||
|
||||
cc._Prefab = module.exports = Prefab;
|
||||
cc.Prefab = module.exports = Prefab;
|
||||
cc.js.obsolete(cc, 'cc._Prefab', 'Prefab');
|
||||
|
||||
@@ -50,7 +50,7 @@ var Canvas = cc.Class({
|
||||
name: 'cc.Canvas', extends: require('./CCComponent'),
|
||||
|
||||
editor: CC_EDITOR && {
|
||||
menu: 'Canvas',
|
||||
menu: 'UI/Canvas',
|
||||
executeInEditMode: true,
|
||||
disallowMultiple: true
|
||||
},
|
||||
|
||||
@@ -54,7 +54,7 @@ var Label = cc.Class({
|
||||
extends: cc._ComponentInSG,
|
||||
|
||||
editor: CC_EDITOR && {
|
||||
menu: 'UI/Label'
|
||||
menu: 'Graphics/Label'
|
||||
},
|
||||
|
||||
properties: {
|
||||
|
||||
@@ -53,7 +53,7 @@ var SpriteRenderer = cc.Class({
|
||||
extends: require('./CCComponentInSG'),
|
||||
|
||||
editor: CC_EDITOR && {
|
||||
menu: 'Sprite',
|
||||
menu: 'Graphics/Sprite',
|
||||
inspector: 'app://editor/page/inspector/sprite.html'
|
||||
},
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ var Widget = cc.Class({
|
||||
name: 'cc.Widget', extends: require('./CCComponent'),
|
||||
|
||||
editor: CC_EDITOR && {
|
||||
menu: 'Widget',
|
||||
menu: 'UI/Widget',
|
||||
executeInEditMode: true,
|
||||
disallowMultiple: true,
|
||||
inspector: 'app://editor/page/inspector/widget/index.html'
|
||||
|
||||
@@ -12,7 +12,7 @@ var PrefabInfo = cc.Class({
|
||||
default: null,
|
||||
},
|
||||
|
||||
// 所属的 prefab 资源对象 (cc._Prefab)
|
||||
// 所属的 prefab 资源对象 (cc.Prefab)
|
||||
// (这个属性在场景中是会保存的,但是不会保存在 prefab 里面,因为创建 prefab 时还不知道自己的 uuid 是多少。)
|
||||
asset: {
|
||||
default: null,
|
||||
|
||||
@@ -265,22 +265,6 @@ var BaseNode = cc.Class(/** @lends cc.ENode# */{
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
* position of node.
|
||||
* @property position
|
||||
* @type {Vec2}
|
||||
*/
|
||||
position: {
|
||||
get: SGProto.getPosition,
|
||||
set: function (value) {
|
||||
this._position.x = value.x;
|
||||
this._sgNode.x = value.x;
|
||||
|
||||
this._position.y = value.y;
|
||||
this._sgNode.y = value.y;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* x axis position of node.
|
||||
* @property x
|
||||
@@ -1224,7 +1208,7 @@ var BaseNode = cc.Class(/** @lends cc.ENode# */{
|
||||
|
||||
// Define public getter and setter methods to ensure api compatibility.
|
||||
|
||||
var SameNameGetSets = ['name', 'skewX', 'skewY', 'rotation', 'rotationX', 'rotationY',
|
||||
var SameNameGetSets = ['name', 'skewX', 'skewY', 'position', 'rotation', 'rotationX', 'rotationY',
|
||||
'scale', 'scaleX', 'scaleY', 'children', 'childrenCount', 'parent', 'running',
|
||||
/*'actionManager',*/ 'scheduler', /*'shaderProgram',*/ 'opacity', 'color', 'tag'];
|
||||
var DiffNameGetSets = {
|
||||
@@ -1268,6 +1252,12 @@ var BaseNode = cc.Class(/** @lends cc.ENode# */{
|
||||
}
|
||||
})();
|
||||
|
||||
/**
|
||||
* position of node.
|
||||
* @property position
|
||||
* @type {Vec2}
|
||||
*/
|
||||
|
||||
/**
|
||||
* Scale of node
|
||||
* @property scale
|
||||
|
||||
@@ -534,7 +534,7 @@ var ParticleSystem = cc.Class({
|
||||
name: 'cc.ParticleSystem',
|
||||
extends: cc._ComponentInSG,
|
||||
editor: CC_EDITOR && {
|
||||
menu: 'ParticleSystem',
|
||||
menu: 'Graphics/ParticleSystem',
|
||||
inspector: 'app://editor/page/inspector/particle-system/index.html',
|
||||
playOnFocus: true,
|
||||
},
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ paths = {
|
||||
test: {
|
||||
src: 'test/qunit/unit/**/*.js',
|
||||
runner: 'test/qunit/lib/qunit-runner.html',
|
||||
jsEntryEditorExtends: '../../editor/share/engine-extends/index.js', // only available in editor
|
||||
jsEntryEditorExtends: '../editor/share/engine-extends/index.js', // only available in editor
|
||||
dest: 'bin/cocos2d-js-for-test.js',
|
||||
destEditorExtends: 'bin/cocos2d-js-extends-for-test.js'
|
||||
},
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
(function () {
|
||||
|
||||
if (!TestEditorExtends) {
|
||||
return;
|
||||
}
|
||||
|
||||
var Script;
|
||||
|
||||
module('test scene serialization', {
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
(function () {
|
||||
|
||||
if (!TestEditorExtends) {
|
||||
return;
|
||||
}
|
||||
|
||||
//var testingCompCallback = false;
|
||||
|
||||
var MyComponent = cc.Class({
|
||||
|
||||
@@ -1,17 +1,20 @@
|
||||
if (TestEditorExtends) {
|
||||
|
||||
test('undo destroy', function () {
|
||||
var Type = cc.Class({
|
||||
extends: cc.Object
|
||||
test('undo destroy', function () {
|
||||
var Type = cc.Class({
|
||||
extends: cc.Object
|
||||
});
|
||||
var obj1 = new Type();
|
||||
var record = Editor._recordObject(obj1);
|
||||
obj1.destroy();
|
||||
Editor._restoreObject(obj1, record);
|
||||
cc.Object._deferredDestroy();
|
||||
ok(obj1.isValid, 'it should be valid if restored before _deferredDestroy');
|
||||
|
||||
obj1.destroy();
|
||||
cc.Object._deferredDestroy();
|
||||
Editor._restoreObject(obj1, record);
|
||||
ok(obj1.isValid, 'it should be valid if restored after _deferredDestroy');
|
||||
});
|
||||
var obj1 = new Type();
|
||||
var record = Editor._recordObject(obj1);
|
||||
obj1.destroy();
|
||||
Editor._restoreObject(obj1, record);
|
||||
cc.Object._deferredDestroy();
|
||||
ok(obj1.isValid, 'it should be valid if restored before _deferredDestroy');
|
||||
|
||||
obj1.destroy();
|
||||
cc.Object._deferredDestroy();
|
||||
Editor._restoreObject(obj1, record);
|
||||
ok(obj1.isValid, 'it should be valid if restored after _deferredDestroy');
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user