Skip to content

Commit

Permalink
Merge branch 'v3.8.1' of github.com:cocos/cocos-engine into v3.8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
arsen2010 committed Jul 11, 2023
2 parents 8d9bd56 + 09f83b4 commit 1cb1f70
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 3 deletions.
3 changes: 1 addition & 2 deletions cocos/animation/exotic-animation/exotic-animation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ type MayBeQuantized = FloatArray | QuantizedFloatArray;
class ExoticVectorLikeTrackValues {
constructor (values: FloatArray) {
this._values = values;
this._isQuantized = false;
}

get precision (): FloatPrecision {
Expand Down Expand Up @@ -240,7 +239,7 @@ class ExoticVectorLikeTrackValues {
protected _values: MayBeQuantized;

@serializable
protected _isQuantized: boolean;
protected _isQuantized = false;
}

@ccclass(`${CLASS_NAME_PREFIX_ANIM}ExoticVec3TrackValues`)
Expand Down
5 changes: 5 additions & 0 deletions editor/i18n/en/components.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
module.exports = {
components: {
add_component: 'Add Component',

animation: {
use_baked_animation_tips: 'When a skeleton animation is pre-baked, its bones do not move in real-time. If you need to attach external nodes to specific bone joints, it is recommended to use <ui-link value="https://docs.cocos.com/creator/manual/en/animation/skeletal-animation.html#socket-system"> Sockets System </ui-link>.',
},

safe_area: {
brief_help:
'This component is used to adjust the layout of current node to respect the safe area of a notched mobile device such as the iPhone X.' +
Expand Down
5 changes: 5 additions & 0 deletions editor/i18n/zh/components.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
module.exports = {
components: {
add_component: '添加组件',

animation: {
use_baked_animation_tips: '使用预烘焙动画,骨骼在运行时不会实时移动,如需将某些外部节点挂到指定的骨骼关节上,请使用 <ui-link value="https://docs.cocos.com/creator/manual/zh/animation/skeletal-animation.html#socket-system">Sockets 挂点系统</ui-link>。',
},

safe_area: {
brief_help:
'该组件会将所在节点的布局适配到 iPhone X 等异形屏手机的安全区域内,通常用于 UI 交互区域的顶层节点。该组件将在真机上将自动生效,在编辑器下没有效果。',
Expand Down
1 change: 1 addition & 0 deletions editor/inspector/components.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module.exports = {
'cc.SafeArea': join(__dirname, './components/safe-area.js'),
'cc.ScrollView': join(__dirname, './components/scroll-view.js'),
'cc.SkinnedMeshBatchRenderer': join(__dirname, './components/batched-skinning-model.js'),
'cc.SkeletalAnimation': join(__dirname, './components/skeletal-animation.js'),
'cc.SphereLight': join(__dirname, './components/sphere-light.js'),
'cc.SpotLight': join(__dirname, './components/spot-light.js'),
'cc.PointLight': join(__dirname, './components/point-light.js'),
Expand Down
44 changes: 44 additions & 0 deletions editor/inspector/components/skeletal-animation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
const { template, $, update } = require('./base');

exports.template = template;
exports.$ = $;
exports.update = update;

exports.style = `
.use_baked_animation_tips {
color: #707070;
}
.use_baked_animation_tips_hidden {
display: none;
}
`;

function updateTipsState(parent, hidden) {
let tips = parent.getElementsByClassName('use_baked_animation_tips')[0];
if (!tips) {
tips = document.createElement('ui-label');
tips.value = `i18n:ENGINE.components.animation.use_baked_animation_tips`;
tips.classList.add('use_baked_animation_tips', 'use_baked_animation_tips_hidden');
parent.appendChild(tips);
}
if (hidden) {
tips.classList.add('use_baked_animation_tips_hidden');
} else {
tips.classList.remove('use_baked_animation_tips_hidden');
}
return tips;
}

exports.elements = {
useBakedAnimation: {
update(element, dump) {
updateTipsState(element, !dump.useBakedAnimation.value);
}
}
};

exports.ready = function() {
this.elements = exports.elements;
};

exports.close = function() {}
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,11 @@ if (cc.internal.VideoPlayer) {
let self = this;
let video = this._video;
if (!video || !this._visible) return;

// HACK: this is to unify inconsistent behavior (on Android, video won't play from begin if called pause() before called stop().
// but if called play() before stop(), video will play from begin.) of wechat official interface on Android & iOS.
if (!this._playing) {
video.play();
}
video.stop().then(function (res) {
if (res.errMsg && !res.errMsg.includes('ok')) {
console.error('failed to stop video player');
Expand Down

0 comments on commit 1cb1f70

Please sign in to comment.