/// <summary> /// Call this to initialize a Behaviour with data supplied in a file. /// </summary> /// <param name="fileName">The file to load from.</param> public override void LoadContent(String fileName) { base.LoadContent(fileName); ProjectileDefinition def = GameObjectManager.pInstance.pContentManager.Load <ProjectileDefinition>(fileName); mDamageAppliedTo = new List <GameObjectDefinition.Classifications>(); for (Int32 i = 0; i < def.mDamageAppliedTo.Count; i++) { mDamageAppliedTo.Add(def.mDamageAppliedTo[i]); } mObjectsInRange = new List <GameObject>(16); mApplyDamageMsg = new Health.ApplyDamageMessage(); mApplyDamageMsg.mDamageAmount_In = def.mDamageCaused; }
/// <summary> /// Call this to initialize a Behaviour with data supplied in a file. /// </summary> /// <param name="fileName">The file to load from.</param> public override void LoadContent(String fileName) { base.LoadContent(fileName); ExplosiveDefinition def = GameObjectManager.pInstance.pContentManager.Load <ExplosiveDefinition>(fileName); mExplosionEffect = def.mEffectFileName; mExplosionAnimationNames = def.mAnimationsToPlay; mManualExplosion = def.mManualExplosion; mDamagedCaused = def.mDamageCaused; mDamageAppliedTo = new List <GameObjectDefinition.Classifications>(); for (Int32 i = 0; i < def.mDamageAppliedTo.Count; i++) { mDamageAppliedTo.Add(def.mDamageAppliedTo[i]); } mObjectsInRange = new List <GameObject>(16); if (def.mDetonationTimerDuration != 0) { mDetonationTimer = StopWatchManager.pInstance.GetNewStopWatch(); mDetonationTimer.pLifeTime = def.mDetonationTimerDuration; } mSetActiveAnimationMessage = new SpriteRender.SetActiveAnimationMessage(); mApplyDamageMsg = new Health.ApplyDamageMessage(); mApplyDamageMsg.mDamageAmount_In = mDamagedCaused; mGetAttachmentPointMsg = new SpriteRender.GetAttachmentPointMessage(); Reset(); }