///<summary> ///initialize using associated entity ///</summary> ///<param name="entity">associated entity</param> public void Initialize(Entity entity) { _triggerWeaponGiver = entity as TriggerWeaponGiver; //Material = // TorqueObjectDatabase.Instance.FindObject("remingtonMaterial") // as SimpleMaterial; SimpleMaterial simpleMaterial = new SimpleMaterial(); simpleMaterial.TextureFilename = @"data\images\Mindcrafters\remington"; simpleMaterial.IsTranslucent = true; simpleMaterial.IsColorBlended = true; Material = simpleMaterial; Layer = 30; IsTemplate = false; Size = new Vector2(32, 32); }
///<summary> ///initialize using associated entity ///</summary> ///<param name="entity">associated entity</param> public void Initialize(Entity entity) { _triggerWeaponGiver = entity as TriggerWeaponGiver; //Material = // TorqueObjectDatabase.Instance.FindObject("HoverShellMaterial") // as SimpleMaterial; SimpleMaterial simpleMaterial = new SimpleMaterial(); simpleMaterial.TextureFilename = @"data\images\GarageGames\HoverShell"; simpleMaterial.IsTranslucent = true; simpleMaterial.IsColorBlended = true; Material = simpleMaterial; Layer = 30; IsTemplate = false; Size = new Vector2(16, 16); }
///<summary> ///Add a weapon giver ///</summary> ///<param name="wg"></param> public void AddWeaponGiver(TriggerWeaponGiver wg) { //add it to the appropriate vectors TriggerSystem.Register(wg); //let the corresponding navgraph node point to this object NavGraphNode node = NavGraph.GetNode(wg.NodeIndex); node.ExtraInfo = wg; //register the entity EntityManager.Instance.RegisterEntity(wg); }
///<summary> ///Add a shotgun using given shotgun data ///</summary> ///<param name="shotgunData"></param> public void AddShotgun(ShotgunData shotgunData) { TriggerWeaponGiver wg = new TriggerWeaponGiver(shotgunData); AddWeaponGiver(wg); }
///<summary> ///Add a rocket launcher using given rocket launcher data ///</summary> ///<param name="rocketLauncher"></param> public void AddRocketLauncher(RocketLauncherData rocketLauncher) { TriggerWeaponGiver wg = new TriggerWeaponGiver(rocketLauncher); AddWeaponGiver(wg); }
//TODO make weaponData superclass ///<summary> ///Add a railgun using given railgun data ///</summary> ///<param name="railgunData"></param> public void AddRailgun(RailgunData railgunData) { TriggerWeaponGiver wg = new TriggerWeaponGiver(railgunData); AddWeaponGiver(wg); }