示例#1
0
    public void LoadMonster(EnemyInstance enemy)
    {
        this._enemyInstance = enemy;
        Image.sprite        = Resources.Load <Sprite>(Constants.EnemyImagePath + Path.DirectorySeparatorChar + this._enemyInstance.Image);
        if (null == Image.sprite)
        {
            Debug.Log("CardInstance: unable to load enemy image: " + Constants.EnemyImagePath + Path.DirectorySeparatorChar + this._enemyInstance.Image);
        }

        SetScale(enemy.GetModel().Scale);

        SetHP(_enemyInstance.HealthPoint.Property);
        SetArmor(_enemyInstance.Armor.Property);
        SetDefence(_enemyInstance.Defence.Property);
        SetBuffs(_enemyInstance.BuffList.GetCount());
        SetElement(_enemyInstance.Element);

        _enemyInstance.HealthPoint.AddListener(this);
        _enemyInstance.Armor.AddListener(this);
        _enemyInstance.Defence.AddListener(this);
        _enemyInstance.BuffList.AddListener(this);
    }