|
@@ -30,7 +30,11 @@ export class widget_base extends Component {
|
|
|
this.mData = data;
|
|
|
this.icon.getComponent(UITransform).contentSize = new Size(this.mData.att.width,this.mData.att.height)
|
|
|
this.icon.position = new Vec3(this.mData.att.x,this.mData.att.y)
|
|
|
- this.icon.angle = this.mData.att.rotation
|
|
|
+ if(this.mData.att.rotation==undefined||this.mData.att.rotation==null) {
|
|
|
+ this.icon.angle = 0
|
|
|
+ } else {
|
|
|
+ this.icon.angle = this.mData.att.rotation
|
|
|
+ }
|
|
|
if(this.icon.getComponent(UIOpacity)===null){
|
|
|
this.icon.addComponent(UIOpacity)
|
|
|
}
|