public static DUnit Create(Entity domain, long unitid) { DUnit unit = EntityFactory.CreateWithId <DUnit>(domain, unitid); unit.AddComponent <ObjectWait>(); unit.AddComponent <UnitStateComponent, int>((int)UnitState.Born); DUnitComponent unitComponent = domain.GetComponent <DUnitComponent>(); unitComponent.Add(unit); return(unit); }
public static void InitShellNumberic(DUnit shell) { NumericComponent numeric = shell.AddComponent <NumericComponent>(); UShellConfig config = shell.GetComponent <UShellConfigComponent>().ShellConfig; // 速度 numeric.Set(NumericType.SpeedBase, config.MoveSpeed); }
public static void InitTrapNumberic(DUnit trap) { NumericComponent numeric = trap.AddComponent <NumericComponent>(); UTrapConfig config = trap.GetComponent <UTrapConfigComponent>().TrapConfig; // 攻速 numeric.Set(NumericType.AttackSpeedBase, config.AttackSpeed); // 攻击力 numeric.Set(NumericType.HPDamageBase, config.HPDamage); }
public static void InitTowerNumberic(DUnit tower) { NumericComponent numeric = tower.AddComponent <NumericComponent>(); UTowerConfig config = tower.GetComponent <UTowerConfigComponent>().TowerConfig; // 最大血量 numeric.Set(NumericType.MaxHpBase, config.MaxHP); // 血量 numeric.Set(NumericType.HpBase, config.HP); // 攻速 numeric.Set(NumericType.AttackSpeedBase, config.AttackSpeed); // 血量恢复 numeric.Set(NumericType.HPRegainBase, config.HPRegain); // 攻击力 numeric.Set(NumericType.HPDamageBase, config.HPDamage); }
public static void InitRoleNumberic(DUnit role) { NumericComponent numeric = role.AddComponent <NumericComponent>(); URoleConfig config = role.GetComponent <URoleConfigComponent>().RoleConfig; // 最大血量 numeric.Set(NumericType.MaxHpBase, config.HP); // 血量 numeric.Set(NumericType.HpBase, config.HP); // 速度 numeric.Set(NumericType.SpeedBase, config.MoveSpeed); // 攻速 numeric.Set(NumericType.AttackSpeedBase, config.AttackSpeed); // 攻击力 numeric.Set(NumericType.HPDamageBase, config.HPDamage); // 警戒范围 numeric.Set(NumericType.AlertRadiusBase, config.AlertRadius); }