コード例 #1
0
ファイル: MonsterEntity.cs プロジェクト: kidsang/ProjectJ
        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);
        }
コード例 #2
0
ファイル: TowerEntity.cs プロジェクト: kidsang/ProjectJ
        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);
        }