| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- cc.Class({
- extends: cc.Component,
- properties: {
- gStat: {
- default: null,
- type: cc.Node,
- serializable: true,
- },
- logIn: cc.Prefab,
- avatar:cc.Sprite,
- dcPoint:cc.Label,
- gcPoint:cc.Label,
- activity:cc.Label,
- logInAvatar:cc.SpriteFrame
- },
- onLoad () {
- this.gStatScp = this.gStat.getComponent('GameStates');
- },
- IsLogIn(component)
- {
- if(this.gStatScp.bLogin)
- {
- return true;
- }
- else
- {
- let tPrefab = cc.instantiate(this.logIn);
- tPrefab.parent = component.node;
- tPrefab.setPosition(0,0);
- let scp = tPrefab.getComponent('login');
- scp.gameStates = this.gStat;
- scp.init();
- scp.avatar = this.avatar;
- scp.dcPoint = this.dcPoint;
- scp.gcPoint = this.gcPoint;
- scp.activity = this.activity;
- scp.logInAvatar = this.logInAvatar;
- return false;
- }
- }
- });
|