Singularity/Library/PackageCache/com.unity.2d.animation@7.0.10/Editor/SkinningModule/CharacterModeTool/SwitchModeTool.cs

26 lines
731 B
C#
Raw Permalink Normal View History

2024-05-06 14:45:45 -04:00
using System;
namespace UnityEditor.U2D.Animation
{
internal class SwitchModeTool : BaseTool
{
protected override void OnActivate()
{
if (skinningCache.mode != SkinningMode.SpriteSheet)
{
skinningCache.mode = SkinningMode.SpriteSheet;
skinningCache.events.skinningModeChanged.Invoke(SkinningMode.SpriteSheet);
}
}
protected override void OnDeactivate()
{
if (skinningCache.mode != SkinningMode.Character)
{
skinningCache.mode = SkinningMode.Character;
skinningCache.events.skinningModeChanged.Invoke(SkinningMode.Character);
}
}
}
}