天赋信息显示,todo:替换
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { _decorator, Component, Label, Node, resources, Sprite, SpriteAtlas } from 'cc';
|
||||
import { _decorator, Component, Label, Node, resources, Sprite, SpriteAtlas, tween, v3 } from 'cc';
|
||||
import { oops } from 'db://oops-framework/core/Oops';
|
||||
import { GameEvent } from '../common/config/GameEvent';
|
||||
import { smc } from '../common/SingletonModuleComp';
|
||||
@@ -98,7 +98,52 @@ export class TalsComp extends Component {
|
||||
icon.getChildByName("q4").active=TalentList[uuid].quality==Quality.PURPLE
|
||||
icon.getChildByName("q5").active=TalentList[uuid].quality==Quality.ORANGE
|
||||
}
|
||||
|
||||
to_change_tal(){
|
||||
console.log("[TalsComp]:to_change_tal")
|
||||
}
|
||||
close_tal_info(){
|
||||
console.log("[TalsComp]:close_tal_info")
|
||||
let node= this.node.getChildByName("info")
|
||||
tween(node).to(0.1,{position:v3(-1000,node.position.y,0)}).start()
|
||||
}
|
||||
show_tal_info(e:any,data:any){
|
||||
console.log("[TalsComp]:show_tal_info",e,data)
|
||||
let uuid=0
|
||||
switch(data){
|
||||
case TalentSlot[0]:
|
||||
if(this.tal1.uuid==0) return
|
||||
uuid=this.tal1.uuid
|
||||
break
|
||||
case TalentSlot[1]:
|
||||
if(this.tal2.uuid==0) return
|
||||
uuid=this.tal2.uuid
|
||||
break
|
||||
case TalentSlot[2]:
|
||||
if(this.tal3.uuid==0) return
|
||||
uuid=this.tal3.uuid
|
||||
break
|
||||
case TalentSlot[3]:
|
||||
if(this.tal4.uuid==0) return
|
||||
uuid=this.tal4.uuid
|
||||
break
|
||||
case TalentSlot[4]:
|
||||
if(this.tal5.uuid==0) return
|
||||
uuid=this.tal5.uuid
|
||||
break
|
||||
case TalentSlot[5]:
|
||||
if(this.tal6.uuid==0) return
|
||||
uuid=this.tal6.uuid
|
||||
break
|
||||
}
|
||||
let node= this.node.getChildByName("info")
|
||||
var icon_path = "game/heros/cards"
|
||||
resources.load(icon_path, SpriteAtlas, (err: any, atlas) => {
|
||||
const sprite = node.getChildByName("tal").getComponent(Sprite);
|
||||
sprite.spriteFrame = atlas.getSpriteFrame(TalentList[uuid].path);
|
||||
});
|
||||
node.getChildByName("info").getComponent(Label).string=TalentList[uuid].info
|
||||
tween(node).to(0.1,{position:v3(0,node.position.y,0)}).start()
|
||||
}
|
||||
// 重置所有属性为0
|
||||
private reset_attrs() {
|
||||
this.tal1={
|
||||
|
||||
Reference in New Issue
Block a user