mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 01:36:02 +08:00
Added .sln for spine-csharp that compiles under MonoDevelop. Modifie spine-csharp.csproj to compile under MonoDevelop (mac).
41 lines
1.3 KiB
C#
41 lines
1.3 KiB
C#
using System;
|
|
using UnityEditor;
|
|
using UnityEngine;
|
|
using Spine;
|
|
|
|
public class SpineEditor {
|
|
[MenuItem("Assets/Create/Spine Atlas")]
|
|
static public void CreateAtlas () {
|
|
CreateAsset<AtlasAsset>("Assets/New Spine Atlas");
|
|
}
|
|
|
|
[MenuItem("Assets/Create/Spine Skeleton Data")]
|
|
static public void CreateSkeletonData () {
|
|
CreateAsset<SkeletonDataAsset>("Assets/New Spine Skeleton Data");
|
|
}
|
|
|
|
static private void CreateAsset <T> (String path) where T : ScriptableObject {
|
|
ScriptableObject asset = ScriptableObject.CreateInstance<T>();
|
|
AssetDatabase.CreateAsset(asset, path + ".asset");
|
|
AssetDatabase.SaveAssets();
|
|
EditorUtility.FocusProjectWindow();
|
|
Selection.activeObject = asset;
|
|
}
|
|
|
|
[MenuItem("GameObject/Create Other/Spine Skeleton")]
|
|
static public void CreateSkeletonGameObject () {
|
|
GameObject gameObject = new GameObject("New Spine Skeleton", typeof(SkeletonComponent));
|
|
EditorUtility.FocusProjectWindow();
|
|
Selection.activeObject = gameObject;
|
|
}
|
|
|
|
[MenuItem("Component/Spine Skeleton")]
|
|
static public void CreateSkeletonComponent () {
|
|
Selection.activeGameObject.AddComponent(typeof(SkeletonComponent));
|
|
}
|
|
|
|
[MenuItem("Component/Spine Skeleton", true)]
|
|
static public bool ValidateCreateSkeletonComponent () {
|
|
return Selection.activeGameObject != null && Selection.activeGameObject.GetComponent(typeof(SkeletonComponent)) == null;
|
|
}
|
|
} |