mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 08:02:39 +08:00
tweak api syntax
This commit is contained in:
@@ -467,9 +467,8 @@ cc.Director = Class.extend(/** @lends cc.Director# */{
|
||||
* Run a scene. Replaces the running scene with a new one or enter the first scene.
|
||||
* @method runScene
|
||||
* @param {Scene} scene - The need run scene.
|
||||
* @param {Function} [onBeforeLoadScene] - The function at the scene before loading.
|
||||
*/
|
||||
runScene: function (scene, onBeforeLoadScene) {
|
||||
runScene: function (scene, _onBeforeLoadScene) {
|
||||
cc.assert(scene, cc._LogInfos.Director.pushScene);
|
||||
|
||||
// detach persist nodes
|
||||
@@ -492,8 +491,8 @@ cc.Director = Class.extend(/** @lends cc.Director# */{
|
||||
// purge destroyed nodes belongs to old scene
|
||||
cc.Object._deferredDestroy();
|
||||
|
||||
if (onBeforeLoadScene) {
|
||||
onBeforeLoadScene();
|
||||
if (_onBeforeLoadScene) {
|
||||
_onBeforeLoadScene();
|
||||
}
|
||||
this.emit(cc.Director.EVENT_BEFORE_SCENE_LAUNCH, scene);
|
||||
|
||||
@@ -544,10 +543,9 @@ cc.Director = Class.extend(/** @lends cc.Director# */{
|
||||
* @method loadScene
|
||||
* @param {String} sceneName - The name of the scene to load.
|
||||
* @param {Function} [onLaunched] - callback, will be called after scene launched.
|
||||
* @param {Function} [onUnloaded] - callback, will be called when the previous scene was unloaded.
|
||||
* @return {Boolean} if error, return false
|
||||
*/
|
||||
loadScene: function (sceneName, onLaunched, onUnloaded) {
|
||||
loadScene: function (sceneName, onLaunched, _onUnloaded) {
|
||||
var uuid, info;
|
||||
if (this._loadingScene) {
|
||||
cc.error('[loadScene] Failed to load scene "%s" because "%s" is already loading', sceneName, this._loadingScene);
|
||||
@@ -582,7 +580,7 @@ cc.Director = Class.extend(/** @lends cc.Director# */{
|
||||
}
|
||||
if (uuid) {
|
||||
this._loadingScene = sceneName;
|
||||
this._loadSceneByUuid(uuid, onLaunched, onUnloaded);
|
||||
this._loadSceneByUuid(uuid, onLaunched, _onUnloaded);
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -1089,24 +1089,38 @@ if (cc.sys.isNative) {
|
||||
|
||||
/**
|
||||
* @event position-changed
|
||||
* @param {cc.Event} event
|
||||
* @param {cc.Vec2} event.detail - old position
|
||||
*/
|
||||
/**
|
||||
* @event rotation-changed
|
||||
* @param {cc.Event} event
|
||||
* @param {Number} event.detail - old rotation x
|
||||
*/
|
||||
/**
|
||||
* @event scale-changed
|
||||
* @param {cc.Event} event
|
||||
* @param {cc.Vec2} event.detail - old scale
|
||||
*/
|
||||
/**
|
||||
* @event size-changed
|
||||
* @param {cc.Event} event
|
||||
* @param {cc.Size} event.detail - old size
|
||||
*/
|
||||
/**
|
||||
* @event anchor-changed
|
||||
* @param {cc.Event} event
|
||||
* @param {cc.Vec2} event.detail - old anchor
|
||||
*/
|
||||
/**
|
||||
* @event color-changed
|
||||
* @param {cc.Event} event
|
||||
* @param {cc.Color} event.detail - old color
|
||||
*/
|
||||
/**
|
||||
* @event opacity-changed
|
||||
* @param {cc.Event} event
|
||||
* @param {Number} event.detail - old opacity
|
||||
*/
|
||||
|
||||
Node.EventType = EventType;
|
||||
|
||||
@@ -61,6 +61,7 @@ var Canvas = cc.Class({
|
||||
/**
|
||||
* Current active canvas, the scene should only have one active canvas at the same time.
|
||||
* @property {Canvas} instance
|
||||
* @static
|
||||
*/
|
||||
instance: null
|
||||
},
|
||||
|
||||
@@ -218,16 +218,6 @@ var _metaClass = {
|
||||
|
||||
if (CC_DEV) {
|
||||
Object.defineProperty(this.prototype, name, {
|
||||
//set: function setter_editorWrapper (value) {
|
||||
// if (this._observing) {
|
||||
// Object.getNotifier(this).notify({
|
||||
// type: 'update',
|
||||
// name: name,
|
||||
// oldValue: this[name]
|
||||
// });
|
||||
// }
|
||||
// setter.call(this, value);
|
||||
//},
|
||||
set: setter,
|
||||
configurable: true,
|
||||
enumerable: true
|
||||
|
||||
Reference in New Issue
Block a user