testss
@@ -0,0 +1,605 @@
|
||||
#define WRITE_TO_JSON
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using UnityEngine.Analytics;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UnityEditor.U2D.Animation
|
||||
{
|
||||
[Serializable]
|
||||
enum AnimationToolType
|
||||
{
|
||||
UnknownTool = 0,
|
||||
Visibilility = 6,
|
||||
PreviewPose = 7,
|
||||
EditPose = 8,
|
||||
CreateBone = 9,
|
||||
SplitBone = 10,
|
||||
ReparentBone = 11,
|
||||
EditGeometry = 12,
|
||||
CreateVertex = 13,
|
||||
CreateEdge = 14,
|
||||
SplitEdge = 15,
|
||||
GenerateGeometry = 16,
|
||||
WeightSlider = 17,
|
||||
WeightBrush = 18,
|
||||
BoneInfluence = 19,
|
||||
GenerateWeights = 20
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
enum AnimationEventType
|
||||
{
|
||||
Truncated = -1,
|
||||
SelectedSpriteChanged = 0,
|
||||
SkeletonPreviewPoseChanged = 1,
|
||||
SkeletonBindPoseChanged = 2,
|
||||
SkeletonTopologyChanged = 3,
|
||||
MeshChanged = 4,
|
||||
MeshPreviewChanged = 5,
|
||||
SkinningModuleModeChanged = 6,
|
||||
BoneSelectionChanged = 7,
|
||||
BoneNameChanged = 8,
|
||||
CharacterPartChanged = 9,
|
||||
ToolChanged = 10,
|
||||
RestoreBindPose = 11,
|
||||
Copy = 12,
|
||||
Paste = 13,
|
||||
BoneDepthChanged = 14,
|
||||
Shortcut = 15,
|
||||
Visibility = 16
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
struct AnimationEvent
|
||||
{
|
||||
[SerializeField]
|
||||
public AnimationEventType sub_type;
|
||||
[SerializeField]
|
||||
public int repeated_event;
|
||||
[SerializeField]
|
||||
public string data;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
struct AnimationToolUsageEvent
|
||||
{
|
||||
[SerializeField]
|
||||
public int instance_id;
|
||||
[SerializeField]
|
||||
public AnimationToolType animation_tool;
|
||||
[SerializeField]
|
||||
public bool character_mode;
|
||||
[SerializeField]
|
||||
public int time_start_s;
|
||||
[SerializeField]
|
||||
public int time_end_s;
|
||||
[SerializeField]
|
||||
public List<AnimationEvent> animation_events;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
struct AnimationToolApplyEvent
|
||||
{
|
||||
[SerializeField]
|
||||
public bool character_mode;
|
||||
[SerializeField]
|
||||
public int instance_id;
|
||||
[SerializeField]
|
||||
public int sprite_count;
|
||||
[SerializeField]
|
||||
public int[] bone_sprite_count;
|
||||
[SerializeField]
|
||||
public int[] bone_count;
|
||||
[SerializeField]
|
||||
public int[] bone_depth;
|
||||
[SerializeField]
|
||||
public int[] bone_chain_count;
|
||||
[SerializeField]
|
||||
public int bone_root_count;
|
||||
}
|
||||
|
||||
internal interface IAnimationAnalyticsModel
|
||||
{
|
||||
bool hasCharacter { get; }
|
||||
SkinningMode mode { get; }
|
||||
ITool selectedTool { get; }
|
||||
ITool GetTool(Tools tool);
|
||||
int selectedBoneCount { get; }
|
||||
int applicationElapseTime { get; }
|
||||
}
|
||||
|
||||
internal class SkinningModuleAnalyticsModel : IAnimationAnalyticsModel
|
||||
{
|
||||
public SkinningCache skinningCache { get; private set; }
|
||||
public bool hasCharacter { get { return skinningCache.hasCharacter; } }
|
||||
public SkinningMode mode { get { return skinningCache.mode; } }
|
||||
public ITool selectedTool { get { return skinningCache.selectedTool; } }
|
||||
|
||||
public SkinningModuleAnalyticsModel(SkinningCache s)
|
||||
{
|
||||
skinningCache = s;
|
||||
}
|
||||
|
||||
public ITool GetTool(Tools tool)
|
||||
{
|
||||
return skinningCache.GetTool(tool);
|
||||
}
|
||||
|
||||
public int selectedBoneCount { get { return skinningCache.skeletonSelection.Count; } }
|
||||
|
||||
public int applicationElapseTime { get { return (int)EditorApplication.timeSinceStartup; } }
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
internal class AnimationAnalytics
|
||||
{
|
||||
const int k_AnimationEventElementCount = 3;
|
||||
const int k_AnimationToolUsageEventElementCount = 6;
|
||||
IAnalyticsStorage m_AnalyticsStorage;
|
||||
SkinningEvents m_EventBus;
|
||||
IAnimationAnalyticsModel m_Model;
|
||||
|
||||
AnimationToolUsageEvent? m_CurrentEvent;
|
||||
int m_InstanceId;
|
||||
|
||||
public AnimationAnalytics(IAnalyticsStorage analyticsStorage, SkinningEvents eventBus, IAnimationAnalyticsModel model, int instanceId)
|
||||
{
|
||||
m_Model = model;
|
||||
m_AnalyticsStorage = analyticsStorage;
|
||||
m_InstanceId = instanceId;
|
||||
m_EventBus = eventBus;
|
||||
m_EventBus.selectedSpriteChanged.AddListener(OnSelectedSpriteChanged);
|
||||
m_EventBus.skeletonPreviewPoseChanged.AddListener(OnSkeletonPreviewPoseChanged);
|
||||
m_EventBus.skeletonBindPoseChanged.AddListener(OnSkeletonBindPoseChanged);
|
||||
m_EventBus.skeletonTopologyChanged.AddListener(OnSkeletonTopologyChanged);
|
||||
m_EventBus.meshChanged.AddListener(OnMeshChanged);
|
||||
m_EventBus.meshPreviewChanged.AddListener(OnMeshPreviewChanged);
|
||||
m_EventBus.skinningModeChanged.AddListener(OnSkinningModuleModeChanged);
|
||||
m_EventBus.boneSelectionChanged.AddListener(OnBoneSelectionChanged);
|
||||
m_EventBus.boneNameChanged.AddListener(OnBoneNameChanged);
|
||||
m_EventBus.boneDepthChanged.AddListener(OnBoneDepthChanged);
|
||||
m_EventBus.characterPartChanged.AddListener(OnCharacterPartChanged);
|
||||
m_EventBus.toolChanged.AddListener(OnToolChanged);
|
||||
m_EventBus.restoreBindPose.AddListener(OnRestoreBindPose);
|
||||
m_EventBus.copy.AddListener(OnCopy);
|
||||
m_EventBus.paste.AddListener(OnPaste);
|
||||
m_EventBus.shortcut.AddListener(OnShortcut);
|
||||
m_EventBus.boneVisibility.AddListener(OnBoneVisibility);
|
||||
|
||||
OnToolChanged(model.selectedTool);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
m_EventBus.selectedSpriteChanged.RemoveListener(OnSelectedSpriteChanged);
|
||||
m_EventBus.skeletonPreviewPoseChanged.RemoveListener(OnSkeletonPreviewPoseChanged);
|
||||
m_EventBus.skeletonBindPoseChanged.RemoveListener(OnSkeletonBindPoseChanged);
|
||||
m_EventBus.skeletonTopologyChanged.RemoveListener(OnSkeletonTopologyChanged);
|
||||
m_EventBus.meshChanged.RemoveListener(OnMeshChanged);
|
||||
m_EventBus.meshPreviewChanged.RemoveListener(OnMeshPreviewChanged);
|
||||
m_EventBus.skinningModeChanged.RemoveListener(OnSkinningModuleModeChanged);
|
||||
m_EventBus.boneSelectionChanged.RemoveListener(OnBoneSelectionChanged);
|
||||
m_EventBus.boneNameChanged.RemoveListener(OnBoneNameChanged);
|
||||
m_EventBus.boneDepthChanged.AddListener(OnBoneDepthChanged);
|
||||
m_EventBus.characterPartChanged.RemoveListener(OnCharacterPartChanged);
|
||||
m_EventBus.toolChanged.RemoveListener(OnToolChanged);
|
||||
m_EventBus.copy.RemoveListener(OnCopy);
|
||||
m_EventBus.paste.RemoveListener(OnPaste);
|
||||
m_EventBus.shortcut.RemoveListener(OnShortcut);
|
||||
m_EventBus.boneVisibility.RemoveListener(OnBoneVisibility);
|
||||
m_AnalyticsStorage.Dispose();
|
||||
}
|
||||
|
||||
void OnBoneVisibility(string s)
|
||||
{
|
||||
SetAnimationEvent(new AnimationEvent()
|
||||
{
|
||||
sub_type = AnimationEventType.Visibility,
|
||||
data = s
|
||||
});
|
||||
}
|
||||
|
||||
void OnShortcut(string s)
|
||||
{
|
||||
SetAnimationEvent(new AnimationEvent()
|
||||
{
|
||||
sub_type = AnimationEventType.Shortcut,
|
||||
data = s
|
||||
});
|
||||
}
|
||||
|
||||
void OnCopy()
|
||||
{
|
||||
SetAnimationEvent(new AnimationEvent()
|
||||
{
|
||||
sub_type = AnimationEventType.Copy,
|
||||
data = ""
|
||||
});
|
||||
}
|
||||
|
||||
void OnPaste(bool bone , bool mesh , bool flipX , bool flipY)
|
||||
{
|
||||
SetAnimationEvent(new AnimationEvent()
|
||||
{
|
||||
sub_type = AnimationEventType.Paste,
|
||||
data = string.Format("b:{0} m:{1} x:{2} y:{3}", bone, mesh, flipX, flipY)
|
||||
});
|
||||
}
|
||||
|
||||
void OnSelectedSpriteChanged(SpriteCache sprite)
|
||||
{
|
||||
SetAnimationEvent(new AnimationEvent()
|
||||
{
|
||||
sub_type = AnimationEventType.SelectedSpriteChanged,
|
||||
data = sprite == null ? "false" : "true"
|
||||
});
|
||||
}
|
||||
|
||||
void OnSkeletonPreviewPoseChanged(SkeletonCache skeleton)
|
||||
{
|
||||
SetAnimationEvent(new AnimationEvent()
|
||||
{
|
||||
sub_type = AnimationEventType.SkeletonPreviewPoseChanged,
|
||||
data = ""
|
||||
});
|
||||
}
|
||||
|
||||
void OnSkeletonBindPoseChanged(SkeletonCache skeleton)
|
||||
{
|
||||
SetAnimationEvent(new AnimationEvent()
|
||||
{
|
||||
sub_type = AnimationEventType.SkeletonBindPoseChanged,
|
||||
data = ""
|
||||
});
|
||||
}
|
||||
|
||||
void OnSkeletonTopologyChanged(SkeletonCache skeleton)
|
||||
{
|
||||
SetAnimationEvent(new AnimationEvent()
|
||||
{
|
||||
sub_type = AnimationEventType.SkeletonTopologyChanged,
|
||||
data = ""
|
||||
});
|
||||
}
|
||||
|
||||
void OnMeshChanged(MeshCache mesh)
|
||||
{
|
||||
SetAnimationEvent(new AnimationEvent()
|
||||
{
|
||||
sub_type = AnimationEventType.MeshChanged,
|
||||
data = ""
|
||||
});
|
||||
}
|
||||
|
||||
void OnMeshPreviewChanged(MeshPreviewCache mesh)
|
||||
{
|
||||
}
|
||||
|
||||
void OnSkinningModuleModeChanged(SkinningMode mode)
|
||||
{
|
||||
SetAnimationEvent(new AnimationEvent()
|
||||
{
|
||||
sub_type = AnimationEventType.SkinningModuleModeChanged,
|
||||
data = mode.ToString()
|
||||
});
|
||||
}
|
||||
|
||||
void OnBoneSelectionChanged()
|
||||
{
|
||||
SetAnimationEvent(new AnimationEvent()
|
||||
{
|
||||
sub_type = AnimationEventType.BoneSelectionChanged,
|
||||
data = m_Model.selectedBoneCount.ToString()
|
||||
});
|
||||
}
|
||||
|
||||
void OnBoneNameChanged(BoneCache bone)
|
||||
{
|
||||
SetAnimationEvent(new AnimationEvent()
|
||||
{
|
||||
sub_type = AnimationEventType.BoneNameChanged,
|
||||
data = ""
|
||||
});
|
||||
}
|
||||
|
||||
void OnBoneDepthChanged(BoneCache bone)
|
||||
{
|
||||
SetAnimationEvent(new AnimationEvent()
|
||||
{
|
||||
sub_type = AnimationEventType.BoneDepthChanged,
|
||||
data = ""
|
||||
});
|
||||
}
|
||||
|
||||
void OnCharacterPartChanged(CharacterPartCache part)
|
||||
{
|
||||
SetAnimationEvent(new AnimationEvent()
|
||||
{
|
||||
sub_type = AnimationEventType.CharacterPartChanged,
|
||||
data = ""
|
||||
});
|
||||
}
|
||||
|
||||
void OnToolChanged(ITool tool)
|
||||
{
|
||||
if (tool == m_Model.GetTool(Tools.ReparentBone))
|
||||
StartNewEvent(AnimationToolType.ReparentBone, m_Model.applicationElapseTime);
|
||||
else if (tool == m_Model.GetTool(Tools.CreateBone))
|
||||
StartNewEvent(AnimationToolType.CreateBone, m_Model.applicationElapseTime);
|
||||
else if (tool == m_Model.GetTool(Tools.EditJoints))
|
||||
StartNewEvent(AnimationToolType.EditPose, m_Model.applicationElapseTime);
|
||||
else if (tool == m_Model.GetTool(Tools.EditPose))
|
||||
StartNewEvent(AnimationToolType.PreviewPose, m_Model.applicationElapseTime);
|
||||
else if (tool == m_Model.GetTool(Tools.SplitBone))
|
||||
StartNewEvent(AnimationToolType.SplitBone, m_Model.applicationElapseTime);
|
||||
else if (tool == m_Model.GetTool(Tools.CreateEdge))
|
||||
StartNewEvent(AnimationToolType.CreateEdge, m_Model.applicationElapseTime);
|
||||
else if (tool == m_Model.GetTool(Tools.CreateVertex))
|
||||
StartNewEvent(AnimationToolType.CreateVertex, m_Model.applicationElapseTime);
|
||||
else if (tool == m_Model.GetTool(Tools.EditGeometry))
|
||||
StartNewEvent(AnimationToolType.EditGeometry, m_Model.applicationElapseTime);
|
||||
else if (tool == m_Model.GetTool(Tools.GenerateGeometry))
|
||||
StartNewEvent(AnimationToolType.GenerateGeometry, m_Model.applicationElapseTime);
|
||||
else if (tool == m_Model.GetTool(Tools.SplitEdge))
|
||||
StartNewEvent(AnimationToolType.SplitEdge, m_Model.applicationElapseTime);
|
||||
else if (tool == m_Model.GetTool(Tools.Visibility))
|
||||
StartNewEvent(AnimationToolType.Visibilility, m_Model.applicationElapseTime);
|
||||
else if (tool == m_Model.GetTool(Tools.BoneInfluence))
|
||||
StartNewEvent(AnimationToolType.BoneInfluence, m_Model.applicationElapseTime);
|
||||
else if (tool == m_Model.GetTool(Tools.GenerateWeights))
|
||||
StartNewEvent(AnimationToolType.GenerateWeights, m_Model.applicationElapseTime);
|
||||
else if (tool == m_Model.GetTool(Tools.WeightBrush))
|
||||
StartNewEvent(AnimationToolType.WeightBrush, m_Model.applicationElapseTime);
|
||||
else if (tool == m_Model.GetTool(Tools.WeightSlider))
|
||||
StartNewEvent(AnimationToolType.WeightSlider, m_Model.applicationElapseTime);
|
||||
else
|
||||
StartNewEvent(AnimationToolType.UnknownTool, m_Model.applicationElapseTime);
|
||||
}
|
||||
|
||||
void OnRestoreBindPose()
|
||||
{
|
||||
SetAnimationEvent(new AnimationEvent()
|
||||
{
|
||||
sub_type = AnimationEventType.RestoreBindPose,
|
||||
data = ""
|
||||
});
|
||||
}
|
||||
|
||||
void SetAnimationEvent(AnimationEvent evt)
|
||||
{
|
||||
if (m_CurrentEvent != null)
|
||||
{
|
||||
var toolEvent = m_CurrentEvent.Value;
|
||||
var eventCount = toolEvent.animation_events.Count;
|
||||
if (eventCount > 0 && toolEvent.animation_events[eventCount - 1].sub_type == evt.sub_type && toolEvent.animation_events[eventCount - 1].data == evt.data)
|
||||
{
|
||||
var e = toolEvent.animation_events[eventCount - 1];
|
||||
e.repeated_event += 1;
|
||||
toolEvent.animation_events[eventCount - 1] = e;
|
||||
}
|
||||
else
|
||||
{
|
||||
var elementCountPlus = k_AnimationToolUsageEventElementCount + (eventCount + 1 * k_AnimationEventElementCount);
|
||||
if (elementCountPlus >= AnalyticConstant.k_MaxNumberOfElements)
|
||||
{
|
||||
// We reached the max number of events. Change the last one to truncated
|
||||
var e = toolEvent.animation_events[eventCount - 1];
|
||||
if (e.sub_type != AnimationEventType.Truncated)
|
||||
{
|
||||
e.sub_type = AnimationEventType.Truncated;
|
||||
e.repeated_event = 0;
|
||||
}
|
||||
e.repeated_event += 1;
|
||||
toolEvent.animation_events[eventCount - 1] = e;
|
||||
}
|
||||
else
|
||||
toolEvent.animation_events.Add(evt);
|
||||
}
|
||||
m_CurrentEvent = toolEvent;
|
||||
}
|
||||
}
|
||||
|
||||
void StartNewEvent(AnimationToolType animationType, int tick)
|
||||
{
|
||||
SendLastEvent(tick);
|
||||
m_CurrentEvent = new AnimationToolUsageEvent()
|
||||
{
|
||||
instance_id = m_InstanceId,
|
||||
character_mode = m_Model.mode == SkinningMode.Character,
|
||||
animation_tool = animationType,
|
||||
time_start_s = tick,
|
||||
animation_events = new List<AnimationEvent>()
|
||||
};
|
||||
}
|
||||
|
||||
void SendLastEvent(AnimationToolUsageEvent evt, int tick)
|
||||
{
|
||||
evt.time_end_s = tick;
|
||||
m_AnalyticsStorage.SendUsageEvent(evt);
|
||||
}
|
||||
|
||||
void SendLastEvent(int tick)
|
||||
{
|
||||
if (m_CurrentEvent != null)
|
||||
{
|
||||
SendLastEvent(m_CurrentEvent.Value, tick);
|
||||
}
|
||||
m_CurrentEvent = null;
|
||||
}
|
||||
|
||||
public void FlushEvent()
|
||||
{
|
||||
SendLastEvent(m_Model.applicationElapseTime);
|
||||
}
|
||||
|
||||
public void SendApplyEvent(int spriteCount, int[] spriteBoneCount, BoneCache[] bones)
|
||||
{
|
||||
int[] chainBoneCount = null;
|
||||
int[] maxDepth = null;
|
||||
int[] boneCount = null;
|
||||
int boneRootCount = 0;
|
||||
GetChainBoneStatistic(bones, out chainBoneCount, out maxDepth, out boneRootCount, out boneCount);
|
||||
var applyEvent = new AnimationToolApplyEvent()
|
||||
{
|
||||
instance_id = m_InstanceId,
|
||||
character_mode = m_Model.hasCharacter,
|
||||
sprite_count = spriteCount,
|
||||
bone_sprite_count = spriteBoneCount,
|
||||
bone_depth = maxDepth,
|
||||
bone_chain_count = chainBoneCount,
|
||||
bone_root_count = boneRootCount,
|
||||
bone_count = boneCount
|
||||
};
|
||||
m_AnalyticsStorage.SendApplyEvent(applyEvent);
|
||||
}
|
||||
|
||||
static void GetChainBoneStatistic(BoneCache[] bones, out int[] chainBoneCount, out int[] maxDepth, out int boneRootCount, out int[] boneCount)
|
||||
{
|
||||
List<int> chainCountList = new List<int>();
|
||||
List<int> boneDepthList = new List<int>();
|
||||
List<int> countList = new List<int>();
|
||||
boneRootCount = 0;
|
||||
foreach (var b in bones)
|
||||
{
|
||||
if (b.parentBone == null)
|
||||
{
|
||||
++boneRootCount;
|
||||
var chain = 0;
|
||||
var chainDepth = 0;
|
||||
var tempBone = b;
|
||||
var count = 1;
|
||||
while (tempBone != null)
|
||||
{
|
||||
++chainDepth;
|
||||
tempBone = tempBone.chainedChild;
|
||||
}
|
||||
|
||||
foreach (var b1 in bones)
|
||||
{
|
||||
// if this bone is part of this root
|
||||
var parentBone = b1.parentBone;
|
||||
while (parentBone != null)
|
||||
{
|
||||
if (parentBone == b)
|
||||
{
|
||||
++count;
|
||||
// the bone has a parent and the parent bone's chainedChild is not us, means we are a new chain
|
||||
if (b1.parentBone != null && b1.parentBone.chainedChild != b1)
|
||||
{
|
||||
++chain;
|
||||
var chainDepth1 = 0;
|
||||
tempBone = b1;
|
||||
while (tempBone != null)
|
||||
{
|
||||
++chainDepth1;
|
||||
tempBone = tempBone.chainedChild;
|
||||
}
|
||||
|
||||
chainDepth = chainDepth1 > chainDepth ? chainDepth1 : chainDepth;
|
||||
}
|
||||
break;
|
||||
}
|
||||
parentBone = parentBone.parentBone;
|
||||
}
|
||||
}
|
||||
chainCountList.Add(chain);
|
||||
boneDepthList.Add(chainDepth);
|
||||
countList.Add(count);
|
||||
}
|
||||
}
|
||||
chainBoneCount = chainCountList.ToArray();
|
||||
maxDepth = boneDepthList.ToArray();
|
||||
boneCount = countList.ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
internal interface IAnalyticsStorage
|
||||
{
|
||||
AnalyticsResult SendUsageEvent(AnimationToolUsageEvent evt);
|
||||
AnalyticsResult SendApplyEvent(AnimationToolApplyEvent evt);
|
||||
void Dispose();
|
||||
}
|
||||
|
||||
internal static class AnalyticConstant
|
||||
{
|
||||
public const int k_MaxEventsPerHour = 1000;
|
||||
public const int k_MaxNumberOfElements = 1000;
|
||||
}
|
||||
|
||||
internal class AnalyticsJsonStorage : IAnalyticsStorage
|
||||
{
|
||||
[Serializable]
|
||||
struct AnimationToolEvents
|
||||
{
|
||||
[SerializeField]
|
||||
public List<AnimationToolUsageEvent> events;
|
||||
[SerializeField]
|
||||
public AnimationToolApplyEvent applyEvent;
|
||||
}
|
||||
|
||||
AnimationToolEvents m_TotalEvents = new AnimationToolEvents()
|
||||
{
|
||||
events = new List<AnimationToolUsageEvent>(),
|
||||
applyEvent = new AnimationToolApplyEvent()
|
||||
};
|
||||
|
||||
public AnalyticsResult SendUsageEvent(AnimationToolUsageEvent evt)
|
||||
{
|
||||
m_TotalEvents.events.Add(evt);
|
||||
return AnalyticsResult.Ok;
|
||||
}
|
||||
|
||||
public AnalyticsResult SendApplyEvent(AnimationToolApplyEvent evt)
|
||||
{
|
||||
m_TotalEvents.applyEvent = evt;
|
||||
return AnalyticsResult.Ok;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
try
|
||||
{
|
||||
string file = string.Format("analytics_{0}.json", System.DateTime.Now.ToString("yyyy-dd-M--HH-mm-ss"));
|
||||
if (System.IO.File.Exists(file))
|
||||
System.IO.File.Delete(file);
|
||||
System.IO.File.WriteAllText(file, JsonUtility.ToJson(m_TotalEvents, true));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.Log(ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
m_TotalEvents.events.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[InitializeOnLoad]
|
||||
internal class UnityAnalyticsStorage : IAnalyticsStorage
|
||||
{
|
||||
const string k_VendorKey = "unity.2d.animation";
|
||||
const int k_Version = 1;
|
||||
|
||||
static UnityAnalyticsStorage()
|
||||
{
|
||||
EditorAnalytics.RegisterEventWithLimit("u2dAnimationToolUsage", AnalyticConstant.k_MaxEventsPerHour, AnalyticConstant.k_MaxNumberOfElements, k_VendorKey, k_Version);
|
||||
EditorAnalytics.RegisterEventWithLimit("u2dAnimationToolApply", AnalyticConstant.k_MaxEventsPerHour, AnalyticConstant.k_MaxNumberOfElements, k_VendorKey, k_Version);
|
||||
}
|
||||
|
||||
public AnalyticsResult SendUsageEvent(AnimationToolUsageEvent evt)
|
||||
{
|
||||
return EditorAnalytics.SendEventWithLimit("u2dAnimationToolUsage", evt, k_Version);
|
||||
}
|
||||
|
||||
public AnalyticsResult SendApplyEvent(AnimationToolApplyEvent evt)
|
||||
{
|
||||
return EditorAnalytics.SendEventWithLimit("u2dAnimationToolApply", evt, k_Version);
|
||||
}
|
||||
|
||||
public void Dispose() {}
|
||||
}
|
||||
}
|
@@ -0,0 +1,6 @@
|
||||
using System.Runtime.CompilerServices;
|
||||
[assembly: InternalsVisibleTo("Unity.2D.Animation.Tests.EditorTests")]
|
||||
[assembly: InternalsVisibleTo("Unity.2D.PsdImporter.Editor")]
|
||||
[assembly: InternalsVisibleTo("Unity.2D.IK.Editor")]
|
||||
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")]
|
||||
|
After Width: | Height: | Size: 437 B |
After Width: | Height: | Size: 8.2 KiB |
After Width: | Height: | Size: 838 B |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 508 B |
After Width: | Height: | Size: 8.8 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 442 B |
After Width: | Height: | Size: 8.3 KiB |
After Width: | Height: | Size: 891 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 3.5 KiB |
After Width: | Height: | Size: 505 B |
After Width: | Height: | Size: 8.7 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 377 B |
After Width: | Height: | Size: 839 B |
After Width: | Height: | Size: 427 B |
After Width: | Height: | Size: 947 B |
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<UXML xmlns:ui="UnityEngine.UIElements" xmlns:myui="UnityEditor.U2D.Layout">
|
||||
<myui:LayoutOverlay name="LayoutOverlay" picking-mode="Ignore">
|
||||
<ui:VisualElement name="HorizontalHolder" picking-mode="Ignore">
|
||||
<myui:ScrollableToolbar name="VerticalToolbar" picking-mode="Ignore" />
|
||||
<ui:VisualElement name="LeftOverlay" picking-mode="Ignore" />
|
||||
<ui:VisualElement name="RightOverlay" picking-mode="Ignore" />
|
||||
</ui:VisualElement>
|
||||
<myui:ScrollableToolbar name="HorizontalToolbar" isHorizontal="true" picking-mode="Ignore" />
|
||||
<myui:DropdownMenu name="DropdownOverlay" picking-mode="Ignore" />
|
||||
</myui:LayoutOverlay>
|
||||
</UXML>
|
@@ -0,0 +1,190 @@
|
||||
/**********************************************************************************************************************/
|
||||
/* LayoutOverlay */
|
||||
/**********************************************************************************************************************/
|
||||
|
||||
LayoutOverlay {
|
||||
flex-direction: column-reverse;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
LayoutOverlay.HasScrollbar {
|
||||
margin-right: 18px;
|
||||
margin-bottom: 18px;
|
||||
}
|
||||
|
||||
//Disable Horizontal Toolbar until needed
|
||||
LayoutOverlay > #HorizontalToolbar {
|
||||
height: 0;
|
||||
}
|
||||
|
||||
LayoutOverlay > #HorizontalHolder {
|
||||
flex:1 auto;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
LayoutOverlay > #HorizontalHolder > #VerticalToolbar {
|
||||
width: 140px;
|
||||
margin-left : 10px;
|
||||
}
|
||||
|
||||
LayoutOverlay > #HorizontalHolder > #VerticalToolbar.Collapse {
|
||||
width: 50px;
|
||||
}
|
||||
|
||||
LayoutOverlay > #HorizontalHolder > #LeftOverlay {
|
||||
flex-grow: 1;
|
||||
flex-direction: column-reverse;
|
||||
flex-wrap: wrap;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
LayoutOverlay > #HorizontalHolder > #RightOverlay {
|
||||
|
||||
flex-grow: 1;
|
||||
flex-direction: column-reverse;
|
||||
flex-wrap: wrap-reverse;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
LayoutOverlay > #DropdownOverlay {
|
||||
height: 0;
|
||||
width: 0;
|
||||
}
|
||||
|
||||
LayoutOverlay > #HorizontalHolder > #RightOverlay.VisibilityWindowOn {
|
||||
min-height : 400px;
|
||||
}
|
||||
|
||||
LayoutOverlay > #HorizontalHolder > #RightOverlay {
|
||||
min-height : 250px;
|
||||
}
|
||||
|
||||
LayoutOverlay > #HorizontalHolder > #RightOverlay PopupWindow {
|
||||
flex:1 0 auto;
|
||||
width : 280px;
|
||||
padding-left : 12px;
|
||||
padding-right : 12px;
|
||||
}
|
||||
|
||||
LayoutOverlay > #HorizontalHolder > #RightOverlay PopupWindow #ModeField {
|
||||
margin-left : 0;
|
||||
}
|
||||
|
||||
LayoutOverlay > #HorizontalHolder > #RightOverlay PopupWindow #BonePopupField {
|
||||
margin-left : 0;
|
||||
}
|
||||
|
||||
LayoutOverlay > #HorizontalHolder > #RightOverlay PopupWindow #BonePopupField .unity-popup-field__input {
|
||||
flex-basis : 0px;
|
||||
}
|
||||
|
||||
LayoutOverlay > #HorizontalHolder > #RightOverlay PopupWindow > #unity-content-container {
|
||||
flex:1 0 auto;
|
||||
}
|
||||
|
||||
LayoutOverlay > #HorizontalHolder > #RightOverlay PopupWindow .form-row {
|
||||
max-height : 20px;
|
||||
flex-direction: row;
|
||||
margin-left : 0;
|
||||
margin-right : 0;
|
||||
margin-top : 0;
|
||||
margin-bottom : 0;
|
||||
flex : 1 0 auto;
|
||||
}
|
||||
|
||||
LayoutOverlay > #HorizontalHolder > #RightOverlay PopupWindow .form-row-space {
|
||||
height : 5px;
|
||||
}
|
||||
|
||||
LayoutOverlay > #HorizontalHolder > #RightOverlay PopupWindow .form-editor {
|
||||
flex-direction: row;
|
||||
flex: 6;
|
||||
}
|
||||
|
||||
LayoutOverlay > #HorizontalHolder > #RightOverlay PopupWindow .form-popup {
|
||||
margin-left : 0px;
|
||||
flex : 1 0 auto;
|
||||
}
|
||||
|
||||
LayoutOverlay > #HorizontalHolder > #RightOverlay PopupWindow .form-popup .unity-enum-field {
|
||||
flex : 1 0 auto;
|
||||
}
|
||||
|
||||
LayoutOverlay > #HorizontalHolder > #RightOverlay PopupWindow .form-popup .unity-popup-field {
|
||||
flex : 1 0 auto;
|
||||
}
|
||||
|
||||
LayoutOverlay > #HorizontalHolder > #RightOverlay PopupWindow .form-popup .unity-label {
|
||||
min-width : auto;
|
||||
flex : 4;
|
||||
}
|
||||
|
||||
LayoutOverlay > #HorizontalHolder > #RightOverlay PopupWindow .form-popup .unity-enum-field__input,
|
||||
LayoutOverlay > #HorizontalHolder > #RightOverlay PopupWindow .form-popup .unity-popup-field__input {
|
||||
flex : 6;
|
||||
min-width : auto;
|
||||
}
|
||||
|
||||
LayoutOverlay > #HorizontalHolder > #RightOverlay PopupWindow .form-toggle {
|
||||
margin-left : 0px;
|
||||
flex : 1;
|
||||
}
|
||||
|
||||
LayoutOverlay > #HorizontalHolder > #RightOverlay PopupWindow .form-toggle .unity-toggle__input {
|
||||
justify-content : flex-end;
|
||||
}
|
||||
|
||||
LayoutOverlay > #HorizontalHolder > #RightOverlay PopupWindow .form-integerfield {
|
||||
margin-left : 0px;
|
||||
flex : 1;
|
||||
}
|
||||
|
||||
|
||||
LayoutOverlay > #HorizontalHolder > #RightOverlay PopupWindow .form-integerfield IntegerInput {
|
||||
margin-left : 0px;
|
||||
flex : 6;
|
||||
}
|
||||
|
||||
LayoutOverlay > #HorizontalHolder > #RightOverlay PopupWindow .slider-field {
|
||||
flex: 3;
|
||||
}
|
||||
|
||||
LayoutOverlay > #HorizontalHolder > #RightOverlay PopupWindow Label {
|
||||
flex: 4;
|
||||
margin-top : 2px;
|
||||
margin-bottom : 2px;
|
||||
}
|
||||
|
||||
|
||||
LayoutOverlay > #HorizontalHolder > #RightOverlay PopupWindow Slider {
|
||||
flex: 7;
|
||||
margin-left : 4px;
|
||||
margin-top :2px;
|
||||
margin-right : 10px;
|
||||
margin-bottom :2px;
|
||||
}
|
||||
|
||||
LayoutOverlay > #HorizontalHolder > #RightOverlay PopupWindow Button {
|
||||
flex : 1 0 auto;
|
||||
margin-left: 1px;
|
||||
margin-right: 1px;
|
||||
margin-top: 1px;
|
||||
margin-bottom: 1px;
|
||||
border-left-width: 1px;
|
||||
border-right-width: 1px;
|
||||
border-bottom-width: 1px;
|
||||
border-top-width: 1px;
|
||||
border-top-left-radius: 3px;
|
||||
border-top-right-radius: 3px;
|
||||
border-bottom-left-radius: 3px;
|
||||
border-bottom-right-radius: 3px;
|
||||
padding-left: 2px;
|
||||
padding-right: 2px;
|
||||
padding-bottom: 2px;
|
||||
padding-top: 2px;
|
||||
}
|
||||
|
||||
LayoutOverlay > #HorizontalHolder > #RightOverlay PopupWindow Toggle {
|
||||
align-self : center;
|
||||
margin-bottom: 4px;
|
||||
}
|
@@ -0,0 +1,16 @@
|
||||
/**********************************************************************************************************************/
|
||||
/* Scroller */
|
||||
/**********************************************************************************************************************/
|
||||
|
||||
/* Horizontal scroller */
|
||||
Scroller {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/**********************************************************************************************************************/
|
||||
/* ScrollView */
|
||||
/**********************************************************************************************************************/
|
||||
|
||||
ScrollView {
|
||||
flex: 1;
|
||||
}
|
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<UXML xmlns:ui="UnityEngine.UIElements" xmlns:eui="UnityEditor.UIElements" xmlns:aui="UnityEditor.U2D.Animation">
|
||||
<aui:BoneInspectorPanel name="BoneInspectorPanel" text="Bone Inspector" picking-mode="Ignore">
|
||||
<ui:PopupWindow name="BoneInspectorPopupWindow" text="Bone">
|
||||
<ui:VisualElement name="BoneName" class="form-row">
|
||||
<ui:Label name="BoneNameLabel" text="Name" tooltip ="Name of the bone"/>
|
||||
<ui:TextField name="BoneNameField" class="form-editor" />
|
||||
</ui:VisualElement>
|
||||
<ui:VisualElement name="BonePosition" class="form-row">
|
||||
<ui:Label name="BonePositionLabel" text="Position" tooltip ="Position of the bone"/>
|
||||
<eui:Vector2Field name="BonePositionField" class="form-editor"/>
|
||||
</ui:VisualElement>
|
||||
<eui:FloatField name="BoneRotationField" label = "Rotation" tooltip ="Rotation of the bone"/>
|
||||
<eui:ColorField name="BoneColorField" label = "Bone Color" show-alpha = "false" tooltip ="Color of the bone"/>
|
||||
<ui:VisualElement name="BoneDepth" class="form-row">
|
||||
<ui:Label name="BoneDepthLabel" text="Depth" tooltip ="Depth value of the bone"/>
|
||||
<eui:IntegerField name="BoneDepthField" class="form-editor" />
|
||||
</ui:VisualElement>
|
||||
</ui:PopupWindow>
|
||||
</aui:BoneInspectorPanel>
|
||||
</UXML>
|
@@ -0,0 +1,64 @@
|
||||
/**********************************************************************************************************************/
|
||||
/* BoneInspectorPanel */
|
||||
/**********************************************************************************************************************/
|
||||
|
||||
#BoneInspectorPanel {
|
||||
height : 140px;
|
||||
}
|
||||
|
||||
#BoneInspectorPanel Vector2Field FloatField > Label {
|
||||
max-width : 10px;
|
||||
}
|
||||
|
||||
#BoneInspectorPanel #BoneRotationField{
|
||||
margin-left : 0px;
|
||||
padding-left : 0px;
|
||||
}
|
||||
|
||||
#BoneInspectorPanel #BoneRotationField > FloatInput{
|
||||
flex : 6;
|
||||
margin-left : 8px;
|
||||
}
|
||||
|
||||
#BoneInspectorPanel #BoneRotationField > Label {
|
||||
margin-left : 0px;
|
||||
padding-left : 0px;
|
||||
min-width : auto;
|
||||
padding-top: 0px;
|
||||
padding-bottom:0px;
|
||||
}
|
||||
|
||||
#BoneInspectorPanel #BoneColorField{
|
||||
margin-left : 0px;
|
||||
padding-left : 0px;
|
||||
}
|
||||
|
||||
#BoneInspectorPanel #BoneColorField > IMGUIContainer{
|
||||
flex: 6 0;
|
||||
margin-left : 4px;
|
||||
padding-left : 0px;
|
||||
}
|
||||
|
||||
#BoneInspectorPanel #BoneColorField > Label {
|
||||
margin-left : 0px;
|
||||
padding-left : 0px;
|
||||
min-width : auto;
|
||||
padding-top: 0px;
|
||||
padding-bottom:0px;
|
||||
}
|
||||
|
||||
#BoneInspectorPanel Vector2Field {
|
||||
margin-right : 0px;
|
||||
padding-right : 0px;
|
||||
margin-left : 0px;
|
||||
padding-left : 0px;
|
||||
}
|
||||
|
||||
#BoneInspectorPanel #BonePositionField FloatInput {
|
||||
margin-right : 0px;
|
||||
padding-right : 0px;
|
||||
}
|
||||
|
||||
.unity-composite-field__field-spacer {
|
||||
width: 0px;
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
BoneReparentToolWindow {
|
||||
height: 300px;
|
||||
}
|
||||
|
||||
BoneReparentToolView{
|
||||
flex : 1;
|
||||
}
|
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<UXML xmlns:ui="UnityEngine.UIElements" xmlns:eui="UnityEditor.UIElements" xmlns:aui="UnityEditor.U2D.Animation">
|
||||
<aui:BoneReparentToolWindow name="BoneReparentToolWindow" picking-mode="Ignore">
|
||||
<ui:PopupWindow name="PopupWindow" text="Reparent Bones">
|
||||
<aui:BoneReparentToolView name ="BoneReparentToolView" />
|
||||
</ui:PopupWindow>
|
||||
</aui:BoneReparentToolWindow>
|
||||
</UXML>
|
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<UXML xmlns:ui="UnityEngine.UIElements" xmlns:aui="UnityEditor.U2D.Animation">
|
||||
<aui:BoneToolbar name="BoneToolbar">
|
||||
<ui:PopupWindow name="PopupWindow" text="Bones">
|
||||
<ui:Button name="EditPose" tooltip="Pose character to view setup">
|
||||
<ui:Image name="EditPoseImage" />
|
||||
<ui:Label text ="Preview Pose"/>
|
||||
</ui:Button>
|
||||
<ui:Button name="EditJoints" tooltip="Edit bones position and rotation">
|
||||
<ui:Image name="EditJointsImage" />
|
||||
<ui:Label text ="Edit Bone"/>
|
||||
</ui:Button>
|
||||
<ui:Button name="CreateBone" tooltip="Create new bones">
|
||||
<ui:Image name="CreateBoneImage" />
|
||||
<ui:Label text ="Create Bone"/>
|
||||
</ui:Button>
|
||||
<ui:Button name="SplitBone" tooltip="Split an existing bone">
|
||||
<ui:Image name="SplitBoneImage" />
|
||||
<ui:Label text ="Split Bone"/>
|
||||
</ui:Button>
|
||||
</ui:PopupWindow>
|
||||
</aui:BoneToolbar>
|
||||
</UXML>
|
@@ -0,0 +1,63 @@
|
||||
/**********************************************************************************************************************/
|
||||
/* BoneToolbar */
|
||||
/**********************************************************************************************************************/
|
||||
|
||||
#EditPoseImage {
|
||||
background-image: url("Icons/Light/Edit_Pose.png");
|
||||
}
|
||||
|
||||
#EditJointsImage {
|
||||
background-image: url("Icons/Light/Edit_Joints.png");
|
||||
}
|
||||
|
||||
#CreateBoneImage {
|
||||
background-image: url("Icons/Light/Create Bones.png");
|
||||
}
|
||||
|
||||
#SplitBoneImage {
|
||||
background-image: url("Icons/Light/Split Bones.png");
|
||||
}
|
||||
|
||||
#BoneReparentImage {
|
||||
background-image: url("Icons/Light/Parent_Bone.png");
|
||||
}
|
||||
|
||||
.Dark #EditPoseImage {
|
||||
background-image: url("Icons/Dark/d_Edit_Pose.png");
|
||||
}
|
||||
|
||||
.Dark #EditJointsImage {
|
||||
background-image: url("Icons/Dark/d_Edit_Joints.png");
|
||||
}
|
||||
|
||||
.Dark #CreateBoneImage {
|
||||
background-image: url("Icons/Dark/d_Create Bones.png");
|
||||
}
|
||||
|
||||
.Dark #SplitBoneImage {
|
||||
background-image: url("Icons/Dark/d_Split Bones.png");
|
||||
}
|
||||
|
||||
.Dark #BoneReparentImage {
|
||||
background-image: url("Icons/Dark/d_Parent_Bone.png");
|
||||
}
|
||||
|
||||
.Checked #EditPoseImage{
|
||||
background-image: url("Icons/Selected/Edit_Pose.png");
|
||||
}
|
||||
|
||||
.Checked #EditJointsImage {
|
||||
background-image: url("Icons/Selected/Edit_Joints.png");
|
||||
}
|
||||
|
||||
.Checked #CreateBoneImage {
|
||||
background-image: url("Icons/Selected/Create Bones.png");
|
||||
}
|
||||
|
||||
.Checked #SplitBoneImage {
|
||||
background-image: url("Icons/Selected/Split Bones.png");
|
||||
}
|
||||
|
||||
.Checked #BoneReparentImage {
|
||||
background-image: url("Icons/Selected/Parent_Bone.png");
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<UXML xmlns:ui="UnityEngine.UIElements" xmlns:aui="UnityEditor.U2D.Animation">
|
||||
<aui:CopyToolbar name="CopyToolbar">
|
||||
<ui:Button name="Copy" tooltip="Copy">
|
||||
<ui:Image name="CopyImage" />
|
||||
</ui:Button>
|
||||
<ui:Button name="Paste" tooltip="Paste">
|
||||
<ui:Image name="PasteImage" />
|
||||
</ui:Button>
|
||||
</aui:CopyToolbar>
|
||||
</UXML>
|
@@ -0,0 +1,11 @@
|
||||
/**********************************************************************************************************************/
|
||||
/* CopyToolbar */
|
||||
/**********************************************************************************************************************/
|
||||
|
||||
#CopyImage {
|
||||
background-image: url("Icons/Selected/Copy.png");
|
||||
}
|
||||
|
||||
#PasteImage {
|
||||
background-image: url("Icons/Selected/Paste.png");
|
||||
}
|
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<UXML xmlns:ui="UnityEngine.UIElements" xmlns:eui="UnityEditor.UIElements" xmlns:aui="UnityEditor.U2D.Animation">
|
||||
<aui:GenerateGeometryPanel name="GenerateGeometryPanel" picking-mode="Ignore">
|
||||
<ui:PopupWindow text="Geometry">
|
||||
<ui:VisualElement name="Content">
|
||||
<ui:VisualElement class="form-row">
|
||||
<ui:Label name="OutlineDetailLabel" tooltip="Accuracy of the generated outline. Small values will produce simpler outlines. Large values will produce denser outlines that fit to the Sprite better" text="Outline Detail" />
|
||||
<ui:VisualElement class="form-editor">
|
||||
<ui:Slider name="OutlineDetailSlider" direction="Horizontal" low-value="0" high-value="100" />
|
||||
<eui:IntegerField name="OutlineDetailField" class="slider-field" value="0" />
|
||||
</ui:VisualElement>
|
||||
</ui:VisualElement>
|
||||
<ui:VisualElement class="form-row">
|
||||
<ui:Label name="AlphaToleranceLabel" tooltip="Pixels with alpha value smaller than tolerance will be considered transparent during outline detection" text="Alpha Tolerance" />
|
||||
<ui:VisualElement class="form-editor">
|
||||
<ui:Slider name="AlphaToleranceSlider" direction="Horizontal" low-value="0" high-value="254" />
|
||||
<eui:IntegerField name="AlphaToleranceField" class="slider-field" value="0" />
|
||||
</ui:VisualElement>
|
||||
</ui:VisualElement>
|
||||
<ui:VisualElement class="form-row">
|
||||
<ui:Label name="SubdivideLabel" tooltip="Tesselate the Sprite by adding vertices inside the generated outline" text="Subdivide" />
|
||||
<ui:VisualElement class="form-editor">
|
||||
<ui:Slider name="SubdivideSlider" direction="Horizontal" low-value="0" high-value="100" />
|
||||
<eui:IntegerField name="SubdivideField" class="slider-field" value="0" />
|
||||
</ui:VisualElement>
|
||||
</ui:VisualElement>
|
||||
<ui:VisualElement class="form-row">
|
||||
<ui:Label name="GenerateWeightsLabel" tooltip="Initialize weights automatically for the generated geometry" text="Weights" />
|
||||
<ui:Toggle name="GenerateWeightsField" class="form-editor" value="true" />
|
||||
</ui:VisualElement>
|
||||
<ui:VisualElement class="form-row-space" />
|
||||
<ui:VisualElement name="GenerateSingleSprite" class="form-row">
|
||||
<ui:Button name="GenerateGeometryButton" text="Generate For Selected" tooltip="Generate Geometry for the selected Sprite"/>
|
||||
</ui:VisualElement>
|
||||
<ui:VisualElement name="GenerateMultipleSprite" class="form-row">
|
||||
<ui:Button name="GenerateGeometryAllButton" text="Generate For All Visible" tooltip="Generate Geometry for all the Sprites"/>
|
||||
</ui:VisualElement>
|
||||
</ui:VisualElement>
|
||||
</ui:PopupWindow>
|
||||
</aui:GenerateGeometryPanel>
|
||||
</UXML>
|
@@ -0,0 +1,17 @@
|
||||
/**********************************************************************************************************************/
|
||||
/* GenerateGeometryPanel */
|
||||
/**********************************************************************************************************************/
|
||||
|
||||
#GenerateGeometryPanel {
|
||||
height: 150px;
|
||||
}
|
||||
|
||||
#GenerateGeometryPanel.Single #GenerateMultipleSprite {
|
||||
visibility: hidden;
|
||||
height : 0;
|
||||
}
|
||||
|
||||
#GenerateGeometryPanel.Multiple #GenerateSingleSprite {
|
||||
visibility: hidden;
|
||||
height : 0;
|
||||
}
|
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<UXML xmlns:ui="UnityEngine.UIElements" xmlns:eui="UnityEditor.UIElements" xmlns:aui="UnityEditor.U2D.Animation">
|
||||
<aui:GenerateWeightsPanel name="GenerateWeightsPanel" picking-mode="Ignore">
|
||||
<ui:PopupWindow text="Weights">
|
||||
<ui:VisualElement class="form-row" name ="AssociateBonesControl">
|
||||
<ui:Label name="AssociateBonesLabel" tooltip="Automatically associate Bones to Sprites if Bones overlay on the Sprite" text="Associate Bones" />
|
||||
<ui:Toggle name="AssociateBonesField" class="form-editor" value="false" />
|
||||
</ui:VisualElement>
|
||||
<ui:VisualElement name="Content">
|
||||
<ui:VisualElement class="form-row-space" />
|
||||
<ui:VisualElement class="form-row">
|
||||
<ui:Button name="GenerateWeightsButton" text="Generate" tooltip="Generate Weights"/>
|
||||
<ui:Button name="NormalizeWeightsButton" text="Normalize" tooltip="Normalize Weights"/>
|
||||
<ui:Button name="ClearWeightsButton" text="Clear" tooltip="Clear Weights"/>
|
||||
</ui:VisualElement>
|
||||
</ui:VisualElement>
|
||||
</ui:PopupWindow>
|
||||
</aui:GenerateWeightsPanel>
|
||||
</UXML>
|
@@ -0,0 +1,20 @@
|
||||
/**********************************************************************************************************************/
|
||||
/* GenerateWeightsPanel */
|
||||
/**********************************************************************************************************************/
|
||||
|
||||
.AssociateBoneDisabled {
|
||||
height: 70px;
|
||||
}
|
||||
|
||||
.AssociateBoneEnabled {
|
||||
height: 90px;
|
||||
}
|
||||
|
||||
#Content{
|
||||
width : 250px;
|
||||
align-content : center;
|
||||
}
|
||||
|
||||
.form-row{
|
||||
align-content : center;
|
||||
}
|
After Width: | Height: | Size: 401 B |
After Width: | Height: | Size: 806 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 564 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 2.5 KiB |
After Width: | Height: | Size: 206 B |
After Width: | Height: | Size: 297 B |
After Width: | Height: | Size: 428 B |
After Width: | Height: | Size: 552 B |
After Width: | Height: | Size: 435 B |
After Width: | Height: | Size: 870 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 366 B |
After Width: | Height: | Size: 752 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 411 B |
After Width: | Height: | Size: 772 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 561 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 428 B |
After Width: | Height: | Size: 821 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 538 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 2.5 KiB |
After Width: | Height: | Size: 516 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 399 B |
After Width: | Height: | Size: 735 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 414 B |
After Width: | Height: | Size: 775 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 436 B |
After Width: | Height: | Size: 839 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 218 B |
After Width: | Height: | Size: 361 B |
After Width: | Height: | Size: 521 B |
After Width: | Height: | Size: 670 B |
After Width: | Height: | Size: 468 B |
After Width: | Height: | Size: 948 B |
After Width: | Height: | Size: 1.4 KiB |