mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 15:52:40 +08:00
@@ -85,8 +85,17 @@ Audio.State = {
|
||||
(function (proto) {
|
||||
|
||||
proto.preload = function () {
|
||||
var src = this._src,
|
||||
audio = this;
|
||||
var src = this._src, audio = this;
|
||||
|
||||
if (!src) {
|
||||
this._src = '';
|
||||
this._audioType = Audio.Type.UNKNOWN;
|
||||
this._element = null;
|
||||
this._state = Audio.State.INITIALZING;
|
||||
this._loaded = false;
|
||||
return;
|
||||
}
|
||||
|
||||
var item = cc.loader.getItem(src);
|
||||
|
||||
if (!item) {
|
||||
|
||||
@@ -41,7 +41,11 @@ var AudioSource = cc.Class({
|
||||
},
|
||||
|
||||
ctor: function () {
|
||||
this.audio = new cc.Audio(this._clip);
|
||||
this.audio = new cc.Audio();
|
||||
},
|
||||
|
||||
onLoad: function () {
|
||||
this.clip = this._clip;
|
||||
},
|
||||
|
||||
properties: {
|
||||
|
||||
+5
-1
@@ -312,4 +312,8 @@ function Area(a, b, c) {
|
||||
return a.x * (b.y - c.y) + b.x * (c.y - a.y) + c.x * (a.y - b.y);
|
||||
}
|
||||
|
||||
module.exports = ConvexPartition;
|
||||
module.exports = {
|
||||
ConvexPartition: ConvexPartition,
|
||||
ForceCounterClockWise: ForceCounterClockWise,
|
||||
IsCounterClockWise: IsCounterClockWise
|
||||
};
|
||||
@@ -24,7 +24,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
var PTM_RATIO = require('../CCPhysicsTypes').PTM_RATIO;
|
||||
var PolygonSeprator = require('../CCPolygonSeprator');
|
||||
var PolygonSeparator = require('../CCPolygonSeparator');
|
||||
|
||||
/**
|
||||
* @class PhysicsPolygonCollider
|
||||
@@ -52,7 +52,7 @@ var PhysicsPolygonCollider = cc.Class({
|
||||
points.length -= 1;
|
||||
}
|
||||
|
||||
var polys = PolygonSeprator(points);
|
||||
var polys = PolygonSeparator.ConvexPartition(points);
|
||||
var offset = this.offset;
|
||||
|
||||
for (var i = 0; i < polys.length; i++) {
|
||||
|
||||
Reference in New Issue
Block a user