Beispiel #1
0
    IEnumerator InitPlayerInfo()
    {
        while (GamingData.INSTANCE().HeroState == null)
        {
            yield return(null);
        }
        GamingData.INSTANCE().HeroState.maxHp = GamingData.INSTANCE().HeroState.level * 100;
        GamingData.INSTANCE().HeroState.maxMp = GamingData.INSTANCE().HeroState.level * 100;
        GamingData.INSTANCE().HeroState.levelUpExp = GamingData.INSTANCE().HeroState.level * 100;

        hp_Fill.fillAmount = GamingData.INSTANCE().HeroState.hp / GamingData.INSTANCE().HeroState.maxHp;
        mp_Fill.fillAmount = GamingData.INSTANCE().HeroState.sp / GamingData.INSTANCE().HeroState.maxMp;
        ep_Fill.fillAmount = GamingData.INSTANCE().HeroState.cueeExp / GamingData.INSTANCE().HeroState.levelUpExp;

        hp_Text.text = ((int)((GamingData.INSTANCE().HeroState.hp / GamingData.INSTANCE().HeroState.maxHp) * 100f)).ToString() + "%";
        mp_Text.text = ((int)((GamingData.INSTANCE().HeroState.sp / GamingData.INSTANCE().HeroState.maxMp) * 100f)).ToString() + "%";

        if (GamingData.heroType == 0)
        {
            avatar_Img.sprite = Resources.Load <Sprite>("Item/00");
        }
        else
        {
            avatar_Img.sprite = Resources.Load <Sprite>("Item/01");
        }

        level_Text.text    = GamingData.INSTANCE().HeroState.level.ToString();
        nikeName_Text.text = GamingData.nickname;
    }
Beispiel #2
0
 //初始化英雄系统
 public override void Init()
 {
     heroInfo  = new HeroInfo(this);
     inventory = new Inventory(this);
     equips    = new Equips(this);
     heroInfo.InitHeroInfo(GamingData.INSTANCE().HeroState);
     inventory.Init(GamingData.INSTANCE().InvenrotyInfo);
     equips.Init(GamingData.INSTANCE().EquipsInfo);
     EventCenter.AddListener(EventDefine.FinishTaskDelete, DeleteItems);
     EventCenter.AddListener(EventDefine.FinishTaskGet, GetItems);
     EventCenter.Broadcast(EventDefine.InitBag, inventory.GetInventoryInfo);
 }
Beispiel #3
0
 public GamingDataController(GameSystem _system) : base(_system)
 {
     //实例化数据实体
     data = GamingData.INSTANCE();
 }
Beispiel #4
0
 /// <summary>
 /// 剧情系统的初始化
 /// </summary>
 public override void Init()
 {
     npcSystem.InitNpcSystem(GamingData.synData.npcState);
     taskSystem.InitTaskSystem(GamingData.synData.taskID, GamingData.synData.taskState, GamingData.INSTANCE().InvenrotyInfo);
     ShowMiniTaskPanel();
     //TODO 任务系统初始化
     //拿到当前的任务编号,拿到当前任务,将当前任务的初值赋值进去,根据任务编号初始化npc状态
     //TODO 对话系统初始化
 }