Skip to content

Instantly share code, notes, and snippets.

Avatar
🥥

Jare Guo jareguo

🥥
View GitHub Profile
@jareguo
jareguo / creator-debug-scripts.md
Last active Oct 19, 2016
运行时 Creator 调试工具集
View creator-debug-scripts.md

在收藏夹中新增一个网页,将网址设为下面的其中一个源码。然后打开任一 Creator 页面,接着直接在收藏夹点击刚刚收藏的网址即可。

打印 Hierarchy

javascript:(function () {
    function visitNode (node, visitor) {
        visitor(node);
        var children = node._children;
        for (var i = 0; i < children.length; ++i) {
View 统计行数.sh
find . -name "*.js"|xargs cat|wc -l
@jareguo
jareguo / add-jsperf-test.js
Last active May 23, 2016
在 jsperf 里动态加入一个新的测试项目
View add-jsperf-test.js
javascript:(function() {
var tbody = document.querySelector('table#test-table>tbody');
var lastTr = tbody.querySelector('tr:last-child');
var tr = document.createElement('tr');
tbody.appendChild(tr);
tr.innerHTML = lastTr.innerHTML;
var th = tr.querySelector('th');
th.id = 'title-' + tbody.childElementCount;
View 为什么 Creator 坐标系要去掉 anchor.md

开始学习的时候为了直观的看效果确实是经常把子节点放在中间,但用来开发的几个项目就不会再以中心点为基点了。

我也算做了10年游戏了,一直都习惯于设置在父节点的中心点。我个人不太理解一个编辑器,创建的子物体默认会跑到父物体的下方这种做法。而且假如我是一个美术/策划,或者将来 Creator 支持 3D 以后,这种子物体一创建就跑到父物体最边上的行为,会更加让人困惑。

假如父节点的大小会动态增加的话。现在的坐标系统就会出问题。

会有什么问题?

假如父节点是超级长的地图话,位置怎么设置

@jareguo
jareguo / Use UnityYAMLMerge in SourceTree.txt
Created Dec 30, 2015
Use UnityYAMLMerge in SourceTree
View Use UnityYAMLMerge in SourceTree.txt
/Applications/Unity/Unity.app/Contents/Tools/UnityYAMLMerge merge -p $(cd $(dirname "$BASE") && pwd)/$(basename "$BASE") $(cd $(dirname "$REMOTE") && pwd)/$(basename "$REMOTE") $(cd $(dirname "$LOCAL") && pwd)/$(basename "$LOCAL") $(cd $(dirname "$MERGED") && pwd)/$(basename "$MERGED")
@jareguo
jareguo / js-perf-tests.md
Last active Aug 19, 2016
Javascript Performence Tests
View js-perf-tests.md
@jareguo
jareguo / spawn.js
Created Oct 14, 2015
spawn a child process in gulp task
View spawn.js
gulp.task('compile-cocos2d', function (done) {
console.log('Spawn ant in ' + paths.originCocos2dCompileDir);
var child = Spawn('ant', {
cwd: paths.originCocos2dCompileDir,
stdio: [0, 1, 'pipe']
});
child.on('error', function (err) {
var ANT = Chalk.inverse('ant');
if (err.code === 'ENOENT') {
View Promise.cs
/*
modified from original source: https://bitbucket.org/mattkotsenas/c-promises/overview
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Promises