VO Bay Vista cut scene
This commit is contained in:
35
Assets/ThirdParty/NatureManufacture Assets/Spline System/Scripts/Editor/RamSaveMeshEditor.cs
vendored
Normal file
35
Assets/ThirdParty/NatureManufacture Assets/Spline System/Scripts/Editor/RamSaveMeshEditor.cs
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using System.IO;
|
||||
|
||||
public class RamSaveMeshEditor : MonoBehaviour
|
||||
{
|
||||
[MenuItem("Tools/Nature Manufacture/Save Selected RAM Mesh")]
|
||||
public static void SaveSelectedMesh()
|
||||
{
|
||||
GameObject selected = Selection.activeGameObject;
|
||||
if (!selected)
|
||||
{
|
||||
Debug.LogWarning("Select a RAM spline GameObject with MeshFilter first.");
|
||||
return;
|
||||
}
|
||||
|
||||
MeshFilter mf = selected.GetComponent<MeshFilter>();
|
||||
if (!mf || !mf.sharedMesh)
|
||||
{
|
||||
Debug.LogWarning("Selected object doesn't have a valid mesh.");
|
||||
return;
|
||||
}
|
||||
|
||||
Mesh meshToSave = Object.Instantiate(mf.sharedMesh);
|
||||
string path = "Assets/SavedRiverMesh_" + selected.name + ".asset";
|
||||
|
||||
AssetDatabase.CreateAsset(meshToSave, path);
|
||||
AssetDatabase.SaveAssets();
|
||||
mf.sharedMesh = meshToSave;
|
||||
|
||||
Debug.Log("Saved mesh to: " + path);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user