薛鸿潇 5 سال پیش
والد
کامیت
7bffaaa478

+ 16 - 8
mk_framework/assets/script/game/component/tween/FrameAnimation.ts

@@ -18,14 +18,22 @@ const { ccclass, property, executeInEditMode, playOnFocus } = cc._decorator;
 @playOnFocus()
 @playOnFocus()
 export default class FrameAnimation extends cc.Component {
 export default class FrameAnimation extends cc.Component {
 
 
-    @property({ displayName: '精灵纹理', type: cc.SpriteFrame }) private images: cc.SpriteFrame[] = [];
-    @property({ displayName: '每帧间隔' }) private frameTime: number = 0.1;
-    @property({ displayName: '播放次数' }) private playTimes: number = 0;
-    @property({ displayName: "是否倒播", tooltip: "勾选,倒着播放,不钩,顺序播放" }) private reverse: boolean = false;
-    @property({ displayName: '自动播放' }) private autoPlayOnLoad: boolean = true;
-    @property({ displayName: "自动销毁", tooltip: '播完自动销毁' }) private autoDestroy: boolean = false;
-    @property({ displayName: "每帧回调", type: cc.Component.EventHandler }) onFrameCall: cc.Component.EventHandler = new cc.Component.EventHandler();
-    @property({ displayName: "结束回调", type: cc.Component.EventHandler }) onCompleteCall: cc.Component.EventHandler = new cc.Component.EventHandler();
+    @property({ displayName: '精灵纹理', type: cc.SpriteFrame })
+    private images: cc.SpriteFrame[] = [];
+    @property({ displayName: '每帧间隔' })
+    private frameTime: number = 0.1;
+    @property({ displayName: '播放次数' })
+    private playTimes: number = 0;
+    @property({ displayName: "是否倒播", tooltip: "勾选,倒着播放,不钩,顺序播放" })
+    private reverse: boolean = false;
+    @property({ displayName: '自动播放' })
+    private autoPlayOnLoad: boolean = true;
+    @property({ displayName: "自动销毁", tooltip: '播完自动销毁' })
+    private autoDestroy: boolean = false;
+    @property({ displayName: "每帧回调", type: cc.Component.EventHandler })
+    onFrameCall: cc.Component.EventHandler = new cc.Component.EventHandler();
+    @property({ displayName: "结束回调", type: cc.Component.EventHandler })
+    onCompleteCall: cc.Component.EventHandler = new cc.Component.EventHandler();
     /** 编辑器预览 */
     /** 编辑器预览 */
     private _edit_play: boolean = false;
     private _edit_play: boolean = false;
     @property({ displayName: '编辑器预览' })
     @property({ displayName: '编辑器预览' })

+ 4 - 2
mk_framework/assets/script/game/component/tween/RopeSwung.ts

@@ -9,8 +9,10 @@ const { ccclass, property, executeInEditMode, playOnFocus } = cc._decorator;
 @playOnFocus()
 @playOnFocus()
 export default class RopeSwung extends cc.Component {
 export default class RopeSwung extends cc.Component {
 
 
-    @property({ displayName: '摆动角度' }) private angle: number = 15;
-    @property({ displayName: '摆动时间', tooltip: '摆动1/4距离消耗的时间' }) private time: number = 1;
+    @property({ displayName: '摆动角度' }) 
+    private angle: number = 15;
+    @property({ displayName: '摆动时间', tooltip: '摆动1/4距离消耗的时间' }) 
+    private time: number = 1;
 
 
     /** 编辑器预览 */
     /** 编辑器预览 */
     private _edit_play: boolean = false;
     private _edit_play: boolean = false;

+ 34 - 17
mk_framework/assets/script/game/component/tween/UITween.ts

@@ -7,9 +7,12 @@ const { ccclass, property, executeInEditMode, playOnFocus } = cc._decorator;
  */
  */
 @ccclass("PropsData")
 @ccclass("PropsData")
 export class PropsData {
 export class PropsData {
-    @property({ displayName: "坐标" }) public position: cc.Vec2 = cc.Vec2.ZERO;
-    @property({ displayName: "旋转" }) public angle: number = 0;
-    @property({ displayName: "缩放" }) public scale: number = 1;
+    @property({ displayName: "坐标" })
+    public position: cc.Vec2 = cc.Vec2.ZERO;
+    @property({ displayName: "旋转" })
+    public angle: number = 0;
+    @property({ displayName: "缩放" })
+    public scale: number = 1;
 }
 }
 /**
 /**
  * 缓动数据
  * 缓动数据
@@ -17,13 +20,20 @@ export class PropsData {
  */
  */
 @ccclass("TweenData")
 @ccclass("TweenData")
 export class TweenData {
 export class TweenData {
-    @property({ displayName: "属性数据", type: PropsData }) public propsData: PropsData = new PropsData();
-    @property({ displayName: "持续时间", tooltip: '单位:秒' }) public duration: number = 0.3;
-    @property({ displayName: "延迟时间", tooltip: '单位:秒' }) public delay: number = 0;
-    @property({ displayName: "是否为差值" }) public isOffset: boolean = false;
-    @property({ displayName: '完成回调', tooltip: "缓动完成时触发", type: cc.Component.EventHandler }) public onComplete: cc.Component.EventHandler = new cc.Component.EventHandler();
-    @property({ displayName: '开始回调', tooltip: "缓动启动时触发", type: cc.Component.EventHandler }) public onStart: cc.Component.EventHandler = new cc.Component.EventHandler();
-    @property({ displayName: '过程回调', tooltip: "缓动更新时触发", type: cc.Component.EventHandler }) public onUpdate: cc.Component.EventHandler = new cc.Component.EventHandler();
+    @property({ displayName: "属性数据", type: PropsData })
+    public propsData: PropsData = new PropsData();
+    @property({ displayName: "持续时间", tooltip: '单位:秒' })
+    public duration: number = 0.3;
+    @property({ displayName: "延迟时间", tooltip: '单位:秒' })
+    public delay: number = 0;
+    @property({ displayName: "是否为差值" })
+    public isOffset: boolean = false;
+    @property({ displayName: '完成回调', tooltip: "缓动完成时触发", type: cc.Component.EventHandler })
+    public onComplete: cc.Component.EventHandler = new cc.Component.EventHandler();
+    @property({ displayName: '开始回调', tooltip: "缓动启动时触发", type: cc.Component.EventHandler })
+    public onStart: cc.Component.EventHandler = new cc.Component.EventHandler();
+    @property({ displayName: '过程回调', tooltip: "缓动更新时触发", type: cc.Component.EventHandler })
+    public onUpdate: cc.Component.EventHandler = new cc.Component.EventHandler();
 }
 }
 /**
 /**
  * 缓动组件,目前只支持节点的三个基础属性
  * 缓动组件,目前只支持节点的三个基础属性
@@ -33,13 +43,20 @@ export class TweenData {
 @executeInEditMode()
 @executeInEditMode()
 @playOnFocus()
 @playOnFocus()
 export class UITween extends cc.Component {
 export class UITween extends cc.Component {
-    @property({ displayName: "节点初始属性", type: PropsData }) public fromData: PropsData = new PropsData();
-    @property({ displayName: "节点目标属性", type: TweenData }) public targetData: TweenData[] = [];
-    @property({ displayName: '缓动节点', tooltip: "要播放缓动动画的目标,不填则是当前节点", type: cc.Node }) public target: cc.Node = null;
-    @property({ displayName: "缓动效果", type: cc.Enum(TweenEasing) }) public tweenEasing: TweenEasing = TweenEasing.linear;
-    @property({ displayName: '执行次数', tooltip: "为0则一直重复执行" }) public repeat: number = 1;
-    @property({ displayName: "单次完成回调", tooltip: '单次缓动序列执行完毕时触发', type: cc.Component.EventHandler }) public onOneRepeatComplete: cc.Component.EventHandler = new cc.Component.EventHandler();
-    @property({ displayName: "自动播放" }) public playOnLoad: boolean = false;
+    @property({ displayName: "节点初始属性", type: PropsData })
+    public fromData: PropsData = new PropsData();
+    @property({ displayName: "节点目标属性", type: TweenData })
+    public targetData: TweenData[] = [];
+    @property({ displayName: '缓动节点', tooltip: "要播放缓动动画的目标,不填则是当前节点", type: cc.Node })
+    public target: cc.Node = null;
+    @property({ displayName: "缓动效果", type: cc.Enum(TweenEasing) })
+    public tweenEasing: TweenEasing = TweenEasing.linear;
+    @property({ displayName: '执行次数', tooltip: "为0则一直重复执行" })
+    public repeat: number = 1;
+    @property({ displayName: "单次完成回调", tooltip: '单次缓动序列执行完毕时触发', type: cc.Component.EventHandler })
+    public onOneRepeatComplete: cc.Component.EventHandler = new cc.Component.EventHandler();
+    @property({ displayName: "自动播放" }) 
+    public playOnLoad: boolean = false;
 
 
     private _edit_play: boolean = false;
     private _edit_play: boolean = false;
     @property({ displayName: "编辑器预览" })
     @property({ displayName: "编辑器预览" })