|
@@ -1,8 +1,10 @@
|
|
|
import { _decorator, Component, Node, Prefab, LayoutComponent, instantiate, ScrollViewComponent } from 'cc';
|
|
|
import { GUIManager } from '../../../engines/gui/GUIManager';
|
|
|
import { GUIMediator } from '../../../engines/gui/GUIMediator';
|
|
|
+import { DataModelEventType } from '../../../engines/models/DataModelEventType';
|
|
|
import GameConfigManager from '../../models/GameConfigManager';
|
|
|
import { GameModel } from '../../models/GameModel';
|
|
|
+import { GamePropertys } from '../../models/GamePropertys';
|
|
|
import { UIConst } from '../UIConst';
|
|
|
import { ShopItemRenderScript } from './ShopItemRenderScript';
|
|
|
const { ccclass, property } = _decorator;
|
|
@@ -50,11 +52,16 @@ export class ShopMediator extends GUIMediator {
|
|
|
}
|
|
|
|
|
|
private AddEvent():void{
|
|
|
-
|
|
|
+ GameModel.single.AddEvent(DataModelEventType.PROPERTY_CHANGED,this,this.GameModelPropertyChanged,0);
|
|
|
}
|
|
|
|
|
|
private RemoveEvent():void{
|
|
|
-
|
|
|
+ GameModel.single.RemoveEvent(DataModelEventType.PROPERTY_CHANGED,this,this.GameModelPropertyChanged);
|
|
|
+ }
|
|
|
+ private GameModelPropertyChanged(key:string) {
|
|
|
+ if(key==GamePropertys.WeaponCell){
|
|
|
+ this.RefreshList(false);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
private RefreshList(srollToZ:boolean):void{
|