Exemple #1
0
        public override void Init(ResourceLoader loader, EntitySetting template)
        {
            base.Init(loader, template);

            MonsterEntitySetting setting = template as MonsterEntitySetting;
            AttrComp.MoveSpeedBase = setting.MoveSpeed;
            AttrComp.MaxHpBase = setting.MaxHp;
            AttrComp.Hp = AttrComp.MaxHp;
            AttrComp.RegisterAttrChangeCallback(AttrName.Hp, OnHpChange);
        }
Exemple #2
0
        public override void Init(ResourceLoader loader, EntitySetting template)
        {
            base.Init(loader, template);

            AtkComp = AddComp<AtkComp>();

            TowerEntitySetting setting = (TowerEntitySetting)template;
            AttrComp.AtkBase = setting.Atk;
            AttrComp.AtkSpeedBase = setting.AtkSpeed;
            AttrComp.AtkRangeBase = setting.AtkRange;
            AttrComp.AtkTypes.AddRange(setting.AtkTypeArr);
        }