Esempio n. 1
0
    public void Init(int xianId)
    {
        m_xianId = xianId;

        var xianConfig = GameManager.instance.xianConfigs.GetById(xianId);

        m_xianConfig = xianConfig;

        headImage.sprite = xianConfig.spr;
        textName.text    = xianConfig.name;

        XianData datXian = DataManager.instance.GetXianData(m_xianId);

        if (datXian != null)
        {
            textLv.text   = "Lv:" + (datXian.lv + 1).ToString();
            textCoin.text = "";
        }
        else
        {
            textLv.text   = "";
            textCoin.text = "";
        }

        this.UpdateButtonStatus();
    }
Esempio n. 2
0
    public void Init(XianData datXian)
    {
        m_datXian = datXian;
        m_cfgXian = GameManager.instance.xianConfigs [m_datXian.id];

        maxHP = m_cfgXian.MaxHP(m_datXian.lv);
        hp    = maxHP;
        atk   = m_cfgXian.MaxAtk(m_datXian.lv);
        // atkSpeed = _cfgXian.atkSpeedAtLv0 + _datXian.lv * _cfgXian.atkSpeedFactor;

        var sprRender = GetComponent <SpriteRenderer> ();

        sprRender.sprite = m_cfgXian.spr;
    }
Esempio n. 3
0
 private MXian(int xianId)
 {
     m_cfgXian = GameManager.instance.xianConfigs.GetById(xianId);
     m_datXian = DataManager.instance.GetXianData(xianId);
 }