Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.03 KB | None | 0 0
  1.     public partial class Enemy : IHasBehavior
  2.     {
  3.  
  4.         BehaviorType behaviorType;
  5.  
  6.         private void CustomInitialize()
  7.         {
  8.            
  9.  
  10.         }
  11.  
  12.         private void CustomActivity()
  13.         {
  14.             Behave();
  15.  
  16.         }
  17.  
  18.         public void Behave()
  19.         {
  20.             BehaviorController.BehaviorSwitch(behaviorType, this);
  21.         }
  22.  
  23.         private void CustomDestroy()
  24.         {
  25.  
  26.  
  27.         }
  28.  
  29.         private static void CustomLoadStaticContent(string contentManagerName)
  30.         {
  31.  
  32.  
  33.         }
  34.  
  35.         public void Setup(string name, BaseScreen screen)
  36.         {
  37.             foreach (EnemyData data in screen.EnemyDataFile)
  38.             {
  39.                 if (data.Name == name)
  40.                 {
  41.                     // Setup Sprite/Animation
  42.                     CurrentAnimation = data.DefaultAnimation;
  43.                     sprite.ScaleX = data.Scale;
  44.                     sprite.ScaleY = data.Scale;
  45.  
  46.                     // Behavior
  47.                     behaviorType = data.DefaultBehavior;
  48.  
  49.                 }
  50.             }
  51.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement