예제 #1
0
    public void LoadConfigs()
    {
        //UIWindows配置表
        ReadCsv config = new ReadCsv("UIWindows");

        for (int i = 3; i < config.GetRow(); i++)
        {
            UIWindowsData data = new UIWindowsData(config, i);
            this.UIWindowsDataDict_.Add(data._id, data);
        }

        //BattleSatge配置表
        config = new ReadCsv("BattleSatge");
        for (int i = 3; i < config.GetRow(); i++)
        {
            BattleSatgeConfigData data = new BattleSatgeConfigData(config, i);
            this.BattleSatgeConfigDict.Add(data._id, data);
        }

        //HeroConfigData配置表
        config = new ReadCsv("Hero");
        for (int i = 3; i < config.GetRow(); i++)
        {
            HeroConfigData data = new HeroConfigData(config, i);
            this.HeroConfigDict.Add(data._id, data);
        }
    }
예제 #2
0
    public void UpdateUI(HeroConfigData data)
    {
        this.Data      = data;
        this.Name.text = this.Data._name;
        Texture tex = Resources.Load("Atlas/HaflHeadIcon/role" + this.Data._id.ToString("00")) as Texture;

        this.RoleImage.mainTexture = tex;
        this.RoleImage.MakePixelPerfect();
        this.RoleImage.transform.localScale = Vector3.one * 0.5f;
    }
예제 #3
0
    public void Init(BattleRoleData data)
    {
        this.RoleData     = data;
        this.Slider.value = (data.CurHp + 0.00f) / data.MaxHp;
        HeroConfigData cfg = ConfigDataManager.QueryHeroCfgByID(data.RoleID);

        if (cfg != null)
        {
            this.Label_Name.text = cfg._name;
        }
    }
예제 #4
0
 private void InitBattleAttrData()
 {
     if (ConfigData.Instance.HeroConfigDict.ContainsKey(this.RoleID))
     {
         HeroConfigData roleCfg = ConfigData.Instance.HeroConfigDict[this.RoleID];
         this.MaxHp           = roleCfg._hp;
         this.CurHp           = roleCfg._hp;
         this.Atk             = roleCfg._atk;
         this.Speed           = roleCfg._speed;
         this.Def             = roleCfg._def;
         this.AtkRange        = roleCfg._atkRange;
         this.TempDecHpByHurt = 0;
         this.CurEnergy       = 0;
     }
 }