|
@@ -0,0 +1,30 @@
|
|
|
+// Learn TypeScript:
|
|
|
+// - https://docs.cocos.com/creator/2.4/manual/en/scripting/typescript.html
|
|
|
+// Learn Attribute:
|
|
|
+// - https://docs.cocos.com/creator/2.4/manual/en/scripting/reference/attributes.html
|
|
|
+// Learn life-cycle callbacks:
|
|
|
+// - https://docs.cocos.com/creator/2.4/manual/en/scripting/life-cycle-callbacks.html
|
|
|
+
|
|
|
+import EventName from "./EventName/EventName";
|
|
|
+import MyComponent from "./Template/MyComponent";
|
|
|
+
|
|
|
+const { ccclass, property } = cc._decorator;
|
|
|
+
|
|
|
+@ccclass
|
|
|
+export default class Over extends MyComponent {
|
|
|
+ @property(cc.Label)
|
|
|
+ Hight: cc.Label = null;
|
|
|
+
|
|
|
+ @property(cc.Label)
|
|
|
+ label: cc.Label = null;
|
|
|
+
|
|
|
+ onLoad() {
|
|
|
+ this.regEvent(EventName.Over, this.Over, this)
|
|
|
+ }
|
|
|
+ Over() {
|
|
|
+ this.node.opacity = 255
|
|
|
+ this.label.string = this.Hight.string
|
|
|
+ }
|
|
|
+
|
|
|
+ // update (dt) {}
|
|
|
+}
|