Files
lifeRestart/public/libs/laya/laya.d3Plugin.js
Vick Scarlet 150c991648 Squashed commit of the following:
commit b421082374
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Fri Dec 31 20:26:20 2021 +0800

    update specialthanks

commit 765a69294b
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Tue Dec 14 19:10:03 2021 +0800

    fix ios goto

commit 8eb8c3ca72
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Tue Dec 14 19:03:37 2021 +0800

    add event grade

commit ab705dd46c
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Tue Dec 14 18:48:42 2021 +0800

    build version

commit a1e4232369
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Tue Dec 14 18:47:05 2021 +0800

    change talent replace before property allocate

commit f4d7b3ae3c
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Tue Dec 14 18:06:18 2021 +0800

    add event grade

commit 0567e40ddc
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Thu Dec 2 21:28:10 2021 +0800

    add particle

commit f17003925e
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Thu Dec 2 20:14:26 2021 +0800

    change ui

commit f8beda1d8f
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Thu Dec 2 19:08:30 2021 +0800

    change popup message ui

commit 915a2aa17d
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Thu Dec 2 18:34:29 2021 +0800

    new build

commit b5edabc104
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Thu Dec 2 18:18:46 2021 +0800

    add hint message

commit a143feadaf
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Thu Dec 2 17:57:31 2021 +0800

    fix copy bug

commit eab1975791
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Thu Dec 2 17:56:28 2021 +0800

    add save/load

commit acf9b92134
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Thu Dec 2 14:35:33 2021 +0800

    add theme switch

commit 488a6054ab
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Wed Dec 1 18:30:36 2021 +0800

    fix uiManager bug

commit f0317eaf14
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Wed Dec 1 16:07:03 2021 +0800

    add message popup

commit eb02d1ee6f
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Sun Nov 28 21:22:54 2021 +0800

    change relocation

commit 60503eae47
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Sun Nov 28 19:27:16 2021 +0800

    change ScaleButton -> Laya.runtime.ScaleButton

commit 52ef5909c1
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Sun Nov 28 19:26:31 2021 +0800

    change ScaleButton -> Laya.runtime.ScaleButton

commit 0284f6aa71
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Sun Nov 28 19:05:24 2021 +0800

    config webpack

commit 0e272ffd99
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Sun Nov 28 13:17:41 2021 +0800

    add thanks

commit e1e2ab4701
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Sun Nov 28 11:40:21 2021 +0800

    add light theme

commit 4f55c00f86
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Sat Nov 27 22:27:39 2021 +0800

    fix bug

commit 1d07bdfc46
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Sat Nov 27 21:48:47 2021 +0800

    daily update

commit 52d6a0ca8f
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Wed Nov 24 23:10:04 2021 +0800

    daily update

commit f8dd720d4d
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Wed Nov 24 19:08:13 2021 +0800

    daily update

commit d088c1a862
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Sun Nov 21 21:41:46 2021 +0800

    remove useless

commit a711fcf3ed
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Tue Nov 16 00:53:05 2021 +0800

    add achievement popup
    add page adaptive
    add talent extends

commit 05e02de3db
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Sat Nov 13 01:24:04 2021 +0800

    add github and discord

commit bff0109cc5
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Sat Nov 13 00:30:01 2021 +0800

    add trajectory auto mode

commit 54c04f65c2
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Fri Nov 12 19:54:31 2021 +0800

    fix property judge negative number bug

commit 660739530b
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Fri Nov 12 19:48:58 2021 +0800

    update achievement

commit c94e9e7433
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Thu Nov 11 21:37:45 2021 +0800

    update daily

commit c06cd9ea62
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Tue Nov 9 00:08:05 2021 +0800

    update daily

commit 2666983f89
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Sun Nov 7 23:00:22 2021 +0800

    add uiManager auto scan and load skin resource

commit 22fa5d755a
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Sun Nov 7 22:17:04 2021 +0800

    update framework

commit f40698d63e
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Sun Oct 31 00:13:22 2021 +0800

    add laya
2021-12-31 20:31:26 +08:00

117 lines
3.4 KiB
JavaScript

(function(window,document,Laya){
var __un=Laya.un,__uns=Laya.uns,__static=Laya.static,__class=Laya.class,__getset=Laya.getset,__newvec=Laya.__newvec;
var Component3D=laya.d3.component.Component3D,ComponentNode=laya.d3.core.ComponentNode,MeshTerrainSprite3D=laya.d3.core.MeshTerrainSprite3D;
var Sprite3D=laya.d3.core.Sprite3D;
/**
*<code>PathFinding</code> 类用于创建寻路。
*/
//class laya.d3.component.PathFind extends laya.d3.component.Component3D
var PathFind=(function(_super){
function PathFind(){
/**@private */
this._meshTerrainSprite3D=null;
/**@private */
this._finder=null;
/**@private */
this._setting=null;
/**寻路网格。*/
this.grid=null;
PathFind.__super.call(this);
}
__class(PathFind,'laya.d3.component.PathFind',_super);
var __proto=PathFind.prototype;
/**
*@private
*初始化载入蒙皮动画组件。
*@param owner 所属精灵对象。
*/
__proto._load=function(owner){
if (! (owner instanceof laya.d3.core.MeshTerrainSprite3D ))
throw new Error("PathFinding: The owner must MeshTerrainSprite3D!");
_super.prototype._load.call(this,owner);
this._meshTerrainSprite3D=owner;
}
/**
*寻找路径。
*@param startX 开始X。
*@param startZ 开始Z。
*@param endX 结束X。
*@param endZ 结束Z。
*@return 路径。
*/
__proto.findPath=function(startX,startZ,endX,endZ){
var minX=this._meshTerrainSprite3D.minX;
var minZ=this._meshTerrainSprite3D.minZ;
var cellX=this._meshTerrainSprite3D.width / this.grid.width;
var cellZ=this._meshTerrainSprite3D.depth / this.grid.height;
var halfCellX=cellX / 2;
var halfCellZ=cellZ / 2;
var gridStartX=Math.floor((startX-minX)/ cellX);
var gridStartZ=Math.floor((startZ-minZ)/ cellZ);
var gridEndX=Math.floor((endX-minX)/ cellX);
var gridEndZ=Math.floor((endZ-minZ)/ cellZ);
var boundWidth=this.grid.width-1;
var boundHeight=this.grid.height-1;
(gridStartX > boundWidth)&& (gridStartX=boundWidth);
(gridStartZ > boundHeight)&& (gridStartZ=boundHeight);
(gridStartX < 0)&& (gridStartX=0);
(gridStartZ < 0)&& (gridStartZ=0);
(gridEndX > boundWidth)&& (gridEndX=boundWidth);
(gridEndZ > boundHeight)&& (gridEndZ=boundHeight);
(gridEndX < 0)&& (gridEndX=0);
(gridEndZ < 0)&& (gridEndZ=0);
var path=this._finder.findPath(gridStartX,gridStartZ,gridEndX,gridEndZ,this.grid);
this.grid.reset();
for (var i=1;i < path.length-1;i++){
var gridPos=path[i];
gridPos[0]=gridPos[0] *cellX+halfCellX+minX;
gridPos[1]=gridPos[1] *cellZ+halfCellZ+minZ;
}
if (path.length==1){
path[0][0]=endX;
path[0][1]=endX;
}else if (path.length > 1){
path[0][0]=startX;
path[0][1]=startZ;
path[path.length-1][0]=endX;
path[path.length-1][1]=endZ;
}
return path;
}
/**
*设置寻路设置。
*@param value 寻路设置。
*/
/**
*获取寻路设置。
*@return 寻路设置。
*/
__getset(0,__proto,'setting',function(){
return this._setting;
},function(value){
(value)&& (this._finder=new PathFinding.finders.AStarFinder(value));
this._setting=value;
});
return PathFind;
})(Component3D)
})(window,document,Laya);
if (typeof define === 'function' && define.amd){
define('laya.core', ['require', "exports"], function(require, exports) {
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
for (var i in Laya) {
var o = Laya[i];
o && o.__isclass && (exports[i] = o);
}
});
}