-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
57 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,8 +82,13 @@ public override VisualElement CreateInspectorGUI() | |
"This component requires a CinemachineSplineDolly component referencing a nonempty Spline", | ||
HelpBoxMessageType.Warning); | ||
ux.Add(invalidHelp); | ||
var toolButton = ux.AddChild(new Button(() => ToolManager.SetActiveTool(typeof(LookAtDataOnSplineTool))) | ||
{ text = "Edit Targets in Scene View" }); | ||
|
||
var tooltip = "Use the Scene View tool to Edit the LookAt targets on the spline"; | ||
var buttonRow = ux.AddChild(new InspectorUtility.LabeledRow("Edit in Scene View", tooltip)); | ||
var toolButton = buttonRow.Contents.AddChild( | ||
CinemachineSceneToolHelpers.CreateSceneToolActivationButtonForInspector( | ||
typeof(LookAtDataOnSplineTool), LookAtDataOnSplineTool.IconPath, tooltip)); | ||
|
||
ux.TrackAnyUserActivity(() => | ||
{ | ||
var haveSpline = splineData != null && splineData.GetGetSplineAndDolly(out _, out _); | ||
|
@@ -309,11 +314,13 @@ class LookAtDataOnSplineTool : EditorTool | |
public static Action<CinemachineSplineDollyLookAtTargets, int> s_OnDataIndexDragged; | ||
public static Action<CinemachineSplineDollyLookAtTargets, int> s_OnDataLookAtDragged; | ||
|
||
public static string IconPath => $"{CinemachineSceneToolHelpers.IconPath}/[email protected]"; | ||
|
||
void OnEnable() | ||
{ | ||
m_IconContent = new () | ||
{ | ||
image = AssetDatabase.LoadAssetAtPath<Texture2D>($"{CinemachineSceneToolHelpers.IconPath}/[email protected]"), | ||
image = AssetDatabase.LoadAssetAtPath<Texture2D>(IconPath), | ||
tooltip = "Assign LookAt targets to positions on the spline." | ||
}; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,9 +21,13 @@ public override VisualElement CreateInspectorGUI() | |
"This component should be associated with a non-empty spline", | ||
HelpBoxMessageType.Warning); | ||
ux.Add(invalidHelp); | ||
var toolButton = ux.AddChild(new Button(() => ToolManager.SetActiveTool(typeof(SplineRollTool))) | ||
{ text = "Edit Data Points in Scene View" }); | ||
|
||
var tooltip = "Use the Scene View tool to adjust the roll data points"; | ||
var buttonRow = ux.AddChild(new InspectorUtility.LabeledRow("Edit in Scene View", tooltip)); | ||
var toolButton = buttonRow.Contents.AddChild( | ||
CinemachineSceneToolHelpers.CreateSceneToolActivationButtonForInspector( | ||
typeof(SplineRollTool), SplineRollTool.IconPath, tooltip)); | ||
|
||
ux.TrackAnyUserActivity(() => | ||
{ | ||
var haveSpline = splineData != null && splineData.SplineContainer != null; | ||
|
@@ -244,11 +248,13 @@ sealed class SplineRollTool : EditorTool | |
public static Action<CinemachineSplineRoll, int> s_OnDataIndexDragged; | ||
public static Action<CinemachineSplineRoll, int> s_OnDataLookAtDragged; | ||
|
||
public static string IconPath => $"{CinemachineSceneToolHelpers.IconPath}/[email protected]"; | ||
|
||
void OnEnable() | ||
{ | ||
m_IconContent = new GUIContent | ||
{ | ||
image = AssetDatabase.LoadAssetAtPath<Texture2D>($"{CinemachineSceneToolHelpers.IconPath}/[email protected]"), | ||
image = AssetDatabase.LoadAssetAtPath<Texture2D>(IconPath), | ||
tooltip = "Adjust the roll data points along the spline" | ||
}; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters