【资源路径】挪动autogen character路径
parent
5fff8ce248
commit
016ba3ae8a
|
|
@ -532,7 +532,7 @@ PrefabInstance:
|
||||||
type: 3}
|
type: 3}
|
||||||
propertyPath: m_Controller
|
propertyPath: m_Controller
|
||||||
value:
|
value:
|
||||||
objectReference: {fileID: 22100000, guid: 583c9642aa9f22c4ca90b1a8ed3282a1,
|
objectReference: {fileID: 22100000, guid: 0b49c2d1672f6724487f40580aad5b0f,
|
||||||
type: 2}
|
type: 2}
|
||||||
- target: {fileID: 5866666021909216657, guid: 905ae54a845bc824da490e04dfaec99e,
|
- target: {fileID: 5866666021909216657, guid: 905ae54a845bc824da490e04dfaec99e,
|
||||||
type: 3}
|
type: 3}
|
||||||
|
|
|
||||||
|
|
@ -329,7 +329,7 @@ PrefabInstance:
|
||||||
type: 3}
|
type: 3}
|
||||||
propertyPath: m_Controller
|
propertyPath: m_Controller
|
||||||
value:
|
value:
|
||||||
objectReference: {fileID: 22100000, guid: 13d9cdb2f43a43241ac11e782045e449,
|
objectReference: {fileID: 22100000, guid: a57d8865a12790c45a2b086303092833,
|
||||||
type: 2}
|
type: 2}
|
||||||
- target: {fileID: 5866666021909216657, guid: be1b0b5b139d39e48826848f6d198265,
|
- target: {fileID: 5866666021909216657, guid: be1b0b5b139d39e48826848f6d198265,
|
||||||
type: 3}
|
type: 3}
|
||||||
|
|
|
||||||
|
|
@ -17,10 +17,10 @@ public class ConfigCheck : EditorWindow
|
||||||
List<VehicleItem> vehicleItems;
|
List<VehicleItem> vehicleItems;
|
||||||
|
|
||||||
|
|
||||||
[MenuItem("Test/prefab工具/角色及载具配置")]
|
[MenuItem("Test/prefab工具/角色及载具配置")]
|
||||||
public static void ShowEditor()
|
public static void ShowEditor()
|
||||||
{
|
{
|
||||||
var win = GetWindow<ConfigCheck>("配置检查");
|
var win = GetWindow<ConfigCheck>("配置检查");
|
||||||
win.minSize = new Vector2(500, 700);
|
win.minSize = new Vector2(500, 700);
|
||||||
}
|
}
|
||||||
public void CreateGUI()
|
public void CreateGUI()
|
||||||
|
|
@ -69,8 +69,8 @@ public class ConfigCheck : EditorWindow
|
||||||
view.Add(playerPane);
|
view.Add(playerPane);
|
||||||
view.Add(vehiclePane);
|
view.Add(vehiclePane);
|
||||||
|
|
||||||
// 角色列表
|
// 角色列表
|
||||||
Label playerLabe = new Label() { text = "CharacterDefault配置" };
|
Label playerLabe = new Label() { text = "CharacterDefault配置" };
|
||||||
playerLabe.style.unityTextAlign = TextAnchor.MiddleCenter;
|
playerLabe.style.unityTextAlign = TextAnchor.MiddleCenter;
|
||||||
playerLabe.style.fontSize = 20;
|
playerLabe.style.fontSize = 20;
|
||||||
playerLabe.style.color = Color.green;
|
playerLabe.style.color = Color.green;
|
||||||
|
|
@ -90,8 +90,8 @@ public class ConfigCheck : EditorWindow
|
||||||
};
|
};
|
||||||
playerListView.itemsSource = playerItems;
|
playerListView.itemsSource = playerItems;
|
||||||
|
|
||||||
// 载具列表
|
// 载具列表
|
||||||
Label vLabe = new Label() { text = "VehicleConfig配置" };
|
Label vLabe = new Label() { text = "VehicleConfig配置" };
|
||||||
vLabe.style.unityTextAlign = TextAnchor.MiddleCenter;
|
vLabe.style.unityTextAlign = TextAnchor.MiddleCenter;
|
||||||
vLabe.style.fontSize = 20;
|
vLabe.style.fontSize = 20;
|
||||||
vLabe.style.color = Color.green;
|
vLabe.style.color = Color.green;
|
||||||
|
|
@ -164,39 +164,39 @@ public class PlayerItem
|
||||||
ani01_isDone = AssetDatabase.LoadAssetAtPath<GameObject>(path1);
|
ani01_isDone = AssetDatabase.LoadAssetAtPath<GameObject>(path1);
|
||||||
|
|
||||||
//skinIsDone = asset.Find("Root/Bip001");
|
//skinIsDone = asset.Find("Root/Bip001");
|
||||||
// 查找配置
|
// 查找配置
|
||||||
mainConfigIsDone = buildDataList.Any(a => a.mainConfig.NameID == id);
|
mainConfigIsDone = buildDataList.Any(a => a.mainConfig.NameID == id);
|
||||||
|
|
||||||
skinsConfigIsDone = buildDataList.Any(a => a.skins[1].NameID == skin01Name);
|
skinsConfigIsDone = buildDataList.Any(a => a.skins[1].NameID == skin01Name);
|
||||||
|
|
||||||
// 是否存在AutoGen文件夹, 判断是否已构建(2个皮肤)
|
// 是否存在AutoGen文件夹, 判断是否已构建(2个皮肤)
|
||||||
string autoDir = $"Assets/Art/AutoGen/Characters/character_{id}/";
|
string autoDir = $"Assets/Art_Out/AutoGen/Characters/character_{id}/";
|
||||||
string autoDir1 = $"Assets/Art/AutoGen/Characters/character_{skin01Name}/";
|
string autoDir1 = $"Assets/Art_Out/AutoGen/Characters/character_{skin01Name}/";
|
||||||
|
|
||||||
isBuild = AssetDatabase.IsValidFolder(autoDir1); // 只检查皮肤2
|
isBuild = AssetDatabase.IsValidFolder(autoDir1); // 只检查皮肤2
|
||||||
|
|
||||||
if (ani00_isDone) // 技能动画完成
|
if (ani00_isDone) // 技能动画完成
|
||||||
{
|
{
|
||||||
if (!mainConfigIsDone)
|
if (!mainConfigIsDone)
|
||||||
{
|
{
|
||||||
this.message = " 缺少mainConfig";
|
this.message = " 缺少mainConfig";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (isBuild is false)
|
if (isBuild is false)
|
||||||
{
|
{
|
||||||
this.message = ani01_isDone ? "需要构建皮肤2" : "缺少技能动画2";
|
this.message = ani01_isDone ? "需要构建皮肤2" : "缺少技能动画2";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!skinsConfigIsDone && ani01_isDone)
|
if (!skinsConfigIsDone && ani01_isDone)
|
||||||
{
|
{
|
||||||
this.message = this.message + $" 缺少{skin01Name}skinConfg";
|
this.message = this.message + $" 缺少{skin01Name}skinConfg";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this.message = "缺少技能动画1";
|
this.message = "缺少技能动画1";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -212,7 +212,7 @@ public class VehicleItem
|
||||||
{
|
{
|
||||||
this.id = vPrefab.name.Split('_')[1];
|
this.id = vPrefab.name.Split('_')[1];
|
||||||
configIsDone = dataList.Any(a => a.vehicleConfig.ID.ToString() == id);
|
configIsDone = dataList.Any(a => a.vehicleConfig.ID.ToString() == id);
|
||||||
message = configIsDone ? "需要构建载具" : "缺少配置or未解锁";
|
message = configIsDone ? "需要构建载具" : "缺少配置or未解锁";
|
||||||
string path = $"Assets/Art/AutoGen/Vehicle/{id}";
|
string path = $"Assets/Art/AutoGen/Vehicle/{id}";
|
||||||
isBuild = AssetDatabase.IsValidFolder(path);
|
isBuild = AssetDatabase.IsValidFolder(path);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,7 @@ namespace PersonBrowser
|
||||||
public PlayerInfo(string id)
|
public PlayerInfo(string id)
|
||||||
{
|
{
|
||||||
m_Name = id;
|
m_Name = id;
|
||||||
// Player 初始值在Assets中获取,可写。
|
// Player 初始值在Assets中获取,可写。
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
string path = $"Assets/Art/Character/Prefabs/Players/P_{m_Name}.prefab";
|
string path = $"Assets/Art/Character/Prefabs/Players/P_{m_Name}.prefab";
|
||||||
|
|
@ -97,7 +97,7 @@ namespace PersonBrowser
|
||||||
Player = null;
|
Player = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Skill 只在Assets中获取,不可写。
|
// Skill 只在Assets中获取,不可写。
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
string path = $"Assets/Art/Animations/Battle/Skill/ani_{m_Name}_skill01.fbx";
|
string path = $"Assets/Art/Animations/Battle/Skill/ani_{m_Name}_skill01.fbx";
|
||||||
|
|
@ -108,7 +108,7 @@ namespace PersonBrowser
|
||||||
Skill = null;
|
Skill = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Player_S 只在Assets中获取,不可写。
|
// Player_S 只在Assets中获取,不可写。
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
string path = $"Assets/Art/Character/Prefabs/Players_S/P_S_{m_Name}.prefab";
|
string path = $"Assets/Art/Character/Prefabs/Players_S/P_S_{m_Name}.prefab";
|
||||||
|
|
@ -119,7 +119,7 @@ namespace PersonBrowser
|
||||||
Display = null;
|
Display = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Player_S Animator Controller 只在Assets中获取,不可写。
|
// Player_S Animator Controller 只在Assets中获取,不可写。
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Display_ac = Display.transform.GetChild(0).GetComponent<Animator>().runtimeAnimatorController;
|
Display_ac = Display.transform.GetChild(0).GetComponent<Animator>().runtimeAnimatorController;
|
||||||
|
|
@ -129,8 +129,8 @@ namespace PersonBrowser
|
||||||
Display_ac = null;
|
Display_ac = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// AutoGen 只在Assets中获取,不可写。
|
// AutoGen 只在Assets中获取,不可写。
|
||||||
string directory = $"Assets/Art/AutoGen/Characters/character_{m_Name}/";
|
string directory = $"Assets/Art_Out/AutoGen/Characters/character_{m_Name}/";
|
||||||
if (AssetDatabase.IsValidFolder(directory))
|
if (AssetDatabase.IsValidFolder(directory))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|
@ -145,7 +145,7 @@ namespace PersonBrowser
|
||||||
}
|
}
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
string path = $"Assets/Art/AutoGen/Characters/character_{m_Name}/_MainTex.png";
|
string path = $"Assets/Art_Out/AutoGen/Characters/character_{m_Name}/_MainTex.png";
|
||||||
MainTex = AssetDatabase.LoadAssetAtPath<Texture2D>(path);
|
MainTex = AssetDatabase.LoadAssetAtPath<Texture2D>(path);
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
|
|
@ -155,7 +155,7 @@ namespace PersonBrowser
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Debug.Log($"character_{m_Name} 路径不存在, 需要先构建角色");
|
// Debug.Log($"character_{m_Name} 路径不存在, 需要先构建角色");
|
||||||
AutoGen = null;
|
AutoGen = null;
|
||||||
MainTex = null;
|
MainTex = null;
|
||||||
};
|
};
|
||||||
|
|
@ -165,7 +165,7 @@ namespace PersonBrowser
|
||||||
AniFile = null;
|
AniFile = null;
|
||||||
if (!System.IO.Directory.Exists($@"\\192.168.2.222\project_A"))
|
if (!System.IO.Directory.Exists($@"\\192.168.2.222\project_A"))
|
||||||
{
|
{
|
||||||
Debug.Log(@"无法链接:\\192.168.2.222\\project_A");
|
Debug.Log(@"无法链接:\\192.168.2.222\\project_A");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -176,16 +176,16 @@ namespace PersonBrowser
|
||||||
if (m_Name.StartsWith("AA"))
|
if (m_Name.StartsWith("AA"))
|
||||||
{
|
{
|
||||||
str = m_Name.Remove(3, 1).Insert(3, "0");
|
str = m_Name.Remove(3, 1).Insert(3, "0");
|
||||||
modelPath1 = $@"\\192.168.2.222\project_A\02_模型\Players\{str.Remove(0, 1)}\{m_Name}\{m_Name}.max";
|
modelPath1 = $@"\\192.168.2.222\project_A\02_模型\Players\{str.Remove(0, 1)}\{m_Name}\{m_Name}.max";
|
||||||
modelPath2 = $@"\\192.168.2.222\project_A\02_模型\Players\{str.Remove(0, 1)}\{m_Name}.max";
|
modelPath2 = $@"\\192.168.2.222\project_A\02_模型\Players\{str.Remove(0, 1)}\{m_Name}.max";
|
||||||
skinPath = $@"\\192.168.2.222\project_A\03_动作\角色蒙皮\异格\{str}\{m_Name}\{m_Name}_skin.max";
|
skinPath = $@"\\192.168.2.222\project_A\03_动作\角色蒙皮\异格\{str}\{m_Name}\{m_Name}_skin.max";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
str = m_Name.Remove(2, 1).Insert(2, "0");
|
str = m_Name.Remove(2, 1).Insert(2, "0");
|
||||||
modelPath1 = $@"\\192.168.2.222\project_A\02_模型\Players\{str}\{m_Name}\{m_Name}.max";
|
modelPath1 = $@"\\192.168.2.222\project_A\02_模型\Players\{str}\{m_Name}\{m_Name}.max";
|
||||||
modelPath2 = $@"\\192.168.2.222\project_A\02_模型\Players\{str}\{m_Name}.max";
|
modelPath2 = $@"\\192.168.2.222\project_A\02_模型\Players\{str}\{m_Name}.max";
|
||||||
skinPath = $@"\\192.168.2.222\project_A\03_动作\角色蒙皮\Player\{str}\{m_Name}\{m_Name}_skin.max";
|
skinPath = $@"\\192.168.2.222\project_A\03_动作\角色蒙皮\Player\{str}\{m_Name}\{m_Name}_skin.max";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -200,17 +200,17 @@ namespace PersonBrowser
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
string aniPath = $@"\\192.168.2.222\project_A\03_动作\角色技能\max\{m_Name}_skill01.max";
|
string aniPath = $@"\\192.168.2.222\project_A\03_动作\角色技能\max\{m_Name}_skill01.max";
|
||||||
if (System.IO.File.Exists(aniPath))
|
if (System.IO.File.Exists(aniPath))
|
||||||
{
|
{
|
||||||
AniFile = $"{m_Name}_skill01.max";
|
AniFile = $"{m_Name}_skill01.max";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 灰色:啥都没有
|
// 灰色:啥都没有
|
||||||
// 黄色:至少缺一项
|
// 黄色:至少缺一项
|
||||||
// 绿色:齐全
|
// 绿色:齐全
|
||||||
// 红色:文件齐全但未构建角色
|
// 红色:文件齐全但未构建角色
|
||||||
if (AniFile == null && ModelFile == null && SkinFile == null)
|
if (AniFile == null && ModelFile == null && SkinFile == null)
|
||||||
{
|
{
|
||||||
State = Color.gray;
|
State = Color.gray;
|
||||||
|
|
|
||||||
|
|
@ -12,11 +12,11 @@ public class ModifyPrefab : EditorWindow
|
||||||
{
|
{
|
||||||
private GameObject[] objs;
|
private GameObject[] objs;
|
||||||
|
|
||||||
[MenuItem("Test/tools/修改 prefab")]
|
[MenuItem("Test/tools/<EFBFBD><EFBFBD> prefab")]
|
||||||
public static void ShowWindow() { GetWindow<ModifyPrefab>("修改 Prefab"); }
|
public static void ShowWindow() { GetWindow<ModifyPrefab>("<EFBFBD><EFBFBD> Prefab"); }
|
||||||
public void CreateGUI()
|
public void CreateGUI()
|
||||||
{
|
{
|
||||||
Button btn1 = new() { name = "button1", text = "修改 wind zone" };
|
Button btn1 = new() { name = "button1", text = "<EFBFBD><EFBFBD> wind zone" };
|
||||||
rootVisualElement.Add(btn1);
|
rootVisualElement.Add(btn1);
|
||||||
btn1.RegisterCallback<ClickEvent>(ModifyPlayers);
|
btn1.RegisterCallback<ClickEvent>(ModifyPlayers);
|
||||||
|
|
||||||
|
|
@ -24,19 +24,19 @@ public class ModifyPrefab : EditorWindow
|
||||||
rootVisualElement.Add(btn3);
|
rootVisualElement.Add(btn3);
|
||||||
btn3.RegisterCallback<ClickEvent>(GetObjs);
|
btn3.RegisterCallback<ClickEvent>(GetObjs);
|
||||||
|
|
||||||
Button btn2 = new() { name = "button2", text = "修改 auto gen prefab" };
|
Button btn2 = new() { name = "button2", text = "<EFBFBD><EFBFBD> auto gen prefab" };
|
||||||
rootVisualElement.Add(btn2);
|
rootVisualElement.Add(btn2);
|
||||||
btn2.RegisterCallback<ClickEvent>(ModifyAutoGen);
|
btn2.RegisterCallback<ClickEvent>(ModifyAutoGen);
|
||||||
|
|
||||||
Button btn4 = new() { name = "button4", text = "修改 角色 scale" };
|
Button btn4 = new() { name = "button4", text = "<EFBFBD><EFBFBD> <20><>ɫ scale" };
|
||||||
rootVisualElement.Add(btn4);
|
rootVisualElement.Add(btn4);
|
||||||
btn4.RegisterCallback<ClickEvent>(ModifyScale);
|
btn4.RegisterCallback<ClickEvent>(ModifyScale);
|
||||||
|
|
||||||
Button btn5 = new() { name = "button5", text = "移除pos关键帧" };
|
Button btn5 = new() { name = "button5", text = "<EFBFBD>Ƴ<EFBFBD>pos<EFBFBD>ؼ<EFBFBD>֡" };
|
||||||
rootVisualElement.Add(btn5);
|
rootVisualElement.Add(btn5);
|
||||||
btn5.RegisterCallback<ClickEvent>(AnimOptimize);
|
btn5.RegisterCallback<ClickEvent>(AnimOptimize);
|
||||||
|
|
||||||
Button btn6 = new() { name = "button6", text = "修改炮台朝向" };
|
Button btn6 = new() { name = "button6", text = "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>̨<EFBFBD><EFBFBD><EFBFBD><EFBFBD>" };
|
||||||
rootVisualElement.Add(btn6);
|
rootVisualElement.Add(btn6);
|
||||||
btn6.RegisterCallback<ClickEvent>(ModifyBattery);
|
btn6.RegisterCallback<ClickEvent>(ModifyBattery);
|
||||||
}
|
}
|
||||||
|
|
@ -47,7 +47,7 @@ public class ModifyPrefab : EditorWindow
|
||||||
GameObject[] objectArray = Selection.gameObjects;
|
GameObject[] objectArray = Selection.gameObjects;
|
||||||
foreach (GameObject obj in objectArray)
|
foreach (GameObject obj in objectArray)
|
||||||
{
|
{
|
||||||
// 不实例化,直接修改资源,需要 Ctrl+S 手动保存
|
// <EFBFBD><EFBFBD>ʵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Դ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ Ctrl+S <20>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>
|
||||||
var ins = obj.transform.GetChild(0);
|
var ins = obj.transform.GetChild(0);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
@ -67,7 +67,7 @@ public class ModifyPrefab : EditorWindow
|
||||||
GameObject[] objectArray = Selection.gameObjects;
|
GameObject[] objectArray = Selection.gameObjects;
|
||||||
foreach (GameObject obj in objectArray)
|
foreach (GameObject obj in objectArray)
|
||||||
{
|
{
|
||||||
// 不实例化,直接修改资源,需要 Ctrl+S 手动保存
|
// <EFBFBD><EFBFBD>ʵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Դ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ Ctrl+S <20>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>
|
||||||
obj.transform.GetChild(0).localScale = new Vector3(1.0f, 1.0f, 1.0f);
|
obj.transform.GetChild(0).localScale = new Vector3(1.0f, 1.0f, 1.0f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -79,7 +79,7 @@ public class ModifyPrefab : EditorWindow
|
||||||
|
|
||||||
void GetObjs(ClickEvent ent)
|
void GetObjs(ClickEvent ent)
|
||||||
{
|
{
|
||||||
string[] subFloders = AssetDatabase.GetSubFolders("Assets/Art/AutoGen/Characters");
|
string[] subFloders = AssetDatabase.GetSubFolders("Assets/Art_Out/AutoGen/Characters");
|
||||||
string[] guids = AssetDatabase.FindAssets("character_A", subFloders);
|
string[] guids = AssetDatabase.FindAssets("character_A", subFloders);
|
||||||
List<GameObject> list = new List<GameObject>();
|
List<GameObject> list = new List<GameObject>();
|
||||||
foreach (string guid in guids)
|
foreach (string guid in guids)
|
||||||
|
|
@ -135,13 +135,13 @@ public class ModifyPrefab : EditorWindow
|
||||||
|
|
||||||
Debug.Log(clip.name);
|
Debug.Log(clip.name);
|
||||||
|
|
||||||
// 删除POS和缩放帧
|
// ɾ<EFBFBD><EFBFBD>POS<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֡
|
||||||
EditorCurveBinding[] curveBingdings = AnimationUtility.GetCurveBindings(clip);
|
EditorCurveBinding[] curveBingdings = AnimationUtility.GetCurveBindings(clip);
|
||||||
foreach (var curveBingding in curveBingdings)
|
foreach (var curveBingding in curveBingdings)
|
||||||
{
|
{
|
||||||
string name = curveBingding.propertyName.ToLower();
|
string name = curveBingding.propertyName.ToLower();
|
||||||
string bonePath = curveBingding.path;
|
string bonePath = curveBingding.path;
|
||||||
// 删除POS需要排除质心,武器挂点
|
// ɾ<EFBFBD><EFBFBD>POS<EFBFBD><EFBFBD>Ҫ<EFBFBD>ų<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD>
|
||||||
string[] fliter = new string[]{
|
string[] fliter = new string[]{
|
||||||
"Root/Bip001",
|
"Root/Bip001",
|
||||||
"Root/Bip001/Bip001 Spine/Bip001 Spine1/Bip001 R Clavicle/Bip001 R UpperArm/Bip001 R Forearm/Bip001 R Hand/Grip_point01",
|
"Root/Bip001/Bip001 Spine/Bip001 Spine1/Bip001 R Clavicle/Bip001 R UpperArm/Bip001 R Forearm/Bip001 R Hand/Grip_point01",
|
||||||
|
|
@ -157,7 +157,7 @@ public class ModifyPrefab : EditorWindow
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 浮点精度压缩
|
// <EFBFBD><EFBFBD><EFBFBD>㾫<EFBFBD><EFBFBD>ѹ<EFBFBD><EFBFBD>
|
||||||
AnimationClipCurveData[] curves = null;
|
AnimationClipCurveData[] curves = null;
|
||||||
curves = AnimationUtility.GetAllCurves(clip);
|
curves = AnimationUtility.GetAllCurves(clip);
|
||||||
Keyframe key;
|
Keyframe key;
|
||||||
|
|
@ -182,7 +182,7 @@ public class ModifyPrefab : EditorWindow
|
||||||
clip.SetCurve(curveDate.path, curveDate.type, curveDate.propertyName, curveDate.curve);
|
clip.SetCurve(curveDate.path, curveDate.type, curveDate.propertyName, curveDate.curve);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 提取anim文件
|
// <EFBFBD><EFBFBD>ȡanim<EFBFBD>ļ<EFBFBD>
|
||||||
AnimationClip newClip = new AnimationClip();
|
AnimationClip newClip = new AnimationClip();
|
||||||
EditorUtility.CopySerialized(clip, newClip);
|
EditorUtility.CopySerialized(clip, newClip);
|
||||||
string newAnimPath = "";
|
string newAnimPath = "";
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ public class ShowAniTest : EditorWindow
|
||||||
|
|
||||||
public void CreateGUI()
|
public void CreateGUI()
|
||||||
{
|
{
|
||||||
startIdField = new TextField() { label = "起始prefab id:00001或01001" };
|
startIdField = new TextField() { label = "起始prefab id:00001或01001" };
|
||||||
rootVisualElement.Add(startIdField);
|
rootVisualElement.Add(startIdField);
|
||||||
|
|
||||||
Button btn1 = new() { name = "button1", text = "add prefab to point" };
|
Button btn1 = new() { name = "button1", text = "add prefab to point" };
|
||||||
|
|
@ -50,7 +50,7 @@ public class ShowAniTest : EditorWindow
|
||||||
prefabList = new();
|
prefabList = new();
|
||||||
if (startIdField.value.Length != 5)
|
if (startIdField.value.Length != 5)
|
||||||
{
|
{
|
||||||
Debug.Log("请输入正确id");
|
Debug.Log("请输入正确id");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int id = Convert.ToInt32(startIdField.value);
|
int id = Convert.ToInt32(startIdField.value);
|
||||||
|
|
@ -60,7 +60,7 @@ public class ShowAniTest : EditorWindow
|
||||||
Transform point = points.transform.Find($"Point{n}");
|
Transform point = points.transform.Find($"Point{n}");
|
||||||
n++;
|
n++;
|
||||||
string idName = i.ToString().PadLeft(5, '0');
|
string idName = i.ToString().PadLeft(5, '0');
|
||||||
string[] guids = AssetDatabase.FindAssets($"t:GameObject", new string[] { $"Assets/Art/AutoGen/Characters/character_A{idName}/" });
|
string[] guids = AssetDatabase.FindAssets($"t:GameObject", new string[] { $"Assets/Art_Out/AutoGen/Characters/character_A{idName}/" });
|
||||||
if (guids.Length != 0)
|
if (guids.Length != 0)
|
||||||
{
|
{
|
||||||
string path = AssetDatabase.GUIDToAssetPath(guids[0]);
|
string path = AssetDatabase.GUIDToAssetPath(guids[0]);
|
||||||
|
|
@ -80,14 +80,14 @@ public class ShowAniTest : EditorWindow
|
||||||
public void ChangAni(ClickEvent evt)
|
public void ChangAni(ClickEvent evt)
|
||||||
{
|
{
|
||||||
stateCount = (stateCount + 1) % stateNames.Length;
|
stateCount = (stateCount + 1) % stateNames.Length;
|
||||||
Debug.Log($"切换动作:{stateCount}");
|
Debug.Log($"切换动作:{stateCount}");
|
||||||
string nextStateName = stateNames[stateCount];
|
string nextStateName = stateNames[stateCount];
|
||||||
foreach (GameObject item in prefabList)
|
foreach (GameObject item in prefabList)
|
||||||
{
|
{
|
||||||
Transform assetTransform = item.transform.GetChild(0);
|
Transform assetTransform = item.transform.GetChild(0);
|
||||||
Animator animator = assetTransform.GetComponent<Animator>();
|
Animator animator = assetTransform.GetComponent<Animator>();
|
||||||
|
|
||||||
// 查询动作模组
|
// 查询动作模组
|
||||||
string assetName = "";
|
string assetName = "";
|
||||||
assetName = assetTransform.name.Remove(2, 1);
|
assetName = assetTransform.name.Remove(2, 1);
|
||||||
assetName = assetName.Insert(2, "0");
|
assetName = assetName.Insert(2, "0");
|
||||||
|
|
@ -108,12 +108,12 @@ public class ShowAniTest : EditorWindow
|
||||||
Transform assetTransform = item.transform.GetChild(0);
|
Transform assetTransform = item.transform.GetChild(0);
|
||||||
Animator animator = assetTransform.GetComponent<Animator>();
|
Animator animator = assetTransform.GetComponent<Animator>();
|
||||||
|
|
||||||
// 查询动作模组
|
// 查询动作模组
|
||||||
string assetName = "";
|
string assetName = "";
|
||||||
assetName = assetTransform.name.Remove(2, 1);
|
assetName = assetTransform.name.Remove(2, 1);
|
||||||
assetName = assetName.Insert(2, "0");
|
assetName = assetName.Insert(2, "0");
|
||||||
string aniSet = persons.First(item => item.id == assetName).aniSet;
|
string aniSet = persons.First(item => item.id == assetName).aniSet;
|
||||||
string acPath = $"Assets/Art/AutoGen/Characters/character_{assetName}/ov_{assetName}_{aniSet}.overrideController";
|
string acPath = $"Assets/Art_Out/AutoGen/Characters/character_{assetName}/ov_{assetName}_{aniSet}.overrideController";
|
||||||
|
|
||||||
// config animator controller
|
// config animator controller
|
||||||
var rac = AssetDatabase.LoadAssetAtPath<RuntimeAnimatorController>(acPath);
|
var rac = AssetDatabase.LoadAssetAtPath<RuntimeAnimatorController>(acPath);
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 94bead32ec828f649994d85eafa76585
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 2fcee0c6d897fa34ea2bf9f52a815b40
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue