PO/Library/PackageCache/com.unity.2d.animation@5.0.7/Editor/SkinningModule/CharacterModeTool/SwitchModeTool.cs

26 lines
731 B
C#
Raw Normal View History

2022-01-12 10:06:03 +03: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);
}
}
}
}