CockFactory.cs 807 B

123456789101112131415161718192021222324252627
  1. using System.Collections.Generic;
  2. using Ragdoll;
  3. using UnityEngine;
  4. namespace Game
  5. {
  6. public class CockFactory : ScriptSingleton<CockFactory>
  7. {
  8. private readonly Dictionary<int, string> _cockPrefabDict = new Dictionary<int, string>()
  9. {
  10. { 1, "Cock/prefab_cock_1" },
  11. { 2, "Cock/prefab_cock_2" },
  12. { 3, "Cock/prefab_cock_3" },
  13. { 4, "Cock/prefab_cock_4" },
  14. { 5, "Cock/prefab_cock_5" },
  15. { 6, "Cock/prefab_cock_6" },
  16. { 7, "Cock/prefab_cock_7" },
  17. };
  18. public GameObject GenerateCockPrefab(int cockId)
  19. {
  20. var cockExist = _cockPrefabDict.TryGetValue(cockId, out var path);
  21. var prefab = Resources.Load<GameObject>(path);
  22. return prefab;
  23. }
  24. }
  25. }