var LevelStates = require('LevelStates'); cc.Class({ extends: cc.Component, properties: { Flags: { default: [], type: cc.SpriteFrame, }, StartLineFlag: { default: LevelStates.StartFlags.SprintFlag, type: cc.Enum(LevelStates.StartFlags) }, // StartFlag: cc.Node, StartFlag: cc.Sprite, }, onLoad: function () { //console.log(this.StartLineFlag,this.StartFlag.sprintFrame ,this.Flags[0]); //this.StartFlag.getComponent(cc.Sprite).spriteFrame = this.Flags[this.StartLineFlag]; // console.log('currentSportsType',GlobalData.spawnManager.currentSportsType) this.StartFlag.spriteFrame = this.Flags[GlobalData.spawnManager.currentSportsType]; } });