Skip to content

Commit a6cadb9

Browse files
author
Unity Technologies
committed
Unity 2023.1.0a5 C# reference source code
1 parent dcf29f6 commit a6cadb9

173 files changed

Lines changed: 6647 additions & 1101 deletions

File tree

Some content is hidden

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

Editor/IncrementalBuildPipeline/BeeBuildProgramCommon.Data/BeeBuildProgramCommon.Data.gen.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project Sdk="Microsoft.NET.Sdk">
33
<PropertyGroup>
4+
<AssemblyName>BeeBuildProgramCommon.Data</AssemblyName>
45
<TargetFramework>netstandard2.1</TargetFramework>
56
<GenerateDocumentationFile>false</GenerateDocumentationFile>
67
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>

Editor/IncrementalBuildPipeline/PlayerBuildProgramLibrary.Data/PlayerBuildProgramLibrary.Data.gen.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project Sdk="Microsoft.NET.Sdk">
33
<PropertyGroup>
4+
<AssemblyName>PlayerBuildProgramLibrary.Data</AssemblyName>
45
<TargetFramework>netstandard2.1</TargetFramework>
56
<GenerateDocumentationFile>false</GenerateDocumentationFile>
67
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>

Editor/IncrementalBuildPipeline/ScriptCompilationBuildProgram.Data/ScriptCompilationBuildProgram.Data.gen.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project Sdk="Microsoft.NET.Sdk">
33
<PropertyGroup>
4+
<AssemblyName>ScriptCompilationBuildProgram.Data</AssemblyName>
45
<TargetFramework>netstandard2.1</TargetFramework>
56
<GenerateDocumentationFile>false</GenerateDocumentationFile>
67
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>

Editor/Mono/Animation/AnimationWindow/AnimationWindowControl.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,10 @@ private void ResampleAnimation(ResampleFlags flags)
695695
}
696696

697697
if (!m_CandidateClip.empty)
698+
{
699+
StartCandidateRecording();
698700
AnimationMode.AddCandidates(state.activeRootGameObject, m_CandidateClip);
701+
}
699702

700703
m_ClipPlayable.SetSampleRate(playing ? -1 : state.activeAnimationClip.frameRate);
701704

Editor/Mono/Animation/AnimationWindow/AnimationWindowUtility.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,6 +1018,8 @@ public static bool AddClipToAnimatorComponent(Animator animator, AnimationClip n
10181018
if (controller == null)
10191019
{
10201020
controller = UnityEditor.Animations.AnimatorController.CreateAnimatorControllerForClip(newClip, animator.gameObject);
1021+
1022+
Undo.RecordObject(animator, "Set Controller");
10211023
UnityEditor.Animations.AnimatorController.SetAnimatorController(animator, controller);
10221024

10231025
if (controller != null)

Editor/Mono/Animation/AnimatorController.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,13 @@ internal static AnimatorController CreateAnimatorControllerForClip(AnimationClip
248248
public static AnimatorController CreateAnimatorControllerAtPathWithClip(string path, AnimationClip clip)
249249
{
250250
AnimatorController controller = CreateAnimatorControllerAtPath(path);
251-
controller.AddMotion(clip);
251+
252+
AnimatorStateMachine stateMachine = controller.layers[0].stateMachine;
253+
stateMachine.pushUndo = false;
254+
var state = stateMachine.AddState(clip.name);
255+
state.motion = clip;
256+
stateMachine.pushUndo = true;
257+
252258
return controller;
253259
}
254260

Editor/Mono/Animation/BlendTree.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,6 @@ internal bool HasChild(BlendTree childTree, bool recursive)
8080

8181
internal BlendTree CreateBlendTreeChild(Vector2 position, float threshold)
8282
{
83-
Undo.RecordObject(this, "Created BlendTree Child");
84-
8583
BlendTree tree = new BlendTree();
8684
tree.name = "BlendTree";
8785
tree.hideFlags = HideFlags.HideInHierarchy;
@@ -90,6 +88,8 @@ internal BlendTree CreateBlendTreeChild(Vector2 position, float threshold)
9088

9189
Undo.RegisterCreatedObjectUndo(tree, "Blend Tree Created");
9290

91+
Undo.RecordObject(this, "Created BlendTree Child");
92+
9393
AddChild(tree, position, threshold);
9494
return tree;
9595
}

Editor/Mono/Animation/StateMachine.cs

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -473,25 +473,24 @@ public void RemoveStateMachine(AnimatorStateMachine stateMachine)
473473

474474
private AnimatorStateTransition AddAnyStateTransition()
475475
{
476-
undoHandler.DoUndo(this, "AnyState Transition Added");
477-
478-
AnimatorStateTransition[] transitionsVector = anyStateTransitions;
479476
AnimatorStateTransition newTransition = new AnimatorStateTransition();
480477
newTransition.hasExitTime = false;
481478
newTransition.hasFixedDuration = true;
482479
newTransition.duration = 0.25f;
483480
newTransition.exitTime = 0.75f;
481+
newTransition.hideFlags = HideFlags.HideInHierarchy;
484482

485483
if (AssetDatabase.GetAssetPath(this) != "")
486484
AssetDatabase.AddObjectToAsset(newTransition, AssetDatabase.GetAssetPath(this));
487485

488486
undoHandler.DoUndoCreated(newTransition, "AnyState Transition Created");
489487

490-
newTransition.hideFlags = HideFlags.HideInHierarchy;
488+
undoHandler.DoUndo(this, "AnyState Transition Added");
489+
490+
AnimatorStateTransition[] transitionsVector = anyStateTransitions;
491491
ArrayUtility.Add(ref transitionsVector, newTransition);
492492
anyStateTransitions = transitionsVector;
493493

494-
495494
return newTransition;
496495
}
497496

@@ -550,39 +549,39 @@ public AnimatorTransition AddStateMachineTransition(AnimatorStateMachine sourceS
550549

551550
public AnimatorTransition AddStateMachineTransition(AnimatorStateMachine sourceStateMachine, AnimatorStateMachine destinationStateMachine)
552551
{
553-
AnimatorTransition newTransition = new AnimatorTransition();
552+
var newTransition = new AnimatorTransition();
554553
newTransition.destinationStateMachine = destinationStateMachine;
555554
AddStateMachineTransition(sourceStateMachine, newTransition);
556555
return newTransition;
557556
}
558557

559558
public AnimatorTransition AddStateMachineTransition(AnimatorStateMachine sourceStateMachine, AnimatorState destinationState)
560559
{
561-
AnimatorTransition newTransition = new AnimatorTransition();
560+
var newTransition = new AnimatorTransition();
562561
newTransition.destinationState = destinationState;
563562
AddStateMachineTransition(sourceStateMachine, newTransition);
564563
return newTransition;
565564
}
566565

567566
internal void AddStateMachineTransition(AnimatorStateMachine sourceStateMachine, AnimatorTransition transition)
568567
{
569-
undoHandler.DoUndo(this, "StateMachine Transition Added");
570-
571-
AnimatorTransition[] transitionsVector = GetStateMachineTransitions(sourceStateMachine);
568+
transition.hideFlags = HideFlags.HideInHierarchy;
572569

573570
if (AssetDatabase.GetAssetPath(this) != "")
574571
AssetDatabase.AddObjectToAsset(transition, AssetDatabase.GetAssetPath(this));
575572

576573
undoHandler.DoUndoCreated(transition, "StateMachine Transition Created");
577574

578-
transition.hideFlags = HideFlags.HideInHierarchy;
575+
undoHandler.DoUndo(this, "StateMachine Transition Added");
576+
577+
AnimatorTransition[] transitionsVector = GetStateMachineTransitions(sourceStateMachine);
579578
ArrayUtility.Add(ref transitionsVector, transition);
580579
SetStateMachineTransitions(sourceStateMachine, transitionsVector);
581580
}
582581

583582
public AnimatorTransition AddStateMachineExitTransition(AnimatorStateMachine sourceStateMachine)
584583
{
585-
AnimatorTransition newTransition = new AnimatorTransition();
584+
var newTransition = new AnimatorTransition();
586585
newTransition.isExit = true;
587586
AddStateMachineTransition(sourceStateMachine, newTransition);
588587
return newTransition;
@@ -605,16 +604,16 @@ public bool RemoveStateMachineTransition(AnimatorStateMachine sourceStateMachine
605604

606605
private AnimatorTransition AddEntryTransition()
607606
{
608-
undoHandler.DoUndo(this, "Entry Transition Added");
609-
AnimatorTransition[] transitionsVector = entryTransitions;
610607
AnimatorTransition newTransition = new AnimatorTransition();
608+
newTransition.hideFlags = HideFlags.HideInHierarchy;
611609

612610
if (AssetDatabase.GetAssetPath(this) != "")
613611
AssetDatabase.AddObjectToAsset(newTransition, AssetDatabase.GetAssetPath(this));
614612

615613
undoHandler.DoUndoCreated(newTransition, "Entry Transition Created");
616614

617-
newTransition.hideFlags = HideFlags.HideInHierarchy;
615+
undoHandler.DoUndo(this, "Entry Transition Added");
616+
AnimatorTransition[] transitionsVector = entryTransitions;
618617
ArrayUtility.Add(ref transitionsVector, newTransition);
619618
entryTransitions = transitionsVector;
620619

Editor/Mono/AssetPipeline/TextureImporter.bindings.cs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,8 @@ namespace UnityEditor
2020
[NativeHeader("Editor/Src/EditorUserBuildSettings.h")]
2121
public sealed partial class TextureImporter : AssetImporter
2222
{
23-
private string GetFixedPlatformName(string platform)
24-
{
25-
var targetGroup = BuildPipeline.GetBuildTargetGroupByName(platform);
26-
if (targetGroup != BuildTargetGroup.Unknown)
27-
return BuildPipeline.GetBuildTargetGroupName(targetGroup);
28-
return platform;
29-
}
23+
[FreeFunction]
24+
private static extern string GetFixedPlatformName(string platform);
3025

3126
[Obsolete("textureFormat is no longer accessible at the TextureImporter level. For old 'simple' formats use the textureCompression property for the equivalent automatic choice (Uncompressed for TrueColor, Compressed and HQCommpressed for 16 bits). For platform specific formats use the [[PlatformTextureSettings]] API. Using this setter will setup various parameters to match the new automatic system as well as possible. Getter will return the last value set.")]
3227
public extern TextureImporterFormat textureFormat
@@ -98,7 +93,9 @@ public bool GetPlatformTextureSettings(string platform, out int maxTextureSize,
9893
return GetPlatformTextureSettings(platform, out maxTextureSize, out textureFormat, out compressionQuality, out etc1AlphaSplitEnabled);
9994
}
10095

101-
// C++ implementation will return default platform if the requested platform does not have any settings yet.
96+
// C++ implementation will return default platform if the requested platform is not valid.
97+
// See "Editor/Mono/BuildPipeline/BuildPlatform.cs" -> "GetValidPlatformNames" for more
98+
// information regarding what is considered to be a valid platform.
10299
[NativeName("GetPlatformTextureSettings")]
103100
private extern TextureImporterPlatformSettings GetPlatformTextureSetting_Internal(string platform);
104101

Editor/Mono/AssetPipeline/TextureImporterEnums.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,4 +382,12 @@ public enum TextureImporterSwizzle
382382
Zero = 8,
383383
One = 9
384384
}
385+
386+
// Cookie light type mode for [[TextureImporter]].
387+
internal enum TextureImporterCookieLightType
388+
{
389+
Spot = 0,
390+
Directional = 1,
391+
Point = 2
392+
}
385393
}

0 commit comments

Comments
 (0)