public GameObject Build(TypeOfWeapon type) { weaponObj = WeaponFactory.instance.Create(type); weaponObj.layer = Layers.Weapon; WeaponManager manager = weaponObj.AddComponent <WeaponManager>(); MeleeWeapon weapon = weaponObj.AddComponent <MeleeWeapon>(); switch (type) { default: return(weaponObj); case TypeOfWeapon.Empty: weaponObj.name = "Empty"; manager.Build(weapon, type); weapon.Build(new Vector2(0f, 0f), 0f); return(weaponObj); case TypeOfWeapon.Fist: weaponObj.name = "Fist"; manager.Build(weapon, type); weapon.Build(new Vector2(8f, 8f), 0.3f); return(weaponObj); case TypeOfWeapon._1000sReloadToTest: weaponObj.name = "Empty"; manager.Build(weapon, type); weapon.Build(new Vector2(0f, 0f), 1000.0f); return(weaponObj); } }
public void _1_Attack_Must_Put_BoxCollider2D_Enabled_To_True() { target.Build(Vector2.one); target.Attack(); Assert.IsTrue(target.areaOfEffect.enabled); }