Add support for exporting prop, compatible with the new version, add the EnableRootMotion option (#143)
* update BillboardBuilder * add a new enum value * Add the EnableRootMotion option to support scenarios where the character is not within the camera view * Add support for exporting prop * update * compatible with the new version 2 * update --------- Co-authored-by: 左右看 <1918891542@qq.com>
This commit is contained in:
@@ -118,6 +118,13 @@ public class UISettingsAnimation : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
public void EnableRootMotion(bool enable)
|
||||
{
|
||||
var container = Builder.CurrentUMAContainer;
|
||||
if (!container || !container.UmaAnimator) return;
|
||||
container.UmaAnimator.SetLayerWeight(2, enable ? 1 : 0);
|
||||
}
|
||||
|
||||
public static string ToFrameFormat(float time, float frameRate)
|
||||
{
|
||||
int frames = Mathf.FloorToInt(time % 1 * frameRate);
|
||||
|
||||
@@ -66,7 +66,11 @@ public class UISettingsAssets : MonoBehaviour
|
||||
if (File.Exists(asset.FilePath) && !File.Exists(outName))
|
||||
{
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(outName));
|
||||
File.Copy(asset.FilePath, outName);
|
||||
|
||||
//修改(导出解密ab包)
|
||||
var decryptedData = AssetBundleDecryptor.DecryptFileToBytes(asset.FilePath, asset.FKey);
|
||||
File.WriteAllBytes(outName, decryptedData);
|
||||
|
||||
}
|
||||
}
|
||||
UmaViewerUI.Instance.ShowMessage($"{LoadedAssetEntries.Count} files copied", UIMessageType.Success);
|
||||
@@ -96,7 +100,11 @@ public class UISettingsAssets : MonoBehaviour
|
||||
if (File.Exists(asset.FilePath) && !File.Exists(outName))
|
||||
{
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(outName));
|
||||
File.Copy(asset.FilePath, outName);
|
||||
|
||||
//修改(导出解密ab包)
|
||||
var decryptedData = AssetBundleDecryptor.DecryptFileToBytes(asset.FilePath, asset.FKey);
|
||||
File.WriteAllBytes(outName, decryptedData);
|
||||
|
||||
}
|
||||
}
|
||||
UmaViewerUI.Instance.ShowMessage($"{assets.Count} files copied", UIMessageType.Success);
|
||||
|
||||
@@ -110,6 +110,17 @@ public class UISettingsModel : MonoBehaviour
|
||||
ModelExporter.ExportModel(container, path);
|
||||
}
|
||||
}
|
||||
|
||||
var prop_container = Builder.CurrentOtherContainer;
|
||||
if (prop_container)
|
||||
{
|
||||
var path = StandaloneFileBrowser.SaveFilePanel("Save PMX File", Config.Instance.MainPath, $"{prop_container}", "pmx");
|
||||
if (!string.IsNullOrEmpty(path))
|
||||
{
|
||||
ModelExporter.ExportModel(prop_container, path);
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
UmaViewerUI.Instance.ShowMessage("Not supported on this platform", UIMessageType.Warning);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user