-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
10a0913
commit a9ecb1c
Showing
12 changed files
with
70 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
-512 Bytes
(99%)
SpriterDotNet.Unity/Assets/SpriterDotNet/Lib/SpriterDotNet.dll
Binary file not shown.
Binary file modified
BIN
+831 Bytes
(110%)
SpriterDotNet.Unity/Assets/SpriterDotNet/Lib/SpriterDotNet.dll.mdb
Binary file not shown.
2 changes: 1 addition & 1 deletion
2
SpriterDotNet.Unity/Assets/SpriterDotNet/Lib/SpriterDotNet.dll.mdb.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
SpriterDotNet.Unity/Assets/SpriterDotNet/SpriterDotNetBehaviourEditor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Copyright (c) 2015 The original author or authors | ||
// | ||
// This software may be modified and distributed under the terms | ||
// of the zlib license. See the LICENSE file for details. | ||
|
||
#if UNITY_EDITOR | ||
|
||
using System; | ||
using System.Reflection; | ||
using UnityEditor; | ||
using UnityEditorInternal; | ||
|
||
namespace SpriterDotNetUnity | ||
{ | ||
[CustomEditor(typeof(SpriterDotNetBehaviour))] | ||
public class SpriterDotNetBehaviourEditor : Editor | ||
{ | ||
string[] GetSortingLayerNames() | ||
{ | ||
Type internalEditorUtilityType = typeof(InternalEditorUtility); | ||
PropertyInfo sortingLayersProperty = internalEditorUtilityType.GetProperty("sortingLayerNames", BindingFlags.Static | BindingFlags.NonPublic); | ||
return (string[])sortingLayersProperty.GetValue(null, new object[0]); | ||
} | ||
|
||
public override void OnInspectorGUI() | ||
{ | ||
DrawDefaultInspector(); | ||
|
||
SpriterDotNetBehaviour sdnb = target as SpriterDotNetBehaviour; | ||
|
||
string[] layers = GetSortingLayerNames(); | ||
int currentIndex = Array.IndexOf(layers, sdnb.SortingLayer); | ||
if (currentIndex < 0) currentIndex = 0; | ||
int choiceIndex = EditorGUILayout.Popup("Sorting Layer", currentIndex, layers); | ||
sdnb.SortingLayer = layers[choiceIndex]; | ||
EditorUtility.SetDirty(target); | ||
} | ||
} | ||
} | ||
|
||
#endif |
12 changes: 12 additions & 0 deletions
12
SpriterDotNet.Unity/Assets/SpriterDotNet/SpriterDotNetBehaviourEditor.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
-22.7 KB
(39%)
SpriterDotNet.Unity/Assets/SpriterDotNetExamples/GreyGuyPlus.unity
Binary file not shown.
Binary file modified
BIN
+456 Bytes
(100%)
SpriterDotNet.Unity/Assets/SpriterDotNetExamples/Scml/GreyGuyPlus/Player.prefab
Binary file not shown.
Binary file modified
BIN
+23.1 KB
(100%)
SpriterDotNet.Unity/SpriterDotNet.Unity.Examples.unitypackage
Binary file not shown.
Binary file not shown.