Advertisement
Guest User

Untitled

a guest
Apr 27th, 2015
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. PotionData[] potions = PlayerGlobalData.Instance ().PotionsData.Potions;
  2. PotionConfiguration potionConfig = ConfigurationManager.Instance ().PotionConfig;
  3.  
  4. foreach (PotionData potion in potions)
  5. {
  6. if (potion.State == PotionData.UNLOCKED_STATE)
  7. {
  8. if (!AvailablePotions.ContainsKey (potion.Type))
  9. {
  10. PotionElementConfiguration potionElemConfig = potionConfig.GetPotionConfigById (potion.Type);
  11.  
  12. PotionCreator potionCreation = (new GameObject ("potion_creation_" + potion.Type, typeof(PotionCreator))).GetComponent<PotionCreator> ();
  13. potionCreation.name = "_" + potionCreation.name;
  14. //potionCreation.PotionData = potion;
  15. potionCreation.PotionElementConfiguration = potionElemConfig;
  16. potionCreation.OnPotionCreated += HandleOnPotionCreated;
  17. potionCreation.Resume ();
  18.  
  19. potionCreation.transform.parent = transform;
  20.  
  21. AvailablePotions [potion.Type] = potionCreation;
  22. }
  23. else
  24. {
  25. AvailablePotions [potion.Type].Resume ();
  26. }
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement