Skip to content

Commit 1af97d8

Browse files
author
Unity Technologies
committed
Unity 2019.1.0a5 C# reference source code
1 parent e8a5c67 commit 1af97d8

File tree

170 files changed

+3090
-1275
lines changed

Some content is hidden

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

170 files changed

+3090
-1275
lines changed

Editor/Mono/2D/SpriteEditorModule/SpriteFrameModule/SpriteFrameModule.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public SpriteFrameModule spriteFrameModule
5353
}
5454

5555
[FormerlyPrefKeyAs("Sprite Editor/Trim", "#t")]
56-
[Shortcut("Sprite Editor/Trim", typeof(SpriteFrameModuleContext), "#t")]
56+
[Shortcut("Sprite Editor/Trim", typeof(SpriteFrameModuleContext), KeyCode.T, ShortcutModifiers.Shift)]
5757
static void ShortcutTrim(ShortcutArguments args)
5858
{
5959
if (!string.IsNullOrEmpty(GUI.GetNameOfFocusedControl()))

Editor/Mono/Animation/AnimationClipStats.bindings.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ namespace UnityEditor
1616
internal struct AnimationClipStats
1717
{
1818
public int size;
19+
public int clips;
1920
public int positionCurves;
2021
public int quaternionCurves;
2122
public int eulerCurves;
@@ -31,6 +32,7 @@ internal struct AnimationClipStats
3132
public void Reset()
3233
{
3334
size = 0;
35+
clips = 0;
3436
positionCurves = 0;
3537
quaternionCurves = 0;
3638
eulerCurves = 0;
@@ -47,6 +49,7 @@ public void Reset()
4749
public void Combine(AnimationClipStats other)
4850
{
4951
size += other.size;
52+
clips += other.clips;
5053
positionCurves += other.positionCurves;
5154
quaternionCurves += other.quaternionCurves;
5255
eulerCurves += other.eulerCurves;

Editor/Mono/Animation/AnimationMode.bindings.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using UnityEngine.Bindings;
77
using UnityEngine.Scripting;
88
using UnityEngine.Scripting.APIUpdating;
9+
using UnityEngine.Playables;
910
using UnityEngine;
1011

1112
using Object = UnityEngine.Object;
@@ -127,6 +128,9 @@ internal static void StartAnimationRecording()
127128
[NativeThrows]
128129
extern internal static void AddCandidate(EditorCurveBinding binding, PropertyModification modification, bool keepPrefabOverride);
129130

131+
[NativeThrows]
132+
extern internal static void AddCandidates([NotNull] GameObject gameObject, [NotNull] AnimationClip clip);
133+
130134
extern internal static void StopCandidateRecording();
131135

132136
extern internal static bool IsRecordingCandidates();
@@ -143,6 +147,9 @@ internal static void StartAnimationRecording()
143147
[NativeThrows]
144148
extern internal static void SampleCandidateClip([NotNull] GameObject gameObject, [NotNull] AnimationClip clip, float time);
145149

150+
[NativeThrows]
151+
extern internal static void SamplePlayableGraph([NotNull] GameObject gameObject, PlayableGraph graph, int index, float time);
152+
146153
[NativeThrows]
147154
extern public static void AddPropertyModification(EditorCurveBinding binding, PropertyModification modification, bool keepPrefabOverride);
148155

Editor/Mono/Animation/AnimationUtility.bindings.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,10 @@ public static void SetGenerateMotionCurves(AnimationClip clip, bool value)
387387

388388
extern internal static Vector3 GetClosestEuler(Quaternion q, Vector3 eulerHint, RotationOrder rotationOrder);
389389

390+
[NativeHeader("Modules/Animation/AnimationUtility.h")]
391+
[FreeFunction]
392+
extern internal static void SampleEulerHint([NotNull] GameObject go, [NotNull] AnimationClip clip, float inTime, WrapMode wrapMode);
393+
390394
[Obsolete("Use AnimationMode.InAnimationMode instead.")]
391395
static public bool InAnimationMode()
392396
{

Editor/Mono/Animation/AnimationWindow/AnimEditor.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -746,14 +746,14 @@ static void ExecuteShortcut(ShortcutArguments args, Action<IAnimationWindowContr
746746
}
747747

748748
[FormerlyPrefKeyAs("Animation/Show Curves", "c")]
749-
[Shortcut("Animation/Show Curves", typeof(AnimationShortcutContex), "c")]
749+
[Shortcut("Animation/Show Curves", typeof(AnimationShortcutContex), KeyCode.C)]
750750
static void ShowCurves(ShortcutArguments args)
751751
{
752752
ExecuteShortcut(args, animEditor => { animEditor.SwitchBetweenCurvesAndDopesheet(); });
753753
}
754754

755755
[FormerlyPrefKeyAs("Animation/Play Animation", " ")]
756-
[Shortcut("Animation/Play Animation", typeof(AnimationShortcutContex), " ")]
756+
[Shortcut("Animation/Play Animation", typeof(AnimationShortcutContex), KeyCode.Space)]
757757
static void TogglePlayAnimation(ShortcutArguments args)
758758
{
759759
ExecuteShortcut(args, controlInterface =>
@@ -766,49 +766,49 @@ static void TogglePlayAnimation(ShortcutArguments args)
766766
}
767767

768768
[FormerlyPrefKeyAs("Animation/Next Frame", ".")]
769-
[Shortcut("Animation/Next Frame", typeof(AnimationShortcutContex), ".")]
769+
[Shortcut("Animation/Next Frame", typeof(AnimationShortcutContex), KeyCode.Period)]
770770
static void NextFrame(ShortcutArguments args)
771771
{
772772
ExecuteShortcut(args, controlInterface => controlInterface.GoToNextFrame());
773773
}
774774

775775
[FormerlyPrefKeyAs("Animation/Previous Frame", ",")]
776-
[Shortcut("Animation/Previous Frame", typeof(AnimationShortcutContex), ",")]
776+
[Shortcut("Animation/Previous Frame", typeof(AnimationShortcutContex), KeyCode.Comma)]
777777
static void PreviousFrame(ShortcutArguments args)
778778
{
779779
ExecuteShortcut(args, controlInterface => controlInterface.GoToPreviousFrame());
780780
}
781781

782782
[FormerlyPrefKeyAs("Animation/Previous Keyframe", "&,")]
783-
[Shortcut("Animation/Previous Keyframe", typeof(AnimationShortcutContex), "&,")]
783+
[Shortcut("Animation/Previous Keyframe", typeof(AnimationShortcutContex), KeyCode.Comma, ShortcutModifiers.Alt)]
784784
static void PreviousKeyFrame(ShortcutArguments args)
785785
{
786786
ExecuteShortcut(args, controlInterface => controlInterface.GoToPreviousKeyframe());
787787
}
788788

789789
[FormerlyPrefKeyAs("Animation/Next Keyframe", "&.")]
790-
[Shortcut("Animation/Next Keyframe", typeof(AnimationShortcutContex), "&.")]
790+
[Shortcut("Animation/Next Keyframe", typeof(AnimationShortcutContex), KeyCode.Period, ShortcutModifiers.Alt)]
791791
static void NextKeyFrame(ShortcutArguments args)
792792
{
793793
ExecuteShortcut(args, controlInterface => controlInterface.GoToNextKeyframe());
794794
}
795795

796796
[FormerlyPrefKeyAs("Animation/First Keyframe", "#,")]
797-
[Shortcut("Animation/First Keyframe", typeof(AnimationShortcutContex), "#,")]
797+
[Shortcut("Animation/First Keyframe", typeof(AnimationShortcutContex), KeyCode.Comma, ShortcutModifiers.Shift)]
798798
static void FirstKeyFrame(ShortcutArguments args)
799799
{
800800
ExecuteShortcut(args, controlInterface => controlInterface.GoToFirstKeyframe());
801801
}
802802

803803
[FormerlyPrefKeyAs("Animation/Last Keyframe", "#.")]
804-
[Shortcut("Animation/Last Keyframe", typeof(AnimationShortcutContex), "#.")]
804+
[Shortcut("Animation/Last Keyframe", typeof(AnimationShortcutContex), KeyCode.Period, ShortcutModifiers.Shift)]
805805
static void LastKeyFrame(ShortcutArguments args)
806806
{
807807
ExecuteShortcut(args, controlInterface => controlInterface.GoToLastKeyframe());
808808
}
809809

810810
[FormerlyPrefKeyAs("Animation/Key Selected", "k")]
811-
[Shortcut("Animation/Key Selected", typeof(AnimationShortcutContex), "k")]
811+
[Shortcut("Animation/Key Selected", typeof(AnimationShortcutContex), KeyCode.K)]
812812
static void KeySelected(ShortcutArguments args)
813813
{
814814
var animEditorContext = (AnimationShortcutContex)args.context;
@@ -827,7 +827,7 @@ static void KeySelected(ShortcutArguments args)
827827
}
828828

829829
[FormerlyPrefKeyAs("Animation/Key Modified", "#k")]
830-
[Shortcut("Animation/Key Modified", typeof(AnimationShortcutContex), "#k")]
830+
[Shortcut("Animation/Key Modified", typeof(AnimationShortcutContex), KeyCode.K, ShortcutModifiers.Shift)]
831831
static void KeyModified(ShortcutArguments args)
832832
{
833833
var animEditorContext = (AnimationShortcutContex)args.context;

Editor/Mono/Animation/AnimationWindow/AnimationRecording.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -663,9 +663,9 @@ static private void ProcessAnimatorModifications(IAnimationRecordingState state,
663663

664664
discardListPos.Add(item.Key);
665665
}
666-
else if (applyRootMotion)
666+
else if (applyRootMotion && isRootTransform)
667667
{
668-
Vector3 scale = target.localScale * (isHuman ? animator.humanScale : 1);
668+
Vector3 scale = root.transform.localScale * (isHuman ? animator.humanScale : 1);
669669

670670
ProcessVector3Modification(state, binding, m.x, target, "x", scale.x);
671671
ProcessVector3Modification(state, binding, m.y, target, "y", scale.y);

Editor/Mono/Animation/AnimationWindow/AnimationWindow.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
using System;
66
using UnityEngine;
7-
using UnityEngine.Profiling;
87
using UnityEditor;
98
using System.Collections;
109
using System.Collections.Generic;
@@ -96,10 +95,8 @@ public void OnGUI()
9695
if (m_AnimEditor == null)
9796
return;
9897

99-
Profiler.BeginSample("AnimationWindow.OnGUI");
10098
titleContent = m_AnimEditor.state.recording ? m_RecordTitleContent : m_DefaultTitleContent;
10199
m_AnimEditor.OnAnimEditorGUI(this, position);
102-
Profiler.EndSample();
103100
}
104101

105102
public void OnSelectionChange()

0 commit comments

Comments
 (0)