Skip to content

Commit d81d0a5

Browse files
author
Unity Technologies
committed
Unity 2021.2.0b1 C# reference source code
1 parent cdbef0c commit d81d0a5

File tree

63 files changed

+1263
-855
lines changed

Some content is hidden

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

63 files changed

+1263
-855
lines changed

Editor/IncrementalBuildPipeline/ScriptCompilationBuildProgram.Data/Data.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public class AssemblyData
3939
public string[] BclDirectories = new string[0];
4040
public string[] CustomCompilerOptions = new string[0];
4141
public int DebugIndex;
42+
public bool SkipCodeGen;
4243
}
4344

4445
public class ScriptCompilationData_Out

Editor/Mono/Animation/AnimatorController.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ public void AddLayer(string name)
6060
if (AssetDatabase.GetAssetPath(this) != "")
6161
AssetDatabase.AddObjectToAsset(newLayer.stateMachine, AssetDatabase.GetAssetPath(this));
6262

63+
undoHandler.DoUndoCreated(newLayer.stateMachine, "Layer added");
64+
6365
AddLayer(newLayer);
6466
}
6567

@@ -195,6 +197,8 @@ public AnimatorState CreateBlendTreeInController(string name, out BlendTree tree
195197
if (AssetDatabase.GetAssetPath(this) != "")
196198
AssetDatabase.AddObjectToAsset(tree, AssetDatabase.GetAssetPath(this));
197199

200+
undoHandler.DoUndoCreated(tree, "Blend Tree Created");
201+
198202
AnimatorState state = layers[layerIndex].stateMachine.AddState(tree.name);
199203
state.motion = tree;
200204
return state;

Editor/Mono/Animation/BlendTree.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ internal BlendTree CreateBlendTreeChild(Vector2 position, float threshold)
8888
if (AssetDatabase.GetAssetPath(this) != "")
8989
AssetDatabase.AddObjectToAsset(tree, AssetDatabase.GetAssetPath(this));
9090

91+
Undo.RegisterCreatedObjectUndo(tree, "Blend Tree Created");
92+
9193
AddChild(tree, position, threshold);
9294
return tree;
9395
}

Editor/Mono/Animation/MaterialAnimationUtility.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,13 @@ static public bool OverridePropertyColor(MaterialProperty materialProp, Renderer
9494
propertyPaths.Add(basePropertyPath + ".b");
9595
propertyPaths.Add(basePropertyPath + ".a");
9696
}
97+
else if (materialProp.type == MaterialProperty.PropType.Vector)
98+
{
99+
propertyPaths.Add(basePropertyPath + ".x");
100+
propertyPaths.Add(basePropertyPath + ".y");
101+
propertyPaths.Add(basePropertyPath + ".z");
102+
propertyPaths.Add(basePropertyPath + ".w");
103+
}
97104
else
98105
{
99106
propertyPaths.Add(basePropertyPath);

Editor/Mono/Animation/StateMachine.cs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ public void DoUndo(Object target, string undoOperation)
2727
impl.DoUndo(target, undoOperation);
2828
}
2929

30+
public void DoUndoCreated(Object target, string undoOperation)
31+
{
32+
impl.DoUndoCreated(target, undoOperation);
33+
}
34+
3035
PushUndoIfNeededImpl impl
3136
{
3237
get
@@ -54,6 +59,14 @@ public void DoUndo(Object target, string undoOperation)
5459
}
5560
}
5661

62+
public void DoUndoCreated(Object target, string undoOperation)
63+
{
64+
if (m_PushUndo)
65+
{
66+
Undo.RegisterCreatedObjectUndo(target, undoOperation);
67+
}
68+
}
69+
5770
public bool m_PushUndo;
5871
}
5972
}
@@ -128,6 +141,8 @@ private AnimatorStateTransition CreateTransition(bool setDefaultExitTime)
128141
AssetDatabase.AddObjectToAsset(newTransition, AssetDatabase.GetAssetPath(this));
129142
newTransition.hideFlags = HideFlags.HideInHierarchy;
130143

144+
undoHandler.DoUndoCreated(newTransition, "Transition Created");
145+
131146
if (setDefaultExitTime)
132147
SetDefaultTransitionExitTime(ref newTransition);
133148

@@ -377,6 +392,8 @@ public AnimatorState AddState(string name, Vector3 position)
377392
if (AssetDatabase.GetAssetPath(this) != "")
378393
AssetDatabase.AddObjectToAsset(state, AssetDatabase.GetAssetPath(this));
379394

395+
undoHandler.DoUndoCreated(state, "State Created");
396+
380397
AddState(state, position);
381398

382399
return state;
@@ -392,6 +409,7 @@ public void AddState(AnimatorState state, Vector3 position)
392409
}
393410

394411
undoHandler.DoUndo(this, "State added");
412+
395413
ChildAnimatorState newState = new ChildAnimatorState();
396414
newState.state = state;
397415
newState.position = position;
@@ -423,6 +441,8 @@ public AnimatorStateMachine AddStateMachine(string name, Vector3 position)
423441
if (AssetDatabase.GetAssetPath(this) != "")
424442
AssetDatabase.AddObjectToAsset(stateMachine, AssetDatabase.GetAssetPath(this));
425443

444+
undoHandler.DoUndoCreated(stateMachine, "StateMachine Created");
445+
426446
return stateMachine;
427447
}
428448

@@ -465,6 +485,8 @@ private AnimatorStateTransition AddAnyStateTransition()
465485
if (AssetDatabase.GetAssetPath(this) != "")
466486
AssetDatabase.AddObjectToAsset(newTransition, AssetDatabase.GetAssetPath(this));
467487

488+
undoHandler.DoUndoCreated(newTransition, "AnyState Transition Created");
489+
468490
newTransition.hideFlags = HideFlags.HideInHierarchy;
469491
ArrayUtility.Add(ref transitionsVector, newTransition);
470492
anyStateTransitions = transitionsVector;
@@ -551,6 +573,8 @@ internal void AddStateMachineTransition(AnimatorStateMachine sourceStateMachine,
551573
if (AssetDatabase.GetAssetPath(this) != "")
552574
AssetDatabase.AddObjectToAsset(transition, AssetDatabase.GetAssetPath(this));
553575

576+
undoHandler.DoUndoCreated(transition, "StateMachine Transition Created");
577+
554578
transition.hideFlags = HideFlags.HideInHierarchy;
555579
ArrayUtility.Add(ref transitionsVector, transition);
556580
SetStateMachineTransitions(sourceStateMachine, transitionsVector);
@@ -588,6 +612,8 @@ private AnimatorTransition AddEntryTransition()
588612
if (AssetDatabase.GetAssetPath(this) != "")
589613
AssetDatabase.AddObjectToAsset(newTransition, AssetDatabase.GetAssetPath(this));
590614

615+
undoHandler.DoUndoCreated(newTransition, "Entry Transition Created");
616+
591617
newTransition.hideFlags = HideFlags.HideInHierarchy;
592618
ArrayUtility.Add(ref transitionsVector, newTransition);
593619
entryTransitions = transitionsVector;

0 commit comments

Comments
 (0)