This commit is contained in:
2021-06-13 10:28:03 +02:00
parent eb70603c85
commit df2d24cbd3
7487 changed files with 943244 additions and 0 deletions

View File

@@ -0,0 +1,321 @@
# Changelog
## [6.0.1] - 2021-03-19
### Changed
- Removed redundant ForceReserializeAssets from SpritePostProcess.OnPreprocessAsset()
## [6.0.0] - 2021-03-17
### Changed
- Update version for release
## [6.0.0-pre.3] - 2021-03-08
### Changed
- Update manual documentaiton
## [6.0.0-pre.3] - 2021-03-15
### Changed
- Updated manual
### Fixed
- Deleting bones from a skeleton referenced by another character sometimes throws IndexOutOfRangeException (case 1304768)
## [6.0.0-pre.2] - 2021-01-16
### Changed
- Update license file
### Added
- Initial documentation update for new features for 6.0.0
### Fixed
- SpriteResolver resets to the current Sprite from SpriteRenderer if exist in Sprite Library
## [6.0.0-pre.1] - 2020-11-02
### Changed
- Sprite Swap related features moved out of experimental namespace
- Removed editing of Sprite Swap feature in Skinning Module
- Updated Sprite Swap workflow focusing on Project Window and Inspector
- Sprite Library Asset is created via AssetImporter
### Added
- Sprite Library Asset supports variant
- Sprite Library supports override during editing
- Supports sharing of bone structures in Skinning Module
- Added position, rotation and bone color editing in Skinning Module
### Fixed
- Added missing tooltips in the Sprite Skin inspector (case 1285255)
## [5.0.3] - 2020-10-15
### Fixed
- Fixed Sprite with no animation data is being processed during AssetPostProcessor
- Fixed properties under the Sprite Library Asset overlapping in inspector (case 1280017)
- Fixed vertical slider handle is not aligned and placed slightly to the right side in the Bone Influence window (case 1260568)
## [5.0.2] - 2020-08-31
### Fixed
- Fixed Visibility window overlaps with weights and geometry window when Sprite Editor Window resizes (case 1263353)
- Fixed 'Depth' column label gets clipped in Visibility Tool Window (case 1257991)
- Fixed 'Invalid worldAABB' error message when repeatedly pressing Pack Preview button (case 1270150)
- Fixed Null reference exception when changing values of a material while recording animation with Skinning Module enabled (case 1267300)
- Improved memory and speed of Animation SpritePostProcess for large sprite count
## [5.0.1] - 2020-07-24
### Fixed
- Fixed Skinning module flickers when creating in category in Visibility Window (case 1244097)
- Fixed NullReferenceException when creating Preset for SpriteSkin component (case 1254873)
- Updated optional dependency support for Collections to 0.9.0-preview.6 and Burst 1.3.3 (case 1255839)
## [5.0.0] - 2020-05-11
### Changed
- Version bump for Unity 2020.2
### Added
- Combined 2D IK package with 2D Animation package
### Fixed
- Remove unused XR dependency (case 1249390)
- Fixed NullReferenceException when creating prefab with SpriteSkin component (case 1245149)
## [4.2.4] - 2020-05-19
### Fixed
- Fixed compilation error by depending on latest 2D Common package.
## [4.2.3] - 2020-04-26
### Changed
- Improved performance by batching buffer submission when Collection and Burst package is installed
### Fixed
- Fix 'ArgumentException' when creating UXML Template Asset with 2D Animation package installed (case 1239680)
## [4.2.2] - 2020-03-26
### Fixed
- Fixed bone name field in weight slider does not display bone name (case 1226249)
- Fixed SpriteResolver's Inspector not updated when GameObject is disabled
### Changed
- Improved deformation performance when Collection and Burst package is installed
### Added
- Allow reordering of bone order in Bone Influence window. This is to allow fine tuning of bone order when shown in SpriteSkin's Inspector
## [4.2.1] - 2020-03-20
### Fixed
- Fixed inconsistent line ending
## [4.2.0] - 2020-03-11
### Added
- Add alwaysUpdate option to SpriteSkin to determine if SpriteSkin execution should occur even when the associated SpriteRenderer is culled
- Added message to inform user on dependent packages when viewing certain sample Scenes
- Added API to access deformed vertices from SpriteSkin
### Changed
- Improved SpriteSkinEditor UI
- Adjust length of popup and value fields for Weight Slider Window
### Removed
- Remove Bounds Gizmo from SpriteSkin
- Remove Reset Bounds button from SpriteSkinEditor
### Fixed
- Fixed Sprite asset used by SpriteSkin in Scene is being deleted
- Fixed broken documentation links in inspectors
- Fixed Sprite deformation not updated when GameObject is being enabled
- Fixed exception after reverting from creating new vertices and edges
- Fixed visual defect after undoing changes to Bone Transform properties in SpriteSkin's Inspector
## [4.1.1] - 2020-01-20
###Fixed
- Fix 2D Animation not working when reloading scene in runtime (case 1211100)
###Added
- Bone visibility persist after apply
- Sprite visibility persist after apply
###Changed
- Deformed Sprite's bounds are now calculated and bounds property is removed from SpriteSkin's inspector (case 1208712)
## [4.1.0] - 2019-12-18
### Changed
- Changed default shortcut key for "Animation/Create Vertex" from "Shift-D" to "Shift-J"
- Changed default shortcut key for "Animation/Weight Brush" from "Shift-C" to "Shift-N"
### Fixed
- Fix visual glitch when using SpriteSwap with Multi-threaded rendering (case 1203380)
- Fix bone name misaligned under Weight Slider Inspector when a name contains more than 26 letters (case 1200873)
- Fix bones not chained correctly when splitting bone in certain cases
- Fix 'Label' and 'Sprite' name overlaps with its input field when preset of "Sprite Library Asset" is created (case 1201061)
- Fix bone names can be empty (case 1200861)
- Fix bone gets created even though clicked on Visibility Panel (case 1200857)
- Fix NullReferenceException when using shortcut 'Shift+1' in certain cases (case 1200849)
### Added
- Expose SpriteSkin component to be accessible from scripts.
## [4.0.1] - 2019-11-26
### Changed
- Changed how Samples are imported into the user's project
- Updated Third Party Notices file
### Fixed
- Fix Animation Samples crashes when installing on certain machines (case 1185787)
## [4.0.0] - 2019-11-06
### Changed
- Version bump for Unity 2020.1
- Improve optional performance boost by installing Burst and Collections package. Currently tested with
- com.unity.collections 0.1.1-preview
- com.unity.burst 1.1.2
### Added
- Skinning Module now persists the following state after Apply or Revert is clicked in Sprite Editor Window
- Current view mode i.e. Character or Spritesheet Mode
- Sprite Selection
- Bone Selection
- Preview Pose
- Vertex Selection
- Visibililty Tool Active State
- Weight Brush Settings
### Fixed
- Update to use new UIElements ListView API
## [3.0.7] - 2019-10-18
### Fixed
- Fix Search reset button is visible in Visibility tool when nothing is entered into the search field (case 1182627)
- Fix Sprite outline disappears when the Selected Outline Color alpha value is less than 255 (case 1186776)
- Fix button's label spelling error in 'Generate For All Visible' (case 1188621)
## [3.0.6] - 2019-09-18
### Changed
- Remove usage of Resource folder for assets needed by package.
### Fixed
- Fix GC allocation when using Sprite Resolver.
## [3.0.5] - 2019-09-06
### Added
- Optional performance boost by installing Burst package.
- Samples showing different how to produce different outcomes
### Changed
- Sprite and Group in Sprite Visibility Window appear in same order as original art source file
### Fixed
- Fix missing bone data in Sprite when importing with AssetDatabase V2
## [3.0.4] - 2019-08-09
### Added
- Add related test packages
- Added tangent deform for lighting support
### Fixed
- Fixed Amount slider not working in Weight Slider Panel
- Fixed exception when changing size to less than 0 in SpriteLibraryAssetInspector
- Fixed Sprite visual corruption when swapping Sprite using SpriteResolver
###Changed
- Make Size property field in Weight Brush draggable for changing brush size
- Rename SpriteLibraryAsset::GetCategorylabelNames to SpriteLibraryAsset::GetCategoryLabelNames
- Change string hash for Category and Label name. This might break existing animation usage with SpriteResolver.
- Add Experimental tag on Sprite Swap related features
## [3.0.3] - 2019-07-17
### Changed
- Update documentation
- Update to latest Mathematics package version
## [3.0.2] - 2019-07-13
### Changed
- Mark package to support Unity 2019.3.0a10 onwards.
## [3.0.1] - 2019-07-12
### Changed
- Fix path length due to validation failure.
## [3.0.0] - 2019-06-17
### Changed
- Remove preview tag.
- Remove experimental namespace
## [2.2.0-preview.3] - 2019-06-06
### Added
- BoneGizmos can be toggled in the SceneView Gizmos dropdown
- Scrollbar does not show for toolbar when required to scroll
- Change Sprite Library implementation.
- APIs redesigned. This will cause compilation errors if previous APIs are used
- Data serialization change. Previous Asset and Component data will not be compatible
## [2.2.0-preview.2] - 2019-05-10
### Added
- BoneGizmos will only show in selected hierarchies.
- Associate nearest Bone to Sprite intead of root Bone when no Bones are overlapping the Sprite
- Fixed Sprite not showing after it is being culled due to bone animation
- Add icons for Sprite Library Asset, Sprite Library Component and Sprite Resolver Component
- Fixed Sprite Library Asset Inspector Property Field text clipping
- SpriteResolver will assign Sprite to SpriteRenderer even it resolves to a missing Sprite
- Add visual feedback in SpriteResolver Inspector for missing Sprite
## [2.2.0-preview.1] - 2019-05-09
### Added
- Upgrade for 2019.2
- Copy and Paste rework
- Visibility Window remains open when switching between tools
- Reparent Bone tool removed and functionality moved into Bone Visibility Panel
- Added Sprite Library feature
- Add Layer Grouping support in Sprite Visibility Panel
## [2.1.0-preview.4] - 2019-04-29
### Added
- Fix skinning not in sync with the rendering.
## [2.1.0-preview.3] - 2019-04-24
### Added
- Set Burst compilation off for internal build
## [2.1.0-preview.2] - 2019-02-25
### Added
- Fix enable skinning on add SpriteSkin component
- Upgrade dependency package version for Unity 2019.1 support
- Fix case 1118093: SpriteSkin.onDrawGizmos() increases memory usage.
## [2.1.0-preview.1] - 2019-01-25
### Added
- Update package to work with 2019.1
- Improve animation runtime performance
- Fix bone reparenting sibling order
- Fix Sprite Visibility Tool in disabled state in certain cases
- Update documents
## [2.0.0-preview.1] - 2018-11-20
### Added
- Overhauled 2D Animation workflow.
- Refer to updated documentation for workflow changes.
- Single Sprite Editor Window module for 2D Sprite Rigging workflow
- Unified Bone, Geometry and Weight tools in a single window
- Supports Multiple Sprite Single Character rigging workflow through 2D PSD Importer Package.
- SpriteSkin now uses user define bounds for renderer culling
## [1.0.16-preview.2] - 2018-11-14
### Added
- Fix 2 Issues:
1. Prefabs with SpriteSkin loses references to bone hierarchy when Library folder is rebuilt/different.
2. The scene viewport shows the character without any bones applied, needing an re-import.
## [1.0.16-preview.1] - 2018-07-18
### Added
- Fix error log about VertexAttribute
## [1.0.16-preview] - 2018-06-20
### Added
- Fix Documentation warnings
- Fix error log complaining about DidReloadScripts signature.
- Fix issues with generate outline
## [1.0.15-preview] - 2018-04-12
### Added
- New Version suffix (preview)
- Improved Scene View gizmos for better manipulation of bone rotation and position
- Added notification when Sprites are imported with incorrect weights
- Fixed bug where textures with max texture size could not generate geometry

