Guest User

Untitled

a guest
Jul 21st, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. public class EnemyTypes
  2. {
  3. private class TypeValues
  4. {
  5. public delegate void Func(Transform Entity);//just used for handing over values on initialization, somehow has to be public
  6.  
  7. private string Name; //the Name of an EnemyType, NOT the name of a specific entity
  8. private float BaseSpeed; //actual speed of each enemy is randomly set within (BaseSpeed +/- SpeedTolerance) everytime it respawns
  9. private float SpeedTolerance;
  10. private Func Animate;
  11.  
  12. public TypeValues(string Name, float BaseSpeed, float SpeedTolerance, Func Animate) //constructor apparently needs to be public too?
  13. {
  14. this.Name = Name;
  15. this.BaseSpeed = BaseSpeed;
  16. this.SpeedTolerance = SpeedTolerance;
  17. this.Animate = Animate;
  18. }
  19.  
  20. }
  21.  
  22. [SerializeField]
  23. private static Dictionary<int, TypeValues> Types = new Dictionary<int, TypeValues>
  24. {
  25. {1, new TypeValues("Standard", 1f, 0.5f, Entity => Entity.Rotate(new Vector3(0, 5, 0)))}
  26.  
  27. };
  28. }
Add Comment
Please, Sign In to add comment