123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- namespace MetaClient
- {
- public class RoleCustomData
- {
- public Dictionary<int, PartData> bodyList;
- public Dictionary<int, PartData> faceList;
- /// <summary>
- /// 初始缩放
- /// </summary>
- public Dictionary<string, Vector3> orginLocalScaleList;
- /// <summary>
- /// 缩放总系数
- /// </summary>
- public Dictionary<string, Vector3> orginChangeScaleList;
- /// <summary>
- /// 实际缩放值
- /// </summary>
- public Dictionary<string, Vector3> ChangedScaleParamsList;
- public Dictionary<string, Vector3> orginLocalPositionList;
- public Dictionary<string, Vector3> orginLocalRotationList;
- public Dictionary<string, float> orginBlendList;
- public Dictionary<int, float> changedValueList;
- public Dictionary<string, Vector3> changedScaleList;
- public Dictionary<string, Vector3> changedPositionList;
- public Dictionary<string, Vector3> changedRotationList;
- public RoleCustomData ()
- {
- bodyList = new Dictionary<int, PartData>();
- faceList = new Dictionary<int, PartData>();
- orginLocalScaleList = new Dictionary<string, Vector3>();
- orginChangeScaleList = new Dictionary<string, Vector3>();
- ChangedScaleParamsList = new Dictionary<string, Vector3>();
- orginLocalPositionList = new Dictionary<string, Vector3>();
- orginLocalRotationList = new Dictionary<string, Vector3>();
- orginBlendList = new Dictionary<string, float>();
- changedValueList = new Dictionary<int, float>();
- changedScaleList = new Dictionary<string, Vector3>();
- changedPositionList = new Dictionary<string, Vector3>();
- changedRotationList = new Dictionary<string, Vector3>();
- }
- }
- public class PartData
- {
- public int id;
- public EditableBodyPart part;
- public ModifyType modifyType;
- public float floatValue;
- public Vector3 vecValue;
- public string pathValue;
- public string[] bones;
- //使用变形器
- public string biggerBlendName;
- public string smallerBlendName;
- public bool useBlend;
- public bool oneBlend;
- public string[] extraBones = null;
- public bool keepChild = true;
- public bool isMirror;
- public float minChangeValue;
- public float maxChangeValue;
- public Vector3 scaleChange;
- public Vector3 positionChange;
- public Vector3 rotationChange;
- public PartData(int _id,EditableBodyPart _part, ModifyType _modifyType)
- {
- id = _id;
- part = _part;
- modifyType = _modifyType;
- floatValue = 1;
- vecValue = Vector3.zero;
- pathValue = "";
- }
- public PartData(int _id,string[] _bones,float _min,float _max,Vector3 _scaleChange,Vector3 _posChange,Vector3 _rotChange,bool _useBlend,string _bigBlendName,string _smallBlendName,float _defaultValue = 0,string _extrabone = "",bool _keepChildScale = true,bool _isMirror = false)
- {
- id = _id;
- vecValue = Vector3.zero;
- pathValue = "";
- bones = _bones;
-
- scaleChange = _scaleChange;
- positionChange = _posChange;
- rotationChange = _rotChange;
- useBlend = _useBlend;
- biggerBlendName = _bigBlendName;
- smallerBlendName = _smallBlendName;
- isMirror = _isMirror;
- if (biggerBlendName == "" || biggerBlendName == "no" || smallerBlendName == "" || smallerBlendName == "no")
- {
- oneBlend = true;
- }else
- {
- oneBlend = false;
- }
- if(_useBlend)
- {
- if (oneBlend)
- {
- floatValue = 0;
- }
- else
- {
- floatValue = 0.5f;
- }
- minChangeValue = 0;
- maxChangeValue = 1;
- }
- else
- {
- floatValue = 1;
- if (scaleChange.x == 1 || scaleChange.y == 1 || scaleChange.z == 1)
- {
- floatValue = 1;
- }
- if (positionChange.x == 1 || positionChange.y == 1 || positionChange.z == 1 || rotationChange.x == 1 || rotationChange.y == 1 || rotationChange.z == 1)
- {
- floatValue = 0;
- }
- minChangeValue = _min;
- maxChangeValue = _max;
- if(_extrabone != "")
- {
- extraBones = _extrabone.Split(',');
- }
- keepChild = _keepChildScale;
- }
- }
- }
- }
|