-
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.
Browse files
Browse the repository at this point in the history
* add CinemachineVirtualCameraBaseEditor * use [ChildCameraPropertyAttribute], layout tweaks * layout tweaking for inspectors * update doc * update samples * Update package.json * Update SimplePlayerAnimator.cs * Update SimplePlayerAnimator.cs * Make sure object is selected when activating tool
- Loading branch information
Showing
27 changed files
with
280 additions
and
204 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
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
12 changes: 11 additions & 1 deletion
12
com.unity.cinemachine/Documentation~/CinemachineSplineRoll.md
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 |
---|---|---|
@@ -1,6 +1,16 @@ | ||
# Cinemachine Spline Roll | ||
|
||
![Spline Roll Inspector](images/CinemachineSplineRollInspector.png) | ||
|
||
This behavior adds Roll to a Spline. Roll is the rotation about the spline's tangent. Add data points to set the roll at specific points along the spline. Roll will be interpolated between those points. This behavior will also draw a railroad-track Gizmo in the Scene view, to help visualize the roll. | ||
|
||
If you add this behavior to the Spline itself, then any [Cm Camera](CinemachineCamera.md) or [Cinemachine Spline Cart](CinemachineSplineCart.md) that follows the path will respect the roll. If instead you add this behavior to the CinemachineCamera itself, then the roll will be visible only to that CinemachineCamera. | ||
If you add this behavior to the Spline itself, then any [Cinemachine Camera](CinemachineCamera.md) or [Cinemachine Spline Cart](CinemachineSplineCart.md) that follows the path will respect the roll. If instead you add this behavior to the CinemachineCamera itself, then the roll will be visible only to that CinemachineCamera. | ||
|
||
### Properties | ||
|
||
| Property | Field | Description | | ||
| --- | --- | --- | | ||
| __Index Unit__ | | Defines how to interpret the _Index_ field for each data point. _Knot_ is the recommended value because it remains robust if the spline points change. | | ||
| __Data Points__ | | The list of Roll points on the spline. At these postions on the spline, it will take on the specified roll value. | | ||
| | _Index_ | The position on the Spline where it should assume the specified roll. The value is interpreted according to the _Index Unit_ setting. | | ||
| | _Roll_ | The roll value for the spline. This is specified in degrees, and the axis of rotation is the spline tangent at that point. | |
Binary file added
BIN
+22.1 KB
com.unity.cinemachine/Documentation~/images/CinemachineSplineRollInspector.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+42.3 KB
com.unity.cinemachine/Documentation~/images/SplineDollyLookAtTargetsInspector.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
24 changes: 0 additions & 24 deletions
24
com.unity.cinemachine/Editor/Editors/CinemachineExternalCameraEditor.cs
This file was deleted.
Oops, something went wrong.
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
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), target, 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), target, 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" | ||
}; | ||
} | ||
|
Oops, something went wrong.