Eonirr

Untitled

Feb 25th, 2026
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.17 KB | None | 0 0
  1. public enum WeaponType
  2. {
  3. Sword,
  4. Bow,
  5. Legendary
  6. }
  7.  
  8. string value = "Sword";
  9.  
  10. if (Enum.TryParse(value, out WeaponType result))
  11. {
  12. Debug.Log(result);
  13. }
Advertisement
Add Comment
Please, Sign In to add comment