Skip to content

Commit f50ab75

Browse files
author
Unity Technologies
committed
Unity 2019.3.0a10 C# reference source code
1 parent 9034442 commit f50ab75

File tree

593 files changed

+23496
-8900
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

593 files changed

+23496
-8900
lines changed

Editor/Mono/2D/Common/ScriptBindings/SpriteEditorExtension.bindings.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@
33
// https://unity3d.com/legal/licenses/Unity_Reference_Only_License
44

55
using UnityEngine;
6-
using UnityEditor;
76
using UnityEngine.Bindings;
87
using UnityEngine.U2D;
98

10-
namespace UnityEditor.Experimental.U2D
9+
namespace UnityEditor.U2D
1110
{
1211
[NativeHeader("Editor/Src/2D/SpriteEditorExtension.h")]
1312
public static class SpriteEditorExtension

Editor/Mono/Animation/AnimationMode.bindings.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,15 @@ internal static void StartAnimationRecording()
181181
[NativeThrows]
182182
extern internal static void RevertPropertyModificationsForObject([NotNull] Object target);
183183

184+
// Returns editor curve bindings for animation clip and animator hierarchy that need to be snapshot for animation mode.
185+
extern internal static EditorCurveBinding[] GetAllBindings([NotNull] GameObject root, [NotNull] AnimationClip clip);
186+
187+
// Returns editor curve bindings for animation clip that need to be snapshot for animation mode.
188+
extern internal static EditorCurveBinding[] GetCurveBindings([NotNull] AnimationClip clip);
189+
190+
// Return editor curve bindings for animator hierarhcy that need to be snapshot for animation mode.
191+
extern internal static EditorCurveBinding[] GetAnimatorBindings([NotNull] GameObject root);
192+
184193
extern private static bool Internal_InAnimationMode(Object driver);
185194

186195
extern private static bool Internal_InAnimationModeNoDriver();

Editor/Mono/Animation/AnimationUtility.bindings.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,19 +143,13 @@ internal static EditorCurveBinding[] GetAnimatableBindings(ScriptableObject scri
143143
return Internal_GetScriptableObjectAnimatableBindings(scriptableObject);
144144
}
145145

146-
internal static EditorCurveBinding[] GetAdditionalAnimatorBindings(GameObject targetObject)
147-
{
148-
return Internal_GetAdditionalAnimatorBindings(targetObject);
149-
}
150-
151146
internal static EditorCurveBinding[] GetAnimationStreamBindings(GameObject root)
152147
{
153148
return Internal_GetAnimationStreamBindings(root);
154149
}
155150

156151
extern private static EditorCurveBinding[] Internal_GetGameObjectAnimatableBindings([NotNull] GameObject targetObject, [NotNull] GameObject root);
157152
extern private static EditorCurveBinding[] Internal_GetScriptableObjectAnimatableBindings([NotNull] ScriptableObject scriptableObject);
158-
extern private static EditorCurveBinding[] Internal_GetAdditionalAnimatorBindings([NotNull] GameObject targetObject);
159153
extern private static EditorCurveBinding[] Internal_GetAnimationStreamBindings([NotNull] GameObject root);
160154

161155
// Binds the property and returns the type of the bound value (Can be used to display special UI for it and to enforce correct drag and drop)

Editor/Mono/Animation/AnimationWindow/AnimationWindow.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,6 @@ static bool OnOpenAsset(int instanceID, int line)
179179

180180
public bool EditGameObject(GameObject gameObject)
181181
{
182-
if (state.linkedWithSequencer == true)
183-
return false;
184-
185182
return EditGameObjectInternal(gameObject, (IAnimationWindowControl)null);
186183
}
187184

@@ -268,6 +265,9 @@ private bool ShouldUpdateGameObjectSelection(GameObjectSelectionItem selectedIte
268265
if (m_LockTracker.isLocked)
269266
return false;
270267

268+
if (state.linkedWithSequencer)
269+
return false;
270+
271271
// Selected game object with no animation player.
272272
if (selectedItem.rootGameObject == null)
273273
return true;

Editor/Mono/Animation/AnimationWindow/AnimationWindowHierarchyGUI.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -304,15 +304,6 @@ private string GetGameObjectName(GameObject rootGameObject, string path)
304304
return splits[splits.Length - 1];
305305
}
306306

307-
private string GetPathWithoutChildmostGameObject(string path)
308-
{
309-
if (string.IsNullOrEmpty(path))
310-
return "";
311-
312-
int lastIndex = path.LastIndexOf('/');
313-
return path.Substring(0, lastIndex + 1);
314-
}
315-
316307
private void DoValueField(Rect rect, AnimationWindowHierarchyNode node, int row)
317308
{
318309
bool curvesChanged = false;

Editor/Mono/Animation/AnimationWindow/AnimationWindowState.cs

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -900,15 +900,6 @@ public void SelectKey(AnimationWindowKeyframe keyframe)
900900
m_SelectionBoundsCache = null;
901901
}
902902

903-
public void SelectKeysFromDopeline(DopeLine dopeline)
904-
{
905-
if (dopeline == null)
906-
return;
907-
908-
foreach (var key in dopeline.keys)
909-
SelectKey(key);
910-
}
911-
912903
public void UnselectKey(AnimationWindowKeyframe keyframe)
913904
{
914905
int hash = keyframe.GetHash();
@@ -919,15 +910,6 @@ public void UnselectKey(AnimationWindowKeyframe keyframe)
919910
m_SelectionBoundsCache = null;
920911
}
921912

922-
public void UnselectKeysFromDopeline(DopeLine dopeline)
923-
{
924-
if (dopeline == null)
925-
return;
926-
927-
foreach (var key in dopeline.keys)
928-
UnselectKey(key);
929-
}
930-
931913
public void DeleteSelectedKeys()
932914
{
933915
if (selectedKeys.Count == 0)
@@ -1546,18 +1528,6 @@ public HashSet<int> GetAffectedHierarchyIDs(List<AnimationWindowKeyframe> keyfra
15461528
return hierarchyIDs;
15471529
}
15481530

1549-
public List<DopeLine> GetAffectedDopelines(List<AnimationWindowKeyframe> keyframes)
1550-
{
1551-
List<DopeLine> affectedDopelines = new List<DopeLine>();
1552-
1553-
foreach (AnimationWindowCurve curve in GetAffectedCurves(keyframes))
1554-
foreach (DopeLine dopeline in dopelines)
1555-
if (!affectedDopelines.Contains(dopeline) && dopeline.curves.Contains(curve))
1556-
affectedDopelines.Add(dopeline);
1557-
1558-
return affectedDopelines;
1559-
}
1560-
15611531
public List<AnimationWindowCurve> GetAffectedCurves(List<AnimationWindowKeyframe> keyframes)
15621532
{
15631533
List<AnimationWindowCurve> affectedCurves = new List<AnimationWindowCurve>();

Editor/Mono/Animation/AnimationWindow/AnimationWindowStyles.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ internal class AnimationWindowStyles
2222
public static GUIContent addKeyframeContent = EditorGUIUtility.TrIconContent("Animation.AddKeyframe", "Add keyframe.");
2323
public static GUIContent addEventContent = EditorGUIUtility.TrIconContent("Animation.AddEvent", "Add event.");
2424
public static GUIContent filterBySelectionContent = EditorGUIUtility.TrIconContent("Animation.FilterBySelection", "Filter by selection.");
25-
public static GUIContent sequencerLinkContent = EditorGUIUtility.TrIconContent("Animation.SequencerLink", "Animation Window is linked to Sequence Editor. Press to Unlink.");
25+
public static GUIContent sequencerLinkContent = EditorGUIUtility.TrIconContent("Animation.SequencerLink", "Animation Window is linked to Timeline Editor. Press to Unlink.");
2626

2727
public static GUIContent noAnimatableObjectSelectedText = EditorGUIUtility.TrTextContent("No animatable object selected.");
2828
public static GUIContent formatIsMissing = EditorGUIUtility.TrTextContent("To begin animating {0}, create {1}.");

Editor/Mono/Animation/AnimationWindow/CurveEditor.cs

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1326,21 +1326,6 @@ void DragTangents()
13261326
}
13271327
}
13281328

1329-
struct KeyFrameCopy
1330-
{
1331-
public float time, value, inTangent, outTangent;
1332-
public int idx, selectionIdx;
1333-
public KeyFrameCopy(int idx, int selectionIdx, Keyframe source)
1334-
{
1335-
this.idx = idx;
1336-
this.selectionIdx = selectionIdx;
1337-
time = source.time;
1338-
value = source.value;
1339-
inTangent = source.inTangent;
1340-
outTangent = source.outTangent;
1341-
}
1342-
}
1343-
13441329
internal void DeleteSelectedKeys()
13451330
{
13461331
string undoLabel;
@@ -2882,7 +2867,7 @@ public Vector2 MovePoints()
28822867
}
28832868

28842869
// Curve dragging. Moving keys has highest priority, therefore we check curve/region dragging AFTER key dragging above
2885-
if (settings.allowDraggingCurvesAndRegions && m_DraggingKey == null)
2870+
if (evt.shift && settings.allowDraggingCurvesAndRegions && m_DraggingKey == null)
28862871
{
28872872
// We use the logic as for moving keys when we drag entire curves or regions: We just
28882873
// select all keyFrames in a curve or region before dragging and ensure to hide tangents when drawing.

Editor/Mono/Animation/AnimationWindow/DopeSheetEditor.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -394,11 +394,6 @@ private void RectangleToolGUI()
394394
m_RectangleTool.OnGUI();
395395
}
396396

397-
private void DrawGrid(Rect position)
398-
{
399-
TimeRuler(position, state.frameRate, false, true, 0.2f);
400-
}
401-
402397
public void DrawMasterDopelineBackground(Rect position)
403398
{
404399
if (Event.current.type != EventType.Repaint)

Editor/Mono/Animation/AnimationWindow/DopeSheetEditorRectangleTool.cs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,13 @@
33
// https://unity3d.com/legal/licenses/Unity_Reference_Only_License
44

55
using UnityEngine;
6-
using UnityEditor;
76
using UnityEditorInternal;
8-
using System.Collections;
97
using System.Collections.Generic;
10-
using System.Linq;
118

129
namespace UnityEditor
1310
{
1411
internal class DopeSheetEditorRectangleTool : RectangleTool
1512
{
16-
const float kDefaultFrameRate = 60f;
17-
1813
const int kScaleLeftWidth = 17;
1914
const int kScaleLeftMarginHorizontal = 0;
2015
const float kScaleLeftMarginVertical = 4;
@@ -382,14 +377,6 @@ private void OnScaleTime(float time)
382377
TransformKeys(transform, flipX, false);
383378
}
384379

385-
private void OnScaleValue(float val)
386-
{
387-
Matrix4x4 transform;
388-
bool flipY;
389-
if (CalculateScaleValueMatrix(m_Previous.y, val, m_MouseOffset.y, m_Pivot.y, out transform, out flipY))
390-
TransformKeys(transform, false, flipY);
391-
}
392-
393380
private void OnEndScale()
394381
{
395382
m_State.EndLiveEdit();

0 commit comments

Comments
 (0)