Ejemplo n.º 1
0
        public static void AutoSave(SpringManager springManager)
        {
            var autoSavePath = GetAutoSavePath(springManager.name);
            var sourceText   = SpringBoneSerialization.BuildDynamicsSetupString(springManager.gameObject);

            FileUtil.WriteAllText(autoSavePath, sourceText);
        }
Ejemplo n.º 2
0
        private void BrowseAndSaveSpringSetup()
        {
            if (springBoneRoot == null)
            {
                return;
            }

            var initialFileName = springBoneRoot.name + "_Dynamics.csv";

            var path = EditorUtility.SaveFilePanel(
                "スプリングボーンセットアップを保存", "", initialFileName, "csv");

            if (path.Length == 0)
            {
                return;
            }

            if (System.IO.File.Exists(path))
            {
                var overwriteMessage = "ファイルは既に存在します。上書きしますか?\n\n" + path;
                if (!EditorUtility.DisplayDialog("スプリングボーン保存", overwriteMessage, "上書き", "キャンセル"))
                {
                    return;
                }
            }

            var sourceText = SpringBoneSerialization.BuildDynamicsSetupString(springBoneRoot, exportSettings);

            if (FileUtil.WriteAllText(path, sourceText))
            {
                AssetDatabase.Refresh();
                Debug.Log("保存しました: " + path);
            }
        }
        private void BrowseAndSaveSpringSetup()
        {
            if (springBoneRoot == null)
            {
                return;
            }

            var initialFileName = springBoneRoot.name + "_Dynamics.csv";

            var path = EditorUtility.SaveFilePanel(
                "导出SpringBone数据", "", initialFileName, "csv");

            if (path.Length == 0)
            {
                return;
            }

            if (System.IO.File.Exists(path))
            {
                var overwriteMessage = "文件已存在,是否覆盖?\n\n" + path;
                if (!EditorUtility.DisplayDialog("Save SpringBone", overwriteMessage, "覆盖", "取消"))
                {
                    return;
                }
            }

            var sourceText = SpringBoneSerialization.BuildDynamicsSetupString(springBoneRoot, exportSettings);

            if (FileUtil.WriteAllText(path, sourceText))
            {
                AssetDatabase.Refresh();
                Debug.Log("数据已保存: " + path);
            }
        }