示例#1
0
        // Use this for initialization
        void Start()
        {
            NextJumpButton.Init();
            NextJumpButton.SetButtonClickableOrNot(false);
            globalDataManager  = FindObjectOfType <GlobalDataManager> ();
            PopHeroFullManager = FindObjectOfType <WindowPopManager>();

            var _dataList = HeroDataManager.Instance.GetHeroDataList();
            List <HeroDataFormat> _heroDataList = new List <HeroDataFormat> ();

            List <HeroSaveDataFormat> _heroSaveDataList = HeroSaveDataManager.Instance.HeroSaveDataList;

            heroToBeReplaceList = new List <HeroSaveDataFormat> ();
            int _lastestSlotId = UserSaveDataManager.Instance.LastestHeroSlotID;

            for (int i = 0; i < _heroSaveDataList.Count; i++)
            {
                if (_heroSaveDataList [i].SlotID != _lastestSlotId)
                {
                    heroToBeReplaceList.Add(_heroSaveDataList[i]);
                    _heroDataList.Add(_dataList[i]);
                }
            }

            //FIXME : yangzhi-wang Get the name string by Array
            for (int i = 0; i < HeroControllers.Length; i++)
            {
                HeroControllers [i].Init(_heroDataList[i]);
                HeroControllers [i].DisplayInfo(new HeroFullCanvasHeroDataFormat(heroToBeReplaceList[i].NameString,
                                                                                 heroToBeReplaceList[i].Level,
                                                                                 new HeroIconDataFormat(_heroDataList[i].AnimationInfo.TexturePath, _heroDataList[i].AnimationInfo.IconID)));

                HeroControllers [i].HeroSaveButtonViewShow(HeroKeepOffSprite);
            }
        }
 // Use this for initialization
 void Start()
 {
     globalDataManager = FindObjectOfType <GlobalDataManager> ();
     heroSaveDataList  = HeroSaveDataManager.Instance.HeroSaveDataList;
     //if hero number is 1, hero0's slotId = 0, so nextHeroSlotId = 1
     //if hero number is 2, hero0's slotId = 0, hero1's slotId = 1, so nextHeroSlotId = 2
     this.nextSlotID         = heroSaveDataList.Count;
     PopHeroLessThan3Manager = FindObjectOfType <WindowPopManager>();
 }