cc.Vec2类的pFuzzyEqual方法,在浏览器里报错

  • Creator 版本:2.0

  • 目标平台: web

  • 详细报错信息,包含调用堆栈:
    test2.js:12 Uncaught TypeError: v.pFuzzyEqual is not a function
    at test2.onLoad (test2.js:12)
    at CCClass.eval [as _invoke] (eval at createInvokeImpl (component-scheduler.js:256), :3:65)
    at CCClass.invoke (component-scheduler.js:154)
    at CCClass.activateNode (node-activator.js:227)
    at cc_Scene._activate (CCScene.js:101)
    at 27.cc.Director.runSceneImmediate (CCDirector.js:467)
    at boot.js:362
    at CCLoader. (CCAssetLibrary.js:244)
    at CCLoader.js:259
    at utils.js:78
    onLoad @ test2.js:12
    (anonymous) @ VM22590:3
    invoke @ component-scheduler.js:154
    activateNode @ node-activator.js:227
    _activate @ CCScene.js:101
    runSceneImmediate @ CCDirector.js:467
    (anonymous) @ boot.js:362
    (anonymous) @ CCAssetLibrary.js:244
    (anonymous) @ CCLoader.js:259
    (anonymous) @ utils.js:78
    setTimeout (async)
    callInNextTick @ utils.js:77
    (anonymous) @ CCLoader.js:255
    117.proto.allComplete @ loading-items.js:528
    117.proto.itemComplete @ loading-items.js:716
    117.LoadingItems.itemComplete @ loading-items.js:379
    120.proto.flowOut @ pipeline.js:319
    (anonymous) @ pipeline.js:67
    loadUuid @ uuid-loader.js:288
    116.Loader.handle @ loader.js:193
    flow @ pipeline.js:51
    flow @ pipeline.js:42
    flow @ pipeline.js:42
    120.proto.flowIn @ pipeline.js:275
    117.proto.append @ loading-items.js:508
    108.proto.load @ CCLoader.js:278
    loadJson @ CCAssetLibrary.js:228
    (anonymous) @ boot.js:354
    (anonymous) @ CCLoader.js:259
    (anonymous) @ utils.js:78
    setTimeout (async)
    callInNextTick @ utils.js:77
    (anonymous) @ CCLoader.js:255
    117.proto.allComplete @ loading-items.js:528
    117.proto.itemComplete @ loading-items.js:716
    117.LoadingItems.itemComplete @ loading-items.js:379
    120.proto.flowOut @ pipeline.js:319
    flow @ pipeline.js:87
    (anonymous) @ pipeline.js:64
    (anonymous) @ downloader.js:333
    xhr.onload @ text-downloader.js:53
    load (async)
    122.module.exports @ text-downloader.js:50
    114.Downloader.handle @ downloader.js:330
    flow @ pipeline.js:51
    flow @ pipeline.js:84
    120.proto.flowIn @ pipeline.js:275
    117.proto.append @ loading-items.js:508
    108.proto.load @ CCLoader.js:278
    (anonymous) @ boot.js:341
    _prepareFinished @ CCGame.js:386
    (anonymous) @ CCGame.js:430
    (anonymous) @ CCLoader.js:262
    (anonymous) @ utils.js:78
    setTimeout (async)
    callInNextTick @ utils.js:77
    (anonymous) @ CCLoader.js:255
    117.proto.allComplete @ loading-items.js:528
    117.proto.itemComplete @ loading-items.js:716
    117.LoadingItems.itemComplete @ loading-items.js:379
    120.proto.flowOut @ pipeline.js:319
    flow @ pipeline.js:87
    (anonymous) @ pipeline.js:64
    (anonymous) @ downloader.js:333
    loadHandler @ downloader.js:62
    load (async)
    downloadScript @ downloader.js:70
    114.Downloader.handle @ downloader.js:330
    flow @ pipeline.js:51
    flow @ pipeline.js:84
    120.proto.flowIn @ pipeline.js:275
    117.proto.append @ loading-items.js:508
    108.proto.load @ CCLoader.js:278
    prepare @ CCGame.js:428
    run @ CCGame.js:448
    onload @ boot.js:313
    window.onload @ boot.js:175
    load (async)
    (anonymous) @ boot.js:170
    (anonymous) @ boot.js:400

  • 重现方式:
    let v = cc.v2(10,10);
    let vv = cc.v2(20,20);
    v. pFuzzyEqual(vv);
    如上代码 必现!

  • 之前哪个版本是正常的 :

  • 手机型号 :mac平台 chrome

  • 手机浏览器 :

  • 编辑器操作系统 :mac os 10.13.6

  • 编辑器之前是否有其它报错 :

  • 出现概率:

  • 额外线索:

@panda 这个方法被移除了吗?

2.0 没有这个 API 了。请用 vec1.sub(vec2).magSqr() < 0.00001 来判断是否相等