|
@@ -11,11 +11,9 @@ import { tgxUIMgr } from '../../core_tgx/tgx';
|
|
|
import { UI_BattleGambit } from '../../scripts/UIDef';
|
|
|
|
|
|
const { ccclass, property } = _decorator;
|
|
|
+//动画时长
|
|
|
+export const ANIMATION_DURATION = 0.5;
|
|
|
|
|
|
-enum ERaycastType {
|
|
|
- ALL,
|
|
|
- CLOSEST
|
|
|
-}
|
|
|
@ccclass('LevelAction')
|
|
|
export class LevelAction extends Component {
|
|
|
|
|
@@ -41,7 +39,6 @@ export class LevelAction extends Component {
|
|
|
private _originalRotation: Vec3 = v3();
|
|
|
|
|
|
//镜头拉近属性
|
|
|
- private _zoomDuration: number = 0.5; // 拉近持续时间(秒)
|
|
|
private isTweening: boolean = false;
|
|
|
|
|
|
onLoad(): void {
|
|
@@ -147,7 +144,7 @@ export class LevelAction extends Component {
|
|
|
const targetPos = currentPos.add(forward.multiplyScalar(distance));
|
|
|
|
|
|
tween(this.camera.node.position)
|
|
|
- .to(this._zoomDuration, targetPos, {
|
|
|
+ .to(ANIMATION_DURATION, targetPos, {
|
|
|
easing: 'smooth',
|
|
|
onUpdate: (target: Vec3) => {
|
|
|
this.camera.node.position = target;
|
|
@@ -191,7 +188,7 @@ export class LevelAction extends Component {
|
|
|
|
|
|
this.isTweening = true;
|
|
|
tween(tweenObj)
|
|
|
- .to(0.5, {
|
|
|
+ .to(ANIMATION_DURATION, {
|
|
|
pitch: targetPitch,
|
|
|
yaw: targetYaw
|
|
|
}, {
|
|
@@ -205,7 +202,6 @@ export class LevelAction extends Component {
|
|
|
}
|
|
|
})
|
|
|
.start();
|
|
|
-
|
|
|
}
|
|
|
|
|
|
private adjustRotationLimits() {
|