mirror of
https://github.com/wassname/phaser.git
synced 2026-07-25 13:20:14 +08:00
Fixed an error that stopped 2 tweens from being able to run on the same object. Also refactored a lot of the classes to remove prototype properties and move them to local instance properties.
This commit is contained in:
+18
-17
@@ -10,26 +10,23 @@
|
||||
*/
|
||||
Phaser.Animation.FrameData = function () {
|
||||
|
||||
/**
|
||||
* Local frame container.
|
||||
* @type {Phaser.Frame[]}
|
||||
* @private
|
||||
*/
|
||||
this._frames = [];
|
||||
|
||||
/**
|
||||
* Local frameName<->index container.
|
||||
* @private
|
||||
*/
|
||||
this._frameNames = [];
|
||||
|
||||
};
|
||||
|
||||
Phaser.Animation.FrameData.prototype = {
|
||||
|
||||
/**
|
||||
* Local frame container.
|
||||
* @type {Phaser.Frame[]}
|
||||
* @private
|
||||
*/
|
||||
_frames: [],
|
||||
|
||||
/**
|
||||
* Local frameName<->index container.
|
||||
* @private
|
||||
*/
|
||||
_frameNames: [],
|
||||
|
||||
/**
|
||||
* Add a new frame.
|
||||
* @param frame {Frame} The frame you want to add.
|
||||
@@ -41,7 +38,8 @@ Phaser.Animation.FrameData.prototype = {
|
||||
|
||||
this._frames.push(frame);
|
||||
|
||||
if (frame.name !== '') {
|
||||
if (frame.name !== '')
|
||||
{
|
||||
this._frameNames[frame.name] = frame.index;
|
||||
}
|
||||
|
||||
@@ -56,7 +54,8 @@ Phaser.Animation.FrameData.prototype = {
|
||||
*/
|
||||
getFrame: function (index) {
|
||||
|
||||
if (this._frames[index]) {
|
||||
if (this._frames[index])
|
||||
{
|
||||
return this._frames[index];
|
||||
}
|
||||
|
||||
@@ -71,7 +70,8 @@ Phaser.Animation.FrameData.prototype = {
|
||||
*/
|
||||
getFrameByName: function (name) {
|
||||
|
||||
if (this._frameNames[name] !== '') {
|
||||
if (this._frameNames[name] !== '')
|
||||
{
|
||||
return this._frames[this._frameNames[name]];
|
||||
}
|
||||
|
||||
@@ -86,7 +86,8 @@ Phaser.Animation.FrameData.prototype = {
|
||||
*/
|
||||
checkFrameName: function (name) {
|
||||
|
||||
if (this._frameNames[name] == null) {
|
||||
if (this._frameNames[name] == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user