123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using GameFramework.Event;
- using UnityEngine;
- using HumanoidEditor;
- namespace MetaClient
- {
- public class CustomManager : MonoBehaviour
- {
- public static CustomManager Instance;
- public RoleCustomData bodyData;
- public const float valueFloating = 1f;
- public CustomRoleController testPlayer = null;
- private void Awake()
- {
- Instance = this;
- }
- public void Init()
- {
- GameEntry.Event.Subscribe(CustomRoleBodyEventArgs.EventId, UpdateBody);
- //bodyData = new RoleCustomData();
- //bodyData.bonePos = new int[6];
- //bodyData.boneScale = new float[6];
- //for (int i = 0; i < 6; i++)
- //{
- // bodyData.bonePos[i] = i;
- // bodyData.boneScale[i] = 1;
- //}
- //CustomRoleUtility.ShowFile();
- testPlayer = GameObject.Find("biaozhunnv").GetComponent<CustomRoleController>();
- }
- public void Clear()
- {
- GameEntry.Event.Unsubscribe(CustomRoleBodyEventArgs.EventId, UpdateBody);
- }
- private void UpdateBody(object sender, GameEventArgs e)
- {
- CustomRoleBodyEventArgs crf = (CustomRoleBodyEventArgs)e;
- if (crf != null)
- {
- //bodyData.boneScale[(int)crf.Part] = 1 + (crf.ChangeValue.x - 0.5f) * valueFloating;
- //if (testPlayer == null)
- //{
- // testPlayer = GameObject.Find("mu").GetComponent<CustomRoleController>();
- //}
- //if (testPlayer != null)
- //{
- // testPlayer.UpdateBoneScale(crf.Part, bodyData.boneScale[(int)crf.Part]);
- //}
- }
- }
- public float GetBodyBoneValue(EditableBodyPart part)
- {
- //return 0.5f + (bodyData.boneScale[(int)part] - 1) / valueFloating;
- return 0;
- }
- }
- }
|