|
@@ -1,4 +1,4 @@
|
|
-import { _decorator, Component, Director, director, instantiate, Node, Size, Vec2, Vec3 } from 'cc';
|
|
|
|
|
|
+import { _decorator, Component, Director, director, instantiate, Node, Size, SpriteFrame, Vec2, Vec3 } from 'cc';
|
|
import { ClientEvent } from '../clientEvent';
|
|
import { ClientEvent } from '../clientEvent';
|
|
import { config } from '../config';
|
|
import { config } from '../config';
|
|
import { att_ani_data, att_click_data, att_count_down, att_drag_data, att_question_select, att_text_sound_data, att_top_data, attributes_data, scene_tips_rule_data, widget_item_data } from '../../data/data';
|
|
import { att_ani_data, att_click_data, att_count_down, att_drag_data, att_question_select, att_text_sound_data, att_top_data, attributes_data, scene_tips_rule_data, widget_item_data } from '../../data/data';
|
|
@@ -214,7 +214,19 @@ export class Attributes extends Component {
|
|
}
|
|
}
|
|
|
|
|
|
onChangeOrigin(){
|
|
onChangeOrigin(){
|
|
- ClientEvent.dispatchEvent(config.Event.UpdateAttributesToView,this.cur_att_data,config.attributes_list_type.origin)
|
|
|
|
|
|
+ let call_back = (()=>{
|
|
|
|
+ ClientEvent.dispatchEvent(config.Event.UpdateAttributesToView,this.cur_att_data,config.attributes_list_type.origin)
|
|
|
|
+ })
|
|
|
|
+ if(this.cur_att_data.src) {
|
|
|
|
+ tools.loadUrl(this.cur_att_data.src,null,(sf:SpriteFrame)=>{
|
|
|
|
+ // console.log('sf=',sf.originalSize)
|
|
|
|
+ this.cur_att_data.width = sf.originalSize.width
|
|
|
|
+ this.cur_att_data.height = sf.originalSize.height
|
|
|
|
+ call_back()
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ call_back()
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
onChangePos(pos:Vec3){
|
|
onChangePos(pos:Vec3){
|