Exemple #1
0
    public HeroStatus(Hero hero, int floorIndex, HeroBaseInfo info)
    {
        this.id = info.id;

        this.hero    = hero;
        this.heroObj = hero.transform;

        this.table      = info.GetTable();
        this.floorIndex = floorIndex;

        this.level      = info.level;
        this.skillLevel = info.skillLevel;

        this.attackSpeed = table.attackSpeed;
        this.attackRange = table.attackRange;
        this.moveSpeed   = table.moveSpeed;

        this.buffList = new List <BuffParam>();

        if (HeroAddValueTable.Instance != null &&
            HeroAddValueTable.Instance.FindTable(this.table.archiType, out addValueTableList))
        {
            this.curDamage = table.damage +
                             addValueTableList[Mathf.Clamp(info.level, 0, addValueTableList.Count - 1)].addDamageValue;
        }

        if (EffectTable.Instance != null &&
            EffectTable.Instance.FindTable(info.GetTable().attackEffectID, out effectTable) == false)
        {
            SupportDebug.LogError(string.Format("EffectTable not found. {0}", info.GetTable().attackEffectID));
        }

        curTargetEnemy = null;
    }
Exemple #2
0
    public void Init(HeroBaseInfo info, TowerPlaceToken token)
    {
        if (gameObject.activeSelf == false)
        {
            gameObject.SetActive(true);
        }

        StopAllCoroutines();

        gameObject.transform.localPosition = new Vector3(0, token.obj.transform.localPosition.y);
        status = new HeroStatus(this, token.FloorIndex, info);

        token.AddPlacedHero(this);

        StartCoroutine("Process");
    }