You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
66 lines
1.4 KiB
C#
66 lines
1.4 KiB
C#
3 months ago
|
using UnityEditor;
|
||
|
|
||
|
namespace D2D.Animations
|
||
|
{
|
||
|
[CustomEditor(typeof(PunchAnimation))]
|
||
|
[CanEditMultipleObjects]
|
||
|
public class PunchAnimationEditor : DAnimationEditor
|
||
|
{
|
||
|
protected override bool IsFromSupported => false;
|
||
|
|
||
|
protected override void ShowDefaultFields()
|
||
|
{
|
||
|
if (IsPunchUI())
|
||
|
{
|
||
|
ShowPunchUIProperty();
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
base.ShowDefaultFields();
|
||
|
|
||
|
Space();
|
||
|
|
||
|
ShowPunchFields();
|
||
|
}
|
||
|
|
||
|
protected override void ShowRandomFields()
|
||
|
{
|
||
|
if (IsPunchUI())
|
||
|
{
|
||
|
ShowPunchUIProperty();
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
base.ShowRandomFields();
|
||
|
|
||
|
Space();
|
||
|
|
||
|
ShowPunchFields();
|
||
|
}
|
||
|
|
||
|
protected override void ShowAdvancedInfo()
|
||
|
{
|
||
|
if (IsPunchUI())
|
||
|
return;
|
||
|
|
||
|
base.ShowAdvancedInfo();
|
||
|
}
|
||
|
|
||
|
private void ShowPunchFields()
|
||
|
{
|
||
|
ShowProperty("_vibratio");
|
||
|
ShowProperty("_elasity");
|
||
|
ShowPunchUIProperty();
|
||
|
}
|
||
|
|
||
|
private void ShowPunchUIProperty()
|
||
|
{
|
||
|
ShowProperty("_isPunchUI");
|
||
|
}
|
||
|
|
||
|
private bool IsPunchUI()
|
||
|
{
|
||
|
return serializedObject.FindProperty("_isPunchUI").boolValue;
|
||
|
}
|
||
|
}
|
||
|
}
|