From 326be8561ac2ef9d7b63bd113a88fab2d4aa7cb9 Mon Sep 17 00:00:00 2001 From: Next <1406099478@qq.com> Date: Mon, 31 Dec 2018 22:09:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=87=8D=E5=A4=8D=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98=EF=BC=8C=E6=9B=B4?= =?UTF-8?q?=E6=8D=A2tree=E7=BB=84=E4=BB=B6=E8=A7=A3=E5=86=B3=E5=8A=A8?= =?UTF-8?q?=E6=80=81=E5=8A=A0=E8=BD=BD=E8=8A=82=E7=82=B9=E4=B8=8D=E5=8F=8A?= =?UTF-8?q?=E6=97=B6=E5=93=8D=E5=BA=94=E9=97=AE=E9=A2=98=EF=BC=8C=E6=9A=82?= =?UTF-8?q?=E6=97=B6=E5=8E=BB=E6=8E=89=E6=90=9C=E7=B4=A2=E8=8A=82=E7=82=B9?= =?UTF-8?q?=E5=92=8C=E6=8B=96=E6=8B=BD=E8=8A=82=E7=82=B9=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- index.html | 56 +++++++++++++++++++++++++++----------------- js/vue-beauty.min.js | 4 ++-- 3 files changed, 37 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index f720c3e..2dd71c9 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# ccc-devtools v1.2.5 +# ccc-devtools v1.2.6 Cocos Creator 网页调试器,运行时查看、修改节点树,实时更新节点属性。 ## TODO diff --git a/index.html b/index.html index d460101..ea25ec6 100644 --- a/index.html +++ b/index.html @@ -35,15 +35,15 @@
- - - + + +
@@ -87,7 +87,7 @@
- +
@@ -127,22 +127,33 @@ this.defaultExpandedKeys = [this.$data.sceneTreeData[0]._id]; }, 0); }, - handleNodeClick(node) { - this.$data.propSchema = []; - this.$data.node = node; - cc.js.getset(this.$data.node, 'hex_color', () => { - return '#' + this.$data.node.color.toHEX(); - }, (hex) => { - this.$data.node.color = new cc.Color().fromHEX(hex); - }); - let superPreLoad = node._onPreDestroy; - node._onPreDestroy = () => { - superPreLoad.apply(node); - if (this.$data && this.$data.node === node) { - this.$data.node = null; - } + handleNodesSelect(nodes) { + if (nodes.length === 1) { + this.handleNodeClick(nodes[0]); + } else { + this.handleNodeClick(null); + } + }, + handleNodeClick(node) { + if (node) { + this.$data.propSchema = []; + this.$data.node = node; + cc.js.getset(node, 'hex_color', () => { + return '#' + node.color.toHEX(); + }, (hex) => { + node.color = new cc.Color().fromHEX(hex); + }, false, true); + let superPreLoad = node._onPreDestroy; + node._onPreDestroy = () => { + superPreLoad.apply(node); + if (this.$data && this.$data.node === node) { + this.$data.node = null; + } + } + this.$data.propSchema = [NEX_CONFIG.propSchema.node2d]; + } else { + this.$data.node = null; } - this.$data.propSchema = [NEX_CONFIG.propSchema.node2d]; }, outputNodeHandler(target) { let i = 1; @@ -186,6 +197,7 @@ this.$data.node = null; }, this); clearInterval(this.$data.intervalId); + console.log('ccc-devtools init'); } else { // console.log('cc is not init'); } diff --git a/js/vue-beauty.min.js b/js/vue-beauty.min.js index 2005e65..d50e8fc 100644 --- a/js/vue-beauty.min.js +++ b/js/vue-beauty.min.js @@ -1,6 +1,6 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("vue")):"function"==typeof define&&define.amd?define("vue-beauty",["vue"],e):"object"==typeof exports?exports["vue-beauty"]=e(require("vue")):t["vue-beauty"]=e(t.Vue)}("undefined"!=typeof self?self:this,function(t){return function(t){function e(i){if(n[i])return n[i].exports;var r=n[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/package/",e(e.s=130)}([function(t,e,n){t.exports={default:n(194),__esModule:!0}},function(t,e){var n=t.exports={version:"2.5.7"};"number"==typeof __e&&(__e=n)},function(t,e){var n=t.exports={version:"2.5.7"};"number"==typeof __e&&(__e=n)},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e,n){var i=n(62)("wks"),r=n(39),o=n(3).Symbol,a="function"==typeof o;(t.exports=function(t){return i[t]||(i[t]=a&&o[t]||(a?o:r)("Symbol."+t))}).store=i},function(t,e,n){t.exports={default:n(136),__esModule:!0}},function(t,e,n){var i=n(12),r=n(2),o=n(24),a=n(70),s=n(95),l=function(t,e,n){var c,u,f,d,p=t&l.F,h=t&l.G,v=t&l.S,m=t&l.P,g=t&l.B,y=h?i:v?i[e]||(i[e]={}):(i[e]||{}).prototype,b=h?r:r[e]||(r[e]={}),x=b.prototype||(b.prototype={});h&&(n=e);for(c in n)u=!p&&y&&void 0!==y[c],f=(u?y:n)[c],d=g&&u?s(f,i):m&&"function"==typeof f?s(Function.call,f):f,y&&a(y,c,f,t&l.U),b[c]!=f&&o(b,c,d),m&&x[c]!=f&&(x[c]=f)};i.core=r,l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,t.exports=l},function(t,e,n){var i=n(3),r=n(1),o=n(26),a=n(14),s=n(16),l=function(t,e,n){var c,u,f,d=t&l.F,p=t&l.G,h=t&l.S,v=t&l.P,m=t&l.B,g=t&l.W,y=p?r:r[e]||(r[e]={}),b=y.prototype,x=p?i:h?i[e]:(i[e]||{}).prototype;p&&(n=e);for(c in n)(u=!d&&x&&void 0!==x[c])&&s(y,c)||(f=u?x[c]:n[c],y[c]=p&&"function"!=typeof x[c]?n[c]:m&&u?o(f,i):g&&x[c]==f?function(t){var e=function(e,n,i){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,i)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(f):v&&"function"==typeof f?o(Function.call,f):f,v&&((y.virtual||(y.virtual={}))[c]=f,t&l.R&&b&&!b[c]&&a(b,c,f)))};l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,t.exports=l},function(t,e,n){var i=n(9),r=n(84),o=n(57),a=Object.defineProperty;e.f=n(11)?Object.defineProperty:function(t,e,n){if(i(t),e=o(e,!0),i(n),r)try{return a(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){var i=n(15);t.exports=function(t){if(!i(t))throw TypeError(t+" is not an object!");return t}},function(t,e,n){var i=n(117),r="object"==typeof self&&self&&self.Object===Object&&self,o=i||r||Function("return this")();t.exports=o},function(t,e,n){t.exports=!n(21)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e,n){var i=n(99)("wks"),r=n(71),o=n(12).Symbol,a="function"==typeof o;(t.exports=function(t){return i[t]||(i[t]=a&&o[t]||(a?o:r)("Symbol."+t))}).store=i},function(t,e,n){var i=n(8),r=n(27);t.exports=n(11)?function(t,e,n){return i.f(t,e,r(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){var i=n(87),r=n(58);t.exports=function(t){return i(r(t))}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,n){t.exports={default:n(200),__esModule:!0}},function(t,e,n){function i(t,e){if(u(t))return new Date(t.getTime());if("string"!=typeof t)return new Date(t);var n=e||{},i=n.additionalDigits;i=null==i?p:Number(i);var c=r(t),f=o(c.date,i),h=f.year,v=f.restDateString,m=a(v,h);if(m){var g,y=m.getTime(),b=0;return c.time&&(b=s(c.time)),c.timezone?g=l(c.timezone):(g=new Date(y+b).getTimezoneOffset(),g=new Date(y+b+g*d).getTimezoneOffset()),new Date(y+b+g*d)}return new Date(t)}function r(t){var e,n={},i=t.split(h);if(v.test(i[0])?(n.date=null,e=i[0]):(n.date=i[0],e=i[1]),e){var r=O.exec(e);r?(n.time=e.replace(r[1],""),n.timezone=r[1]):n.time=e}return n}function o(t,e){var n,i=g[e],r=b[e];if(n=y.exec(t)||r.exec(t)){var o=n[1];return{year:parseInt(o,10),restDateString:t.slice(o.length)}}if(n=m.exec(t)||i.exec(t)){var a=n[1];return{year:100*parseInt(a,10),restDateString:t.slice(a.length)}}return{year:null}}function a(t,e){if(null===e)return null;var n,i,r,o;if(0===t.length)return i=new Date(0),i.setUTCFullYear(e),i;if(n=x.exec(t))return i=new Date(0),r=parseInt(n[1],10)-1,i.setUTCFullYear(e,r),i;if(n=_.exec(t)){i=new Date(0);var a=parseInt(n[1],10);return i.setUTCFullYear(e,0,a),i}if(n=w.exec(t)){i=new Date(0),r=parseInt(n[1],10)-1;var s=parseInt(n[2],10);return i.setUTCFullYear(e,r,s),i}if(n=C.exec(t))return o=parseInt(n[1],10)-1,c(e,o);if(n=S.exec(t)){o=parseInt(n[1],10)-1;return c(e,o,parseInt(n[2],10)-1)}return null}function s(t){var e,n,i;if(e=k.exec(t))return(n=parseFloat(e[1].replace(",",".")))%24*f;if(e=T.exec(t))return n=parseInt(e[1],10),i=parseFloat(e[2].replace(",",".")),n%24*f+i*d;if(e=$.exec(t)){n=parseInt(e[1],10),i=parseInt(e[2],10);var r=parseFloat(e[3].replace(",","."));return n%24*f+i*d+1e3*r}return null}function l(t){var e,n;return(e=E.exec(t))?0:(e=P.exec(t))?(n=60*parseInt(e[2],10),"+"===e[1]?-n:n):(e=M.exec(t),e?(n=60*parseInt(e[2],10)+parseInt(e[3],10),"+"===e[1]?-n:n):0)}function c(t,e,n){e=e||0,n=n||0;var i=new Date(0);i.setUTCFullYear(t,0,4);var r=i.getUTCDay()||7,o=7*e+n+1-r;return i.setUTCDate(i.getUTCDate()+o),i}var u=n(123),f=36e5,d=6e4,p=2,h=/[T ]/,v=/:/,m=/^(\d{2})$/,g=[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],y=/^(\d{4})/,b=[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],x=/^-(\d{2})$/,_=/^-?(\d{3})$/,w=/^-?(\d{2})-?(\d{2})$/,C=/^-?W(\d{2})$/,S=/^-?W(\d{2})-?(\d{1})$/,k=/^(\d{2}([.,]\d*)?)$/,T=/^(\d{2}):?(\d{2}([.,]\d*)?)$/,$=/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,O=/([Z+-].*)$/,E=/^(Z)$/,P=/^([+-])(\d{2})$/,M=/^([+-])(\d{2}):?(\d{2})$/;t.exports=i},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,n){var i=n(86),r=n(63);t.exports=Object.keys||function(t){return i(t,r)}},function(t,e){t.exports={}},function(t,e,n){var i=n(67),r=n(94);t.exports=n(42)?function(t,e,n){return i.f(t,e,r(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){t.exports={default:n(238),__esModule:!0}},function(t,e,n){var i=n(38);t.exports=function(t,e,n){if(i(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,i){return t.call(e,n,i)};case 3:return function(n,i,r){return t.call(e,n,i,r)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e){t.exports=!0},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,n){var i=n(58);t.exports=function(t){return Object(i(t))}},function(t,e,n){"use strict";var i=n(142)(!0);n(88)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=i(e,n),this._i+=t.length,{value:t,done:!1})})},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){var i=n(44),r=Math.min;t.exports=function(t){return t>0?r(i(t),9007199254740991):0}},function(t,e,n){function i(t,e){var n=o(t,e);return r(n)?n:void 0}var r=n(212),o=n(218);t.exports=i},function(t,e,n){function i(t){return null==t?void 0===t?l:s:c&&c in Object(t)?o(t):a(t)}var r=n(116),o=n(214),a=n(215),s="[object Null]",l="[object Undefined]",c=r?r.toStringTag:void 0;t.exports=i},function(t,e,n){t.exports={default:n(263),__esModule:!0}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e){var n=0,i=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+i).toString(36))}},function(t,e,n){n(137);for(var i=n(3),r=n(14),o=n(23),a=n(4)("toStringTag"),s="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),l=0;l0?i:n)(t)}},function(t,e,n){var i=n(13)("unscopables"),r=Array.prototype;void 0==r[i]&&n(24)(r,i,{}),t.exports=function(t){r[i][t]=!0}},function(t,e,n){"use strict";var i=n(45),r=n(156),o=n(73),a=n(74);t.exports=n(157)(Array,"Array",function(t,e){this._t=a(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,r(1)):"keys"==e?r(0,n):"values"==e?r(0,t[n]):r(0,[n,t[n]])},"values"),o.Arguments=o.Array,i("keys"),i("values"),i("entries")},function(t,e,n){t.exports={default:n(204),__esModule:!0}},function(t,e){function n(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}t.exports=n},function(t,e){function n(t){return null!=t&&"object"==typeof t}t.exports=n},function(t,e,n){t.exports={default:n(240),__esModule:!0}},function(e,n){e.exports=t},function(t,e,n){t.exports={default:n(250),__esModule:!0}},function(t,e,n){t.exports={default:n(251),__esModule:!0}},function(t,e,n){t.exports={default:n(266),__esModule:!0}},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var r=n(52),o=i(r),a=n(53),s=i(a),l="function"==typeof s.default&&"symbol"==typeof o.default?function(t){return typeof t}:function(t){return t&&"function"==typeof s.default&&t.constructor===s.default&&t!==s.default.prototype?"symbol":typeof t};e.default="function"==typeof s.default&&"symbol"===l(o.default)?function(t){return void 0===t?"undefined":l(t)}:function(t){return t&&"function"==typeof s.default&&t.constructor===s.default&&t!==s.default.prototype?"symbol":void 0===t?"undefined":l(t)}},function(t,e,n){var i=n(15),r=n(3).document,o=i(r)&&i(r.createElement);t.exports=function(t){return o?r.createElement(t):{}}},function(t,e,n){var i=n(15);t.exports=function(t,e){if(!i(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!i(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!i(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!i(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,n){var i=n(60),r=Math.min;t.exports=function(t){return t>0?r(i(t),9007199254740991):0}},function(t,e){var n=Math.ceil,i=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?i:n)(t)}},function(t,e,n){var i=n(62)("keys"),r=n(39);t.exports=function(t){return i[t]||(i[t]=r(t))}},function(t,e,n){var i=n(1),r=n(3),o=r["__core-js_shared__"]||(r["__core-js_shared__"]={});(t.exports=function(t,e){return o[t]||(o[t]=void 0!==e?e:{})})("versions",[]).push({version:i.version,mode:n(29)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,n){var i=n(65),r=n(4)("iterator"),o=n(23);t.exports=n(1).getIteratorMethod=function(t){if(void 0!=t)return t[r]||t["@@iterator"]||o[i(t)]}},function(t,e,n){var i=n(28),r=n(4)("toStringTag"),o="Arguments"==i(function(){return arguments}()),a=function(t,e){try{return t[e]}catch(t){}};t.exports=function(t){var e,n,s;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=a(e=Object(t),r))?n:o?i(e):"Object"==(s=i(e))&&"function"==typeof e.callee?"Arguments":s}},function(t,e){function n(t,e){var n=t[1]||"",r=t[3];if(!r)return n;if(e&&"function"==typeof btoa){var o=i(r);return[n].concat(r.sources.map(function(t){return"/*# sourceURL="+r.sourceRoot+t+" */"})).concat([o]).join("\n")}return[n].join("\n")}function i(t){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(t))))+" */"}t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var i=n(e,t);return e[2]?"@media "+e[2]+"{"+i+"}":i}).join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var i={},r=0;rn.parts.length&&(i.parts.length=n.parts.length)}else{for(var o=[],r=0;rc;)o.call(a,n=s[c++])&&u.push(t?[n,a[n]]:a[n]);return u}}},function(t,e,n){var i=n(16),r=n(17),o=n(134)(!1),a=n(61)("IE_PROTO");t.exports=function(t,e){var n,s=r(t),l=0,c=[];for(n in s)n!=a&&i(s,n)&&c.push(n);for(;e.length>l;)i(s,n=e[l++])&&(~o(c,n)||c.push(n));return c}},function(t,e,n){var i=n(28);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==i(t)?t.split(""):Object(t)}},function(t,e,n){"use strict";var i=n(29),r=n(7),o=n(89),a=n(14),s=n(23),l=n(140),c=n(41),u=n(92),f=n(4)("iterator"),d=!([].keys&&"next"in[].keys()),p=function(){return this};t.exports=function(t,e,n,h,v,m,g){l(n,e,h);var y,b,x,_=function(t){if(!d&&t in k)return k[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},w=e+" Iterator",C="values"==v,S=!1,k=t.prototype,T=k[f]||k["@@iterator"]||v&&k[v],$=T||_(v),O=v?C?_("entries"):$:void 0,E="Array"==e?k.entries||T:T;if(E&&(x=u(E.call(new t)))!==Object.prototype&&x.next&&(c(x,w,!0),i||"function"==typeof x[f]||a(x,f,p)),C&&T&&"values"!==T.name&&(S=!0,$=function(){return T.call(this)}),i&&!g||!d&&!S&&k[f]||a(k,f,$),s[e]=$,s[w]=p,v)if(y={values:C?$:_("values"),keys:m?$:_("keys"),entries:O},g)for(b in y)b in k||o(k,b,y[b]);else r(r.P+r.F*(d||S),e,y);return y}},function(t,e,n){t.exports=n(14)},function(t,e,n){var i=n(9),r=n(141),o=n(63),a=n(61)("IE_PROTO"),s=function(){},l=function(){var t,e=n(56)("iframe"),i=o.length;for(e.style.display="none",n(91).appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write("