mirror of
https://github.com/BlackMATov/unity-flash-tools.git
synced 2026-04-29 23:43:09 +07:00
editors refactor
This commit is contained in:
@@ -1,79 +1,92 @@
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace FlashTools.Internal {
|
||||
[CustomEditor(typeof(SwfAnimationAsset)), CanEditMultipleObjects]
|
||||
public class SwfAnimationAssetEditor : Editor {
|
||||
SwfAnimationAsset _asset = null;
|
||||
bool _settingsFoldout = false;
|
||||
List<SwfAnimationAsset> _assets = new List<SwfAnimationAsset>();
|
||||
bool _settingsFoldout = false;
|
||||
|
||||
void OverriddenSettingsToDefault() {
|
||||
if ( _asset ) {
|
||||
_asset.Overridden = SwfConverterSettings.GetDefaultSettings();
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
static string GetAssetPath(SwfAnimationAsset asset) {
|
||||
return asset
|
||||
? AssetDatabase.GetAssetPath(asset)
|
||||
: string.Empty;
|
||||
}
|
||||
|
||||
static string GetSwfPath(SwfAnimationAsset asset) {
|
||||
var asset_path = GetAssetPath(asset);
|
||||
return string.IsNullOrEmpty(asset_path)
|
||||
? string.Empty
|
||||
: Path.ChangeExtension(asset_path, ".swf");
|
||||
}
|
||||
|
||||
static string GetPrefabPath(SwfAnimationAsset asset) {
|
||||
var asset_path = GetAssetPath(asset);
|
||||
return string.IsNullOrEmpty(asset_path)
|
||||
? string.Empty
|
||||
: Path.ChangeExtension(asset_path, ".prefab");
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
static void RevertOverriddenSettings(SwfAnimationAsset asset) {
|
||||
asset.Overridden = asset.Settings;
|
||||
}
|
||||
|
||||
static void OverriddenSettingsToDefault(SwfAnimationAsset asset) {
|
||||
asset.Overridden = SwfConverterSettings.GetDefaultSettings();
|
||||
}
|
||||
|
||||
static void ApplyOverriddenSettings(SwfAnimationAsset asset) {
|
||||
if ( File.Exists(GetSwfPath(asset)) ) {
|
||||
asset.Settings = asset.Overridden;
|
||||
ReconvertAnimationAsset(asset);
|
||||
} else {
|
||||
Debug.LogErrorFormat(
|
||||
"Swf source for animation not found: '{0}'",
|
||||
GetSwfPath(asset));
|
||||
RevertOverriddenSettings(asset);
|
||||
}
|
||||
}
|
||||
|
||||
void RevertOverriddenSettings() {
|
||||
if ( _asset ) {
|
||||
_asset.Overridden = _asset.Settings;
|
||||
}
|
||||
}
|
||||
|
||||
void ApplyOverriddenSettings() {
|
||||
if ( _asset ) {
|
||||
if ( File.Exists(GetSwfPath()) ) {
|
||||
_asset.Settings = _asset.Overridden;
|
||||
ReconvertAnimation();
|
||||
} else {
|
||||
Debug.LogErrorFormat(
|
||||
"Swf source for animation not found: '{0}'",
|
||||
GetSwfPath());
|
||||
RevertOverriddenSettings();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ReconvertAnimation() {
|
||||
if ( _asset && _asset.Atlas ) {
|
||||
static void ReconvertAnimationAsset(SwfAnimationAsset asset) {
|
||||
if ( asset && asset.Atlas ) {
|
||||
AssetDatabase.DeleteAsset(
|
||||
AssetDatabase.GetAssetPath(_asset.Atlas));
|
||||
_asset.Atlas = null;
|
||||
AssetDatabase.GetAssetPath(asset.Atlas));
|
||||
asset.Atlas = null;
|
||||
}
|
||||
AssetDatabase.ImportAsset(
|
||||
GetSwfPath(),
|
||||
GetSwfPath(asset),
|
||||
ImportAssetOptions.ForceUpdate);
|
||||
}
|
||||
|
||||
void ShowUnappliedDialog() {
|
||||
var title =
|
||||
"Unapplied swf animation settings";
|
||||
var message = string.Format(
|
||||
"Unapplied swf animation settings for '{0}'",
|
||||
GetAssetPath());
|
||||
if ( EditorUtility.DisplayDialog(title, message, "Apply", "Revert") ) {
|
||||
ApplyOverriddenSettings();
|
||||
} else {
|
||||
RevertOverriddenSettings();
|
||||
}
|
||||
}
|
||||
|
||||
GameObject CreateAnimationGO() {
|
||||
if ( _asset ) {
|
||||
var anim_go = new GameObject(_asset.name);
|
||||
static GameObject CreateAnimationGO(SwfAnimationAsset asset) {
|
||||
if ( asset ) {
|
||||
var anim_go = new GameObject(asset.name);
|
||||
anim_go.AddComponent<MeshFilter>();
|
||||
anim_go.AddComponent<MeshRenderer>();
|
||||
anim_go.AddComponent<SwfAnimation>().asset = _asset;
|
||||
anim_go.AddComponent<SwfAnimation>().asset = asset;
|
||||
anim_go.AddComponent<SwfAnimationController>();
|
||||
return anim_go;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
void CreateAnimationPrefab() {
|
||||
var anim_go = CreateAnimationGO();
|
||||
static void CreateAnimationPrefab(SwfAnimationAsset asset) {
|
||||
var anim_go = CreateAnimationGO(asset);
|
||||
if ( anim_go ) {
|
||||
var prefab_path = GetPrefabPath();
|
||||
var prefab_path = GetPrefabPath(asset);
|
||||
if ( !string.IsNullOrEmpty(prefab_path) ) {
|
||||
var prefab = AssetDatabase.LoadMainAssetAtPath(prefab_path);
|
||||
if ( !prefab ) {
|
||||
@@ -88,52 +101,88 @@ namespace FlashTools.Internal {
|
||||
}
|
||||
}
|
||||
|
||||
void CreateAnimationOnScene() {
|
||||
var anim_go = CreateAnimationGO();
|
||||
static void CreateAnimationOnScene(SwfAnimationAsset asset) {
|
||||
var anim_go = CreateAnimationGO(asset);
|
||||
if ( anim_go ) {
|
||||
Undo.RegisterCreatedObjectUndo(anim_go, "Instance SwfAnimation");
|
||||
}
|
||||
}
|
||||
|
||||
string GetAssetPath() {
|
||||
return _asset
|
||||
? AssetDatabase.GetAssetPath(_asset)
|
||||
: string.Empty;
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
void AllAssetsForeach(Action<SwfAnimationAsset> act) {
|
||||
foreach ( var asset in _assets ) {
|
||||
act(asset);
|
||||
}
|
||||
}
|
||||
|
||||
string GetSwfPath() {
|
||||
var asset_path = GetAssetPath();
|
||||
return string.IsNullOrEmpty(asset_path)
|
||||
? string.Empty
|
||||
: Path.ChangeExtension(asset_path, ".swf");
|
||||
void AllOverriddenSettingsToDefault() {
|
||||
AllAssetsForeach(p => OverriddenSettingsToDefault(p));
|
||||
}
|
||||
|
||||
string GetPrefabPath() {
|
||||
var asset_path = GetAssetPath();
|
||||
return string.IsNullOrEmpty(asset_path)
|
||||
? string.Empty
|
||||
: Path.ChangeExtension(asset_path, ".prefab");
|
||||
void RevertAllOverriddenSettings() {
|
||||
AllAssetsForeach(p => RevertOverriddenSettings(p));
|
||||
}
|
||||
|
||||
void ApplyAllOverriddenSettings() {
|
||||
AllAssetsForeach(p => ApplyOverriddenSettings(p));
|
||||
}
|
||||
|
||||
void CreateAllAnimationPrefabs() {
|
||||
AllAssetsForeach(p => CreateAnimationPrefab(p));
|
||||
}
|
||||
|
||||
void CreateAllAnimationsOnScene() {
|
||||
AllAssetsForeach(p => CreateAnimationOnScene(p));
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
void ShowUnappliedDialog() {
|
||||
var unapplied = _assets
|
||||
.Where(p => !p.Settings.CheckEquals(p.Overridden))
|
||||
.ToArray();
|
||||
if ( unapplied.Length > 0 ) {
|
||||
var title =
|
||||
"Unapplied swf animation settings";
|
||||
var message = unapplied.Length == 1
|
||||
? string.Format(
|
||||
"Unapplied swf animation settings for '{0}'",
|
||||
GetAssetPath(unapplied[0]))
|
||||
: string.Format(
|
||||
"Unapplied multiple({0}) swf animation settings",
|
||||
unapplied.Length);
|
||||
if ( EditorUtility.DisplayDialog(title, message, "Apply", "Revert") ) {
|
||||
ApplyAllOverriddenSettings();
|
||||
} else {
|
||||
RevertAllOverriddenSettings();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DrawGUISettings() {
|
||||
var last_gui_enabled = GUI.enabled;
|
||||
GUI.enabled = false;
|
||||
var script_prop = serializedObject.FindProperty("m_Script");
|
||||
if ( script_prop != null ) {
|
||||
SwfEditorUtils.DoWithEnabledGUI(false, () => {
|
||||
var script_prop = SwfEditorUtils.GetPropertyByName(serializedObject, "m_Script");
|
||||
EditorGUILayout.PropertyField(script_prop, true);
|
||||
}
|
||||
var atlas_prop = serializedObject.FindProperty("Atlas");
|
||||
if ( atlas_prop != null ) {
|
||||
|
||||
var atlas_prop = SwfEditorUtils.GetPropertyByName(serializedObject, "Atlas");
|
||||
EditorGUILayout.PropertyField(atlas_prop, true);
|
||||
}
|
||||
var frames_prop = serializedObject.FindProperty("Frames");
|
||||
if ( frames_prop != null && frames_prop.isArray ) {
|
||||
EditorGUILayout.IntField("Frame count", frames_prop.arraySize);
|
||||
}
|
||||
GUI.enabled = last_gui_enabled;
|
||||
|
||||
var frames_prop = SwfEditorUtils.GetPropertyByName(serializedObject, "Frames");
|
||||
if ( frames_prop.isArray ) {
|
||||
SwfEditorUtils.DoWithMixedValue(
|
||||
frames_prop.hasMultipleDifferentValues, () => {
|
||||
EditorGUILayout.IntField("Frame count", frames_prop.arraySize);
|
||||
});
|
||||
}
|
||||
});
|
||||
_settingsFoldout = EditorGUILayout.Foldout(_settingsFoldout, "Settings");
|
||||
if ( _settingsFoldout ) {
|
||||
var it = serializedObject.FindProperty("Overridden");
|
||||
var it = SwfEditorUtils.GetPropertyByName(serializedObject, "Overridden");
|
||||
while ( it.NextVisible(true) ) {
|
||||
EditorGUILayout.PropertyField(it, true);
|
||||
}
|
||||
@@ -146,19 +195,21 @@ namespace FlashTools.Internal {
|
||||
GUILayout.FlexibleSpace();
|
||||
{
|
||||
var default_settings = SwfConverterSettings.GetDefaultSettings();
|
||||
GUI.enabled = !_asset.Overridden.CheckEquals(default_settings);
|
||||
if ( GUILayout.Button("Default") ) {
|
||||
OverriddenSettingsToDefault();
|
||||
}
|
||||
GUI.enabled = !_asset.Overridden.CheckEquals(_asset.Settings);
|
||||
if ( GUILayout.Button("Revert") ) {
|
||||
RevertOverriddenSettings();
|
||||
}
|
||||
GUI.enabled = !_asset.Overridden.CheckEquals(_asset.Settings);
|
||||
if ( GUILayout.Button("Apply") ) {
|
||||
ApplyOverriddenSettings();
|
||||
}
|
||||
GUI.enabled = true;
|
||||
SwfEditorUtils.DoWithEnabledGUI(
|
||||
_assets.Any(p => !p.Overridden.CheckEquals(default_settings)), () => {
|
||||
if ( GUILayout.Button("Default") ) {
|
||||
AllOverriddenSettingsToDefault();
|
||||
}
|
||||
});
|
||||
SwfEditorUtils.DoWithEnabledGUI(
|
||||
_assets.Any(p => !p.Overridden.CheckEquals(p.Settings)), () => {
|
||||
if ( GUILayout.Button("Revert") ) {
|
||||
RevertAllOverriddenSettings();
|
||||
}
|
||||
if ( GUILayout.Button("Apply") ) {
|
||||
ApplyAllOverriddenSettings();
|
||||
}
|
||||
});
|
||||
}
|
||||
GUILayout.EndHorizontal();
|
||||
}
|
||||
@@ -167,10 +218,10 @@ namespace FlashTools.Internal {
|
||||
GUILayout.BeginHorizontal();
|
||||
{
|
||||
if ( GUILayout.Button("Create prefab") ) {
|
||||
CreateAnimationPrefab();
|
||||
CreateAllAnimationPrefabs();
|
||||
}
|
||||
if ( GUILayout.Button("Instance to scene") ) {
|
||||
CreateAnimationOnScene();
|
||||
CreateAllAnimationsOnScene();
|
||||
}
|
||||
}
|
||||
GUILayout.EndHorizontal();
|
||||
@@ -183,15 +234,15 @@ namespace FlashTools.Internal {
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
void OnEnable() {
|
||||
_asset = target as SwfAnimationAsset;
|
||||
_settingsFoldout = _asset && !_asset.Settings.CheckEquals(
|
||||
SwfConverterSettings.GetDefaultSettings());
|
||||
_assets = targets
|
||||
.OfType<SwfAnimationAsset>()
|
||||
.ToList();
|
||||
_settingsFoldout =
|
||||
_assets.Any(p => !p.Settings.CheckEquals(SwfConverterSettings.GetDefaultSettings()));
|
||||
}
|
||||
|
||||
void OnDisable() {
|
||||
if ( _asset && !_asset.Settings.CheckEquals(_asset.Overridden) ) {
|
||||
ShowUnappliedDialog();
|
||||
}
|
||||
ShowUnappliedDialog();
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI() {
|
||||
|
||||
@@ -1,26 +1,36 @@
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace FlashTools.Internal {
|
||||
[CustomEditor(typeof(SwfAnimationController)), CanEditMultipleObjects]
|
||||
public class SwfAnimationControllerEditor : Editor {
|
||||
SwfAnimationController _controller = null;
|
||||
List<SwfAnimationController> _controllers = new List<SwfAnimationController>();
|
||||
|
||||
void AllControllersForeach(Action<SwfAnimationController> act) {
|
||||
foreach ( var controller in _controllers ) {
|
||||
act(controller);
|
||||
}
|
||||
}
|
||||
|
||||
void DrawAnimationControls() {
|
||||
GUILayout.BeginHorizontal();
|
||||
GUILayout.FlexibleSpace();
|
||||
{
|
||||
if ( GUILayout.Button("Stop") ) {
|
||||
_controller.Stop();
|
||||
AllControllersForeach(p => p.Stop());
|
||||
}
|
||||
if ( GUILayout.Button("Pause") ) {
|
||||
_controller.Pause();
|
||||
AllControllersForeach(p => p.Pause());
|
||||
}
|
||||
if ( GUILayout.Button("Resume") ) {
|
||||
_controller.Resume();
|
||||
AllControllersForeach(p => p.Resume());
|
||||
}
|
||||
if ( GUILayout.Button("Play") ) {
|
||||
_controller.Play();
|
||||
AllControllersForeach(p => p.Play());
|
||||
}
|
||||
}
|
||||
GUILayout.EndHorizontal();
|
||||
@@ -33,7 +43,9 @@ namespace FlashTools.Internal {
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
void OnEnable() {
|
||||
_controller = target as SwfAnimationController;
|
||||
_controllers = targets
|
||||
.OfType<SwfAnimationController>()
|
||||
.ToList();
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI() {
|
||||
|
||||
@@ -1,26 +1,56 @@
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace FlashTools.Internal {
|
||||
[CustomEditor(typeof(SwfAnimation)), CanEditMultipleObjects]
|
||||
public class SwfAnimationEditor : Editor {
|
||||
SwfAnimation _animation = null;
|
||||
List<SwfAnimation> _animations = new List<SwfAnimation>();
|
||||
|
||||
SerializedProperty GetCurrentFrameProperty() {
|
||||
var prop = serializedObject.FindProperty("_currentFrame");
|
||||
if ( prop == null ) {
|
||||
throw new UnityException("SwfAnimationEditor. Not found current frame property");
|
||||
void AllAnimationsForeachWithUndo(Action<SwfAnimation> act) {
|
||||
Undo.RecordObjects(
|
||||
_animations.ToArray(),
|
||||
"Inspector");
|
||||
foreach ( var animation in _animations ) {
|
||||
act(animation);
|
||||
EditorUtility.SetDirty(animation);
|
||||
}
|
||||
return prop;
|
||||
}
|
||||
|
||||
int GetMinAnimationsFrameCount() {
|
||||
return _animations.Count > 0
|
||||
? _animations.Min(anim => anim.frameCount)
|
||||
: 0;
|
||||
}
|
||||
|
||||
string GetAnimationsFrameCountStr() {
|
||||
return _animations.Aggregate(string.Empty, (acc, anim) => {
|
||||
var frame_count_str = anim.frameCount.ToString();
|
||||
return string.IsNullOrEmpty(acc)
|
||||
? frame_count_str
|
||||
: (acc != frame_count_str ? "--" : acc);
|
||||
});
|
||||
}
|
||||
|
||||
string GetAnimationsCurrentFrameStr() {
|
||||
return _animations.Aggregate(string.Empty, (acc, anim) => {
|
||||
var current_frame_str = anim.currentFrame.ToString();
|
||||
return string.IsNullOrEmpty(acc)
|
||||
? current_frame_str
|
||||
: (acc != current_frame_str ? "--" : acc);
|
||||
});
|
||||
}
|
||||
|
||||
void DrawCurrentFrame() {
|
||||
if ( _animation.frameCount > 1 ) {
|
||||
Undo.RecordObject(_animation, "Change SwfAnimation frame");
|
||||
var min_frame_count = GetMinAnimationsFrameCount();
|
||||
if ( min_frame_count > 0 ) {
|
||||
EditorGUILayout.IntSlider(
|
||||
GetCurrentFrameProperty(),
|
||||
SwfEditorUtils.GetPropertyByName(serializedObject, "_currentFrame"),
|
||||
0,
|
||||
_animation.frameCount - 1,
|
||||
min_frame_count - 1,
|
||||
"Frame");
|
||||
}
|
||||
}
|
||||
@@ -31,27 +61,19 @@ namespace FlashTools.Internal {
|
||||
GUILayout.FlexibleSpace();
|
||||
{
|
||||
if ( GUILayout.Button(new GUIContent("<<", "to begin frame")) ) {
|
||||
Undo.RecordObject(_animation, "Change SwfAnimation frame");
|
||||
_animation.ToBeginFrame();
|
||||
EditorUtility.SetDirty(_animation);
|
||||
AllAnimationsForeachWithUndo(p => p.ToBeginFrame());
|
||||
}
|
||||
if ( GUILayout.Button(new GUIContent("<", "to prev frame")) ) {
|
||||
Undo.RecordObject(_animation, "Change SwfAnimation frame");
|
||||
_animation.ToPrevFrame();
|
||||
EditorUtility.SetDirty(_animation);
|
||||
AllAnimationsForeachWithUndo(p => p.ToPrevFrame());
|
||||
}
|
||||
GUILayout.Label(string.Format(
|
||||
"{0}/{1}",
|
||||
_animation.currentFrame, _animation.frameCount));
|
||||
GetAnimationsCurrentFrameStr(), GetAnimationsFrameCountStr()));
|
||||
if ( GUILayout.Button(new GUIContent(">", "to next frame")) ) {
|
||||
Undo.RecordObject(_animation, "Change SwfAnimation frame");
|
||||
_animation.ToNextFrame();
|
||||
EditorUtility.SetDirty(_animation);
|
||||
AllAnimationsForeachWithUndo(p => p.ToNextFrame());
|
||||
}
|
||||
if ( GUILayout.Button(new GUIContent(">>", "to end frame")) ) {
|
||||
Undo.RecordObject(_animation, "Change SwfAnimation frame");
|
||||
_animation.ToEndFrame();
|
||||
EditorUtility.SetDirty(_animation);
|
||||
AllAnimationsForeachWithUndo(p => p.ToEndFrame());
|
||||
}
|
||||
}
|
||||
GUILayout.FlexibleSpace();
|
||||
@@ -65,7 +87,9 @@ namespace FlashTools.Internal {
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
void OnEnable() {
|
||||
_animation = target as SwfAnimation;
|
||||
_animations = targets
|
||||
.OfType<SwfAnimation>()
|
||||
.ToList();
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI() {
|
||||
|
||||
@@ -18,5 +18,15 @@ namespace FlashTools.Internal {
|
||||
act();
|
||||
GUI.enabled = last_gui_enabled;
|
||||
}
|
||||
|
||||
public static SerializedProperty GetPropertyByName(SerializedObject obj, string name) {
|
||||
var prop = obj.FindProperty(name);
|
||||
if ( prop == null ) {
|
||||
throw new UnityException(string.Format(
|
||||
"SwfEditorUtils. Not found property: {0}",
|
||||
name));
|
||||
}
|
||||
return prop;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -72,9 +71,10 @@ namespace FlashTools.Internal.SwfEditorTools {
|
||||
var result = new List<string>();
|
||||
var tag_assets = AssetDatabase.LoadAllAssetsAtPath("ProjectSettings/TagManager.asset");
|
||||
if ( tag_assets.Length > 0 ) {
|
||||
var tag_manager = new SerializedObject(tag_assets[0]);
|
||||
var layers = tag_manager.FindProperty("m_SortingLayers");
|
||||
if ( layers != null && layers.isArray ) {
|
||||
var layers = SwfEditorUtils.GetPropertyByName(
|
||||
new SerializedObject(tag_assets[0]),
|
||||
"m_SortingLayers");
|
||||
if ( layers.isArray ) {
|
||||
for ( var i = 0; i < layers.arraySize; ++i ) {
|
||||
var layer_prop = layers.GetArrayElementAtIndex(i);
|
||||
var layer_prop_name = layer_prop != null
|
||||
@@ -116,8 +116,7 @@ namespace FlashTools.Internal.SwfEditorTools {
|
||||
if ( property.propertyType == SerializedPropertyType.String ) {
|
||||
ValidateProperty(property);
|
||||
SwfEditorUtils.DoWithMixedValue(
|
||||
property.hasMultipleDifferentValues, () =>
|
||||
{
|
||||
property.hasMultipleDifferentValues, () => {
|
||||
var all_sorting_layers = GetAllSortingLayers(true);
|
||||
var sorting_layer_index = EditorGUI.Popup(
|
||||
position,
|
||||
@@ -198,8 +197,7 @@ namespace FlashTools.Internal.SwfEditorTools {
|
||||
var need_pow2 = (bool_prop != null && (bool_prop.boolValue || bool_prop.hasMultipleDifferentValues));
|
||||
ValidateProperty(property, need_pow2, attr.MinPow2, attr.MaxPow2);
|
||||
SwfEditorUtils.DoWithMixedValue(
|
||||
property.hasMultipleDifferentValues, () =>
|
||||
{
|
||||
property.hasMultipleDifferentValues, () => {
|
||||
if ( need_pow2 ) {
|
||||
var values = GenPowerOfTwoValues(attr.MinPow2, attr.MaxPow2);
|
||||
var vnames = values.Select(p => new GUIContent(p.ToString())).ToArray();
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
|
||||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
#endif
|
||||
|
||||
namespace FlashTools {
|
||||
[ExecuteInEditMode, DisallowMultipleComponent]
|
||||
public class SwfManager : MonoBehaviour {
|
||||
|
||||
Reference in New Issue
Block a user