Skip to content

Commit

Permalink
Merge pull request #272 from playcanvas/feature/remove-designer
Browse files Browse the repository at this point in the history
Feature/remove designer
  • Loading branch information
vkalpias committed May 11, 2015
2 parents f1a2b13 + 9f5e351 commit 593749c
Show file tree
Hide file tree
Showing 50 changed files with 284 additions and 2,755 deletions.
16 changes: 0 additions & 16 deletions build/dependencies.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@
../src/net/net_oauth.js
../src/net/net_socket.js
../src/script/script_script.js
../src/framework/framework_link.prod.js
../src/framework/framework_link.dev.js
../src/framework/framework_contentfile.js
../src/framework/framework_pack.js
../src/framework/framework_application.js
Expand All @@ -120,9 +118,6 @@
../src/framework/components/script/script_system.js
../src/framework/components/script/script_component.js
../src/framework/components/script/script_data.js
../src/framework/components/pack/pack_system.js
../src/framework/components/pack/pack_component.js
../src/framework/components/pack/pack_data.js
../src/framework/components/pick/pick_system.js
../src/framework/components/pick/pick_component.js
../src/framework/components/pick/pick_data.js
Expand All @@ -132,8 +127,6 @@
../src/framework/components/audiolistener/audiolistener_system.js
../src/framework/components/audiolistener/audiolistener_component.js
../src/framework/components/audiolistener/audiolistener_data.js
../src/framework/components/designer/designer_component.js
../src/framework/components/designer/designer_data.js
../src/framework/components/physics/rigidbody_constants.js
../src/framework/components/physics/rigidbody_system.js
../src/framework/components/physics/rigidbody_component.js
Expand All @@ -148,15 +141,6 @@
../src/framework/components/particlesystem/particlesystem_system.js
../src/framework/components/particlesystem/particlesystem_component.js
../src/framework/components/particlesystem/particlesystem_data.js
../src/framework/livelink/livelink_livelink.js
../src/framework/livelink/livelink_message.js
../src/framework/livelink/livelink_update_component_message.js
../src/framework/livelink/livelink_update_entity_message.js
../src/framework/livelink/livelink_close_entity_message.js
../src/framework/livelink/livelink_open_entity_message.js
../src/framework/livelink/livelink_update_asset_message.js
../src/framework/livelink/livelink_update_pack_settings.js
../src/framework/livelink/livelink_update_assetcache_message.js
../src/framework/entity/entity_entity.js
../src/resources/resources_resources.js
../src/resources/resources_loader.js
Expand Down
32 changes: 0 additions & 32 deletions src/backwards_compatibility.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,38 +26,6 @@ pc.fw = {
FILL_WINDOW: pc.FILLMODE_FILL_WINDOW,
KEEP_ASPECT: pc.FILLMODE_KEEP_ASPECT
},
LiveLink: pc.LiveLink,
LiveLinkCloseEntityMessage: pc.LiveLinkCloseEntityMessage,
LiveLinkMessage: pc.LiveLinkMessage,
LiveLinkMessageRegister: pc.LiveLinkMessageRegister,
LiveLinkMessageType: {
CLOSE_ENTITY: "CLOSE_ENTITY",
NO_TYPE: "NO_TYPE",
OPEN_ENTITY: "OPEN_ENTITY",
OPEN_PACK: "OPEN_PACK",
RECEIVED: "RECEIVED",
REPARENT_ENTITY: "REPARENT_ENTITY",
SELECTION_UPDATED: "SELECTION_UPDATED",
UPDATE_ASSET: "UPDATE_ASSET",
UPDATE_ASSETCACHE: "UPDATE_ASSETCACHE",
UPDATE_COMPONENT: "UPDATE_COMPONENT",
UPDATE_ENTITY: "UPDATE_ENTITY",
UPDATE_ENTITY_ENABLED: "UPDATE_ENTITY_ENABLED",
UPDATE_ENTITY_NAME: "UPDATE_ENTITY_NAME",
UPDATE_ENTITY_TRANSFORM: "UPDATE_ENTITY_TRANSFORM",
UPDATE_PACK_SETTINGS: "UPDATE_PACK_SETTINGS"
},
LiveLinkOpenEntityMessage: pc.LiveLinkOpenEntityMessage,
LiveLinkOpenPackMessage: pc.LiveLinkOpenPackMessage,
LiveLinkReparentEntityMessage: pc.LiveLinkReparentEntityMessage,
LiveLinkUpdateAssetCacheMessage: pc.LiveLinkUpdateAssetCacheMessage,
LiveLinkUpdateAssetMessage: pc.LiveLinkUpdateAssetMessage,
LiveLinkUpdateComponentMessage: pc.LiveLinkUpdateComponentMessage,
LiveLinkUpdateEntityEnabledMessage: pc.LiveLinkUpdateEntityEnabledMessage,
LiveLinkUpdateEntityMessage: pc.LiveLinkUpdateEntityMessage,
LiveLinkUpdateEntityNameMessage: pc.LiveLinkUpdateEntityNameMessage,
LiveLinkUpdateEntityTransformMessage: pc.LiveLinkUpdateEntityTransformMessage,
LiveLinkUpdatePackSettings: pc.LiveLinkUpdatePackSettings,
Pack: pc.Pack,
ResolutionMode: {
AUTO: pc.RESOLUTION_AUTO,
Expand Down
21 changes: 14 additions & 7 deletions src/framework/components/animation/animation_component.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,17 +174,20 @@ pc.extend(pc, function () {
if (this.animations && this.animations[asset.name]) {
delete this.animations[asset.name];
if (this.data.currAnim === asset.name) {
this.data.currAnim = null;
this.speed = 0;
this.data.playing = false;
if (this.data.skeleton) {
this.data.skeleton.setCurrentTime(0);
this.data.skeleton.setAnimation(null);
}
this._stopCurrentAnimation();
}
}
},

_stopCurrentAnimation: function () {
this.data.currAnim = null;
this.data.playing = false;
if (this.data.skeleton) {
this.data.skeleton.setCurrentTime(0);
this.data.skeleton.setAnimation(null);
}
},

onSetAnimations: function (name, oldValue, newValue) {
var data = this.data;

Expand Down Expand Up @@ -215,6 +218,10 @@ pc.extend(pc, function () {
if (asset) {
asset.off('change', this.onAssetChanged, this);
asset.off('remove', this.onAssetRemoved, this);

if (this.data.currAnim === asset.name) {
this._stopCurrentAnimation();
}
}
}
}
Expand Down
100 changes: 17 additions & 83 deletions src/framework/components/animation/animation_system.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,89 +15,23 @@ pc.extend(pc, function () {
this.ComponentType = pc.AnimationComponent;
this.DataType = pc.AnimationComponentData;

this.schema = [{
name: "enabled",
displayName: "Enabled",
description: "Enable or disable the component",
type: "boolean",
defaultValue: true
},{
name: "assets",
displayName: "Asset",
description: "Animation Asset",
type: "asset",
options: {
max: 100,
type: "animation"
},
defaultValue: []
}, {
name: "speed",
displayName: "Speed Factor",
description: "Scale the animation playback speed",
type: "number",
options: {
step: 0.1
},
defaultValue: 1.0
}, {
name: "loop",
displayName: "Loop",
description: "Loop the animation back to the start on completion",
type: "boolean",
defaultValue: true
}, {
name: "activate",
displayName: "Activate",
description: "Play the configured animation on load",
type: "boolean",
defaultValue: true
}, {
name: "animations",
exposed: false
}, {
name: "skeleton",
exposed: false,
readOnly: true
}, {
name: "model",
exposed: false,
readOnly: true
}, {
name: "prevAnim",
exposed: false,
readOnly: true
}, {
name: "currAnim",
exposed: false,
readOnly: true
}, {
name: "fromSkel",
exposed: false,
readOnly: true
}, {
name: "toSkel",
exposed: false,
readOnly: true
}, {
name: "blending",
exposed: false,
readOnly: true
}, {
name: "blendTime",
exposed: false,
readOnly: true
}, {
name: "blendTimeRemaining",
exposed: false,
readOnly: true
}, {
name: "playing",
exposed: false,
readOnly: true
}];

this.exposeProperties();
this.schema = [
'enabled',
'assets',
'speed',
'loop',
'activate',
'animations',
'skeleton',
'model',
'prevAnim',
'currAnim',
'fromSkel',
'toSkel',
'blending',
'blendTimeRemaining',
'playing'
];

this.on('remove', this.onRemove, this);
this.on('update', this.onUpdate, this);
Expand Down
10 changes: 1 addition & 9 deletions src/framework/components/audiolistener/audiolistener_system.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,7 @@ pc.extend(pc, function () {
this.ComponentType = pc.AudioListenerComponent;
this.DataType = pc.AudioListenerComponentData;

this.schema = [{
name: "enabled",
displayName: "Enabled",
description: "Disabled audio listener components do not affect audiosources",
type: "boolean",
defaultValue: true
}];

this.exposeProperties();
this.schema = ['enabled'];

this.manager = manager;
this.current = null;
Expand Down
13 changes: 13 additions & 0 deletions src/framework/components/audiosource/audiosource_component.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ pc.extend(pc, function () {
this.on("set_minDistance", this.onSetMinDistance, this);
this.on("set_maxDistance", this.onSetMaxDistance, this);
this.on("set_rollOffFactor", this.onSetRollOffFactor, this);
this.on("set_3d", this.onSet3d, this);
};
AudioSourceComponent = pc.inherits(AudioSourceComponent, pc.Component);

Expand Down Expand Up @@ -114,6 +115,10 @@ pc.extend(pc, function () {
if (asset) {
asset.off('change', this.onAssetChanged, this);
asset.off('remove', this.onAssetRemoved, this);

if (this.currentSource === asset.name) {
this.stop();
}
}
}
}
Expand Down Expand Up @@ -211,6 +216,14 @@ pc.extend(pc, function () {
}
},

onSet3d: function (name, oldValue, newValue) {
if (oldValue !== newValue) {
if (this.system.initialized && this.currentSource) {
this.play(this.currentSource);
}
}
},

onEnable: function () {
AudioSourceComponent._super.onEnable.call(this);
if (this.system.initialized) {
Expand Down
Loading

0 comments on commit 593749c

Please sign in to comment.