@galacean/engine 1.4.5 → 1.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.js +30 -24
- package/dist/browser.js.map +1 -1
- package/dist/browser.min.js +1 -1
- package/dist/browser.min.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/module.js +1 -1
- package/package.json +5 -5
package/dist/browser.js
CHANGED
|
@@ -22323,21 +22323,14 @@
|
|
|
22323
22323
|
};
|
|
22324
22324
|
/**
|
|
22325
22325
|
* Find the entity by path.
|
|
22326
|
-
* @param path - The path
|
|
22326
|
+
* @param path - The path of the entity eg: /entity
|
|
22327
22327
|
* @returns The component which be found
|
|
22328
22328
|
*/ _proto.findByPath = function findByPath(path) {
|
|
22329
|
-
var splits = path.split("/");
|
|
22330
|
-
|
|
22331
|
-
|
|
22332
|
-
var split = splits[i];
|
|
22333
|
-
if (split) {
|
|
22334
|
-
entity = Entity._findChildByName(entity, split);
|
|
22335
|
-
if (!entity) {
|
|
22336
|
-
return null;
|
|
22337
|
-
}
|
|
22338
|
-
}
|
|
22329
|
+
var splits = path.split("/").filter(Boolean);
|
|
22330
|
+
if (!splits.length) {
|
|
22331
|
+
return this;
|
|
22339
22332
|
}
|
|
22340
|
-
return
|
|
22333
|
+
return Entity._findChildByName(this, 0, splits, 0);
|
|
22341
22334
|
};
|
|
22342
22335
|
/**
|
|
22343
22336
|
* Create child entity.
|
|
@@ -22669,15 +22662,19 @@
|
|
|
22669
22662
|
};
|
|
22670
22663
|
/**
|
|
22671
22664
|
* @internal
|
|
22672
|
-
*/ Entity._findChildByName = function _findChildByName(
|
|
22673
|
-
var
|
|
22674
|
-
|
|
22675
|
-
|
|
22676
|
-
|
|
22677
|
-
|
|
22665
|
+
*/ Entity._findChildByName = function _findChildByName(entity, childIndex, paths, pathIndex) {
|
|
22666
|
+
var searchPath = paths[pathIndex];
|
|
22667
|
+
var isEndPath = pathIndex === paths.length - 1;
|
|
22668
|
+
var children = entity._children;
|
|
22669
|
+
for(var n = children.length; childIndex < n; childIndex++){
|
|
22670
|
+
var child = children[childIndex];
|
|
22671
|
+
if (child.name === searchPath) {
|
|
22672
|
+
// Search success if end path, or downward search
|
|
22673
|
+
return isEndPath ? child : Entity._findChildByName(child, 0, paths, pathIndex + 1);
|
|
22678
22674
|
}
|
|
22679
22675
|
}
|
|
22680
|
-
|
|
22676
|
+
// Search failed if first path, or upward search
|
|
22677
|
+
return pathIndex === 0 ? null : Entity._findChildByName(entity.parent, entity.siblingIndex + 1, paths, pathIndex - 1);
|
|
22681
22678
|
};
|
|
22682
22679
|
/**
|
|
22683
22680
|
* @internal
|
|
@@ -26147,6 +26144,7 @@
|
|
|
26147
26144
|
this._nativeCollider.setMaxDepenetrationVelocity(this._maxDepenetrationVelocity);
|
|
26148
26145
|
this._nativeCollider.setSleepThreshold(this._sleepThreshold);
|
|
26149
26146
|
this._nativeCollider.setSolverIterations(this._solverIterations);
|
|
26147
|
+
this._nativeCollider.setUseGravity(this._useGravity);
|
|
26150
26148
|
this._nativeCollider.setIsKinematic(this._isKinematic);
|
|
26151
26149
|
this._nativeCollider.setConstraints(this._constraints);
|
|
26152
26150
|
this._nativeCollider.setCollisionDetectionMode(this._collisionDetectionMode);
|
|
@@ -31738,12 +31736,20 @@
|
|
|
31738
31736
|
* @returns Entity
|
|
31739
31737
|
*/ _proto.findEntityByPath = function findEntityByPath(path) {
|
|
31740
31738
|
var splits = path.split("/").filter(Boolean);
|
|
31739
|
+
if (!splits.length) {
|
|
31740
|
+
return null;
|
|
31741
|
+
}
|
|
31742
|
+
var searchRootName = splits.shift();
|
|
31741
31743
|
for(var i = 0, n = this.rootEntitiesCount; i < n; i++){
|
|
31742
31744
|
var findEntity = this.getRootEntity(i);
|
|
31743
|
-
if (findEntity.name
|
|
31744
|
-
|
|
31745
|
-
|
|
31746
|
-
|
|
31745
|
+
if (findEntity.name !== searchRootName) {
|
|
31746
|
+
continue;
|
|
31747
|
+
}
|
|
31748
|
+
if (splits.length) {
|
|
31749
|
+
findEntity = Entity._findChildByName(findEntity, 0, splits, 0);
|
|
31750
|
+
if (!findEntity) {
|
|
31751
|
+
continue;
|
|
31752
|
+
}
|
|
31747
31753
|
}
|
|
31748
31754
|
return findEntity;
|
|
31749
31755
|
}
|
|
@@ -50029,7 +50035,7 @@
|
|
|
50029
50035
|
], EXT_texture_webp);
|
|
50030
50036
|
|
|
50031
50037
|
//@ts-ignore
|
|
50032
|
-
var version = "1.4.
|
|
50038
|
+
var version = "1.4.6";
|
|
50033
50039
|
console.log("Galacean Engine Version: " + version);
|
|
50034
50040
|
for(var key in CoreObjects){
|
|
50035
50041
|
Loader.registerClass(key, CoreObjects[key]);
|