Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 29 additions & 4 deletions Assets/AnimationUI/Editor/SequenceDrawer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,18 @@ public override float GetPropertyHeight(SerializedProperty property, GUIContent
if(rtTask.HasFlag(Sequence.RtTask.AnchorMax))totalHeight+=_height*3;
if(rtTask.HasFlag(Sequence.RtTask.AnchorMin))totalHeight+=_height*3;
if(rtTask.HasFlag(Sequence.RtTask.Pivot))totalHeight+=_height*3;

totalHeight += 20;
}
else if(objectType == Sequence.ObjectType.Transform)
{
Sequence.TransTask transTask = (Sequence.TransTask)property.FindPropertyRelative("TargetTransTask").enumValueFlag;
if(transTask.HasFlag(Sequence.TransTask.LocalPosition))totalHeight+=_height*3;
if(transTask.HasFlag(Sequence.TransTask.LocalScale))totalHeight+=_height*3;
if(transTask.HasFlag(Sequence.TransTask.LocalEulerAngles))totalHeight+=_height*3;
}

totalHeight += 20;
}
else if(objectType == Sequence.ObjectType.Image)
{
Sequence.ImgTask imgTask = (Sequence.ImgTask)property.FindPropertyRelative("TargetImgTask").enumValueFlag;
Expand Down Expand Up @@ -251,8 +255,18 @@ void DrawRtTask(string name)
EditorGUI.LabelField(new Rect(nextPosition.x, nextPosition.y, nextPosition.width, _height),
new GUIContent(name)
);

nextPosition.y += _height;
if (GUI.Button(new Rect(nextPosition.x, nextPosition.y, nextPosition.width / 4 - 5, _height), "Switch"))
{
var startProp = property.FindPropertyRelative(name + "Start");
var endProp = property.FindPropertyRelative(name + "End");
Vector3 temp = startProp.vector3Value;
startProp.vector3Value = endProp.vector3Value;
endProp.vector3Value = temp;
}

nextPosition.y += _height;
if(GUI.Button(new Rect(nextPosition.x, nextPosition.y, nextPosition.width/4-5, _height),"Set Start"))
{
if(name == "AnchoredPosition")property.FindPropertyRelative(name+"Start").vector3Value =
Expand Down Expand Up @@ -297,6 +311,7 @@ void DrawRtTask(string name)
new Rect(nextPosition.x+nextPosition.width/4, nextPosition.y, nextPosition.width*3/4, _height),
property.FindPropertyRelative(name+"End"), GUIContent.none
);
nextPosition.y += _height + 20;
}
Sequence.RtTask rtTask = (Sequence.RtTask)property.FindPropertyRelative("TargetRtTask").enumValueFlag;
if(rtTask.HasFlag(Sequence.RtTask.AnchoredPosition))DrawRtTask("AnchoredPosition");
Expand All @@ -317,8 +332,18 @@ void DrawTransTask(string name)
EditorGUI.LabelField(new Rect(nextPosition.x, nextPosition.y, nextPosition.width, _height),
new GUIContent(name)
);

nextPosition.y += _height;
if (GUI.Button(new Rect(nextPosition.x, nextPosition.y, nextPosition.width / 4 - 5, _height), "Switch"))
{
var startProp = property.FindPropertyRelative(name + "Start");
var endProp = property.FindPropertyRelative(name + "End");
Vector3 temp = startProp.vector3Value;
startProp.vector3Value = endProp.vector3Value;
endProp.vector3Value = temp;
}

nextPosition.y += _height;
if(GUI.Button(new Rect(nextPosition.x, nextPosition.y, nextPosition.width/4-5, _height),"Set Start"))
{
if(name == "LocalPosition")property.FindPropertyRelative(name+"Start").vector3Value =
Expand Down Expand Up @@ -564,4 +589,4 @@ void DrawTextMeshProTask(string name)
}
}

}
}