duck

duck

Oct 14th, 2010
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. static var monsterPacks = new Array();
  2. public var monsterPrefabs : Monster[];
  3. private var monsterLibrary : Hashtable;
  4.  
  5. function Start()
  6. {
  7.     // put all monster prefabs into a hashtable, for easy reference by name later:
  8.     for (Monster m in monsterLibrary) {
  9.         monsterLibrary.Add(m.name, m);
  10.     }
  11.    
  12.     desertPack = new monsterPack();
  13.     desertPack.location = "Deadly Desert";
  14.     desertPack.monsters = [
  15.         monsterLibrary["LargeDesertMonster"],
  16.         monsterLibrary["LargeDesertMonster"],
  17.         monsterLibrary["SmallDesertMonster"]
  18.     ];
  19.  
  20.    
  21.     monsterPacks.Add(desertPack);
  22.  
  23. }
  24.  
  25. class monsterPack
  26. {
  27.     var location : String;
  28.     var monsters : Monster[];
  29. }
Advertisement
Add Comment
Please, Sign In to add comment