| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- cc.Class({
- extends: cc.Component,
- properties: {
- Name:cc.String,
- AllowSpriteFrame:cc.SpriteFrame,
- NotAllowSpriteFrame:cc.SpriteFrame,
- },
- start () {
- if(this.Name == 'Food')
- {
- if(GlobalD.GameData.GetFoodTradeState())
- {
- this.node.getComponent(cc.Sprite).spriteFrame = this.AllowSpriteFrame;
- }
- else
- {
- this.node.getComponent(cc.Sprite).spriteFrame = this.NotAllowSpriteFrame;
- }
- }
- else if(this.Name == 'Wood')
- {
- if(GlobalD.GameData.GetWoodTradeState())
- {
- this.node.getComponent(cc.Sprite).spriteFrame = this.AllowSpriteFrame;
- }
- else
- {
- this.node.getComponent(cc.Sprite).spriteFrame = this.NotAllowSpriteFrame;
- }
- }
- else if(this.Name == 'Mineral')
- {
- if(GlobalD.GameData.GetMineralTradeState())
- {
- this.node.getComponent(cc.Sprite).spriteFrame = this.AllowSpriteFrame;
- }
- else
- {
- this.node.getComponent(cc.Sprite).spriteFrame = this.NotAllowSpriteFrame;
- }
- }
- },
- });
|