CustomManager.cs 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using GameFramework.Event;
  5. using UnityEngine;
  6. using HumanoidEditor;
  7. namespace MetaClient
  8. {
  9. public class CustomManager : MonoBehaviour
  10. {
  11. public static CustomManager Instance;
  12. public RoleCustomData bodyData;
  13. public const float valueFloating = 1f;
  14. public CustomRoleController testPlayer = null;
  15. private void Awake()
  16. {
  17. Instance = this;
  18. }
  19. public void Init()
  20. {
  21. GameEntry.Event.Subscribe(CustomRoleBodyEventArgs.EventId, UpdateBody);
  22. //bodyData = new RoleCustomData();
  23. //bodyData.bonePos = new int[6];
  24. //bodyData.boneScale = new float[6];
  25. //for (int i = 0; i < 6; i++)
  26. //{
  27. // bodyData.bonePos[i] = i;
  28. // bodyData.boneScale[i] = 1;
  29. //}
  30. //CustomRoleUtility.ShowFile();
  31. testPlayer = GameObject.Find("biaozhunnv").GetComponent<CustomRoleController>();
  32. }
  33. public void Clear()
  34. {
  35. GameEntry.Event.Unsubscribe(CustomRoleBodyEventArgs.EventId, UpdateBody);
  36. }
  37. private void UpdateBody(object sender, GameEventArgs e)
  38. {
  39. CustomRoleBodyEventArgs crf = (CustomRoleBodyEventArgs)e;
  40. if (crf != null)
  41. {
  42. //bodyData.boneScale[(int)crf.Part] = 1 + (crf.ChangeValue.x - 0.5f) * valueFloating;
  43. //if (testPlayer == null)
  44. //{
  45. // testPlayer = GameObject.Find("mu").GetComponent<CustomRoleController>();
  46. //}
  47. //if (testPlayer != null)
  48. //{
  49. // testPlayer.UpdateBoneScale(crf.Part, bodyData.boneScale[(int)crf.Part]);
  50. //}
  51. }
  52. }
  53. public float GetBodyBoneValue(EditableBodyPart part)
  54. {
  55. //return 0.5f + (bodyData.boneScale[(int)part] - 1) / valueFloating;
  56. return 0;
  57. }
  58. }
  59. }