View File

@@ -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() {}
}
}

View File

@@ -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")]

Binary file not shown.

After

Width:  |  Height:  |  Size: 437 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 838 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 508 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 442 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 891 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 505 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 377 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 839 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 427 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 947 B

View File

@@ -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>

View File

@@ -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;
}

View File

@@ -0,0 +1,16 @@
/**********************************************************************************************************************/
/* Scroller */
/**********************************************************************************************************************/
/* Horizontal scroller */
Scroller {
display: none;
}
/**********************************************************************************************************************/
/* ScrollView */
/**********************************************************************************************************************/
ScrollView {
flex: 1;
}

View File

@@ -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>

View File

@@ -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;
}

View File

@@ -0,0 +1,7 @@
BoneReparentToolWindow {
height: 300px;
}
BoneReparentToolView{
flex : 1;
}

View File

@@ -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>

View File

@@ -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>

View File

@@ -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");
}

View File

@@ -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>

View File

@@ -0,0 +1,11 @@
/**********************************************************************************************************************/
/* CopyToolbar */
/**********************************************************************************************************************/
#CopyImage {
background-image: url("Icons/Selected/Copy.png");
}
#PasteImage {
background-image: url("Icons/Selected/Paste.png");
}

View File

@@ -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>

View File

@@ -0,0 +1,17 @@
/**********************************************************************************************************************/
/* GenerateGeometryPanel */
/**********************************************************************************************************************/
#GenerateGeometryPanel {
height: 150px;
}
#GenerateGeometryPanel.Single #GenerateMultipleSprite {
visibility: hidden;
height : 0;
}
#GenerateGeometryPanel.Multiple #GenerateSingleSprite {
visibility: hidden;
height : 0;
}

View File

@@ -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>

View File

@@ -0,0 +1,20 @@
/**********************************************************************************************************************/
/* GenerateWeightsPanel */
/**********************************************************************************************************************/
.AssociateBoneDisabled {
height: 70px;
}
.AssociateBoneEnabled {
height: 90px;
}
#Content{
width : 250px;
align-content : center;
}
.form-row{
align-content : center;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 401 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 806 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 564 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 297 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 428 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 552 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 435 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 870 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 752 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 411 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 561 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 428 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 821 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 538 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 414 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 775 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 436 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 839 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 521 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 670 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 468 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 948 B

Some files were not shown because too many files have changed in this diff Show More