Skip to content

Commit 0c8e9ce

Browse files
author
Unity Technologies
committed
Unity 2017.2.0a3 C# reference source code
1 parent 0c33b10 commit 0c8e9ce

File tree

48 files changed

+419
-144
lines changed

Some content is hidden

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

48 files changed

+419
-144
lines changed

Editor/Mono/Annotation/LayerVisibilityWindow.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ private void CalcValidLayers()
6262
var s = InternalEditorUtility.GetLayerName(i);
6363
if (s == string.Empty)
6464
continue;
65-
s_LayerNames.Add(s);
65+
s_LayerNames.Add(string.Format("{0}: {1}", i, s));
6666
s_LayerMasks.Add(i);
6767
m_AllLayersMask |= (1 << i);
6868
}

Editor/Mono/AssemblyInfo/AssemblyInfo.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
[assembly: InternalsVisibleTo("Assembly-CSharp-Editor-firstpass-testable")]
4949
[assembly: InternalsVisibleTo("Assembly-CSharp-Editor-testable")]
5050
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")]
51+
[assembly: InternalsVisibleTo("UnityEditor.InteractiveTutorialsFramework")]
5152

5253

5354
[assembly: AssemblyIsEditorAssembly]

Editor/Mono/EditorGUI.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3001,7 +3001,8 @@ internal static int LayerFieldInternal(Rect position, GUIContent label, int laye
30013001
}
30023002
}
30033003

3004-
string[] layers = InternalEditorUtility.layers;
3004+
string[] layers = InternalEditorUtility.GetLayersWithId();
3005+
30053006
ArrayUtility.Add(ref layers, "");
30063007
ArrayUtility.Add(ref layers, "Add Layer...");
30073008

Editor/Mono/EditorGUIUtility.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,5 +187,13 @@ public static implicit operator Color(SkinnedColor colorSkin)
187187
return colorSkin.color;
188188
}
189189
}
190+
191+
internal static void ShowObjectPicker<T>(Object obj, bool allowSceneObjects, string searchFilter, ObjectSelectorReceiver objectSelectorReceiver) where T : Object
192+
{
193+
System.Type objType = typeof(T);
194+
ObjectSelector.get.Show(obj, objType, null, allowSceneObjects);
195+
ObjectSelector.get.objectSelectorReceiver = objectSelectorReceiver;
196+
ObjectSelector.get.searchFilter = searchFilter;
197+
}
190198
}
191199
}

Editor/Mono/GUI/PackageImportTreeView.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using System.IO;
88
using System.Linq;
99
using UnityEditor.IMGUI.Controls;
10+
using UnityEditor.Utils;
1011
using UnityEngine;
1112
using UnityEditorInternal;
1213

@@ -545,8 +546,8 @@ public override void FetchData()
545546
if (PackageImport.HasInvalidCharInFilePath(item.destinationAssetPath))
546547
continue; // Do not add invalid paths (we already warn the user with a dialog in PackageImport.cs)
547548

548-
string filename = Path.GetFileName(item.destinationAssetPath);
549-
string folderPath = Path.GetDirectoryName(item.destinationAssetPath);
549+
string filename = Path.GetFileName(item.destinationAssetPath).ConvertSeparatorsToUnity();
550+
string folderPath = Path.GetDirectoryName(item.destinationAssetPath).ConvertSeparatorsToUnity();
550551

551552
// Ensure folders. This is for when installed packages have been moved to other folders.
552553
TreeViewItem targetFolder = EnsureFolderPath(folderPath, treeViewFolders, initExpandedState);

Editor/Mono/ImportSettings/EditorPluginImporterExtension.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public EditorProperty(GUIContent name, string key, object defaultValue)
3939
internal override void Reset(PluginImporterInspector inspector)
4040
{
4141
string valueString = inspector.importer.GetEditorData(key);
42-
ParseStringValue(valueString);
42+
ParseStringValue(inspector, valueString);
4343
}
4444

4545
internal override void Apply(PluginImporterInspector inspector)

Editor/Mono/Inspector/ClothInspector.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,11 @@ bool SelectionMeshDirty()
159159

160160
void GenerateSelectionMesh()
161161
{
162+
if (cloth.vertices.Length == 0)
163+
{
164+
return;
165+
}
166+
162167
SkinnedMeshRenderer smr = cloth.GetComponent<SkinnedMeshRenderer>();
163168
Vector3[] vertices = cloth.vertices;
164169

@@ -308,6 +313,11 @@ void AssignColorsToMeshArray(Color[] colors, Mesh[] meshArray)
308313

309314
void SetupSelectionMeshColors()
310315
{
316+
if (cloth.vertices.Length == 0)
317+
{
318+
return;
319+
}
320+
311321
ClothSkinningCoefficient[] coefficients = cloth.coefficients;
312322
int length = coefficients.Length;
313323
Color[] colors = new Color[length * m_MeshVerticesPerSelectionVertex];
@@ -349,6 +359,11 @@ void SetupSelectionMeshColors()
349359

350360
void SetupSelectedMeshColors()
351361
{
362+
if (cloth.vertices.Length == 0)
363+
{
364+
return;
365+
}
366+
352367
int length = cloth.coefficients.Length;
353368
Color[] colors = new Color[length * m_MeshVerticesPerSelectionVertex];
354369
for (int i = 0; i < length; i++)
@@ -944,6 +959,12 @@ private void OnPreSceneGUICallback(SceneView sceneView)
944959
if (state.ToolMode == (ToolMode)(-1))
945960
state.ToolMode = ToolMode.Select;
946961

962+
if (m_Selection == null)
963+
{
964+
GenerateSelectionMesh();
965+
SetupSelectedMeshColors();
966+
}
967+
947968
ClothSkinningCoefficient[] coefficients = cloth.coefficients;
948969
if (m_Selection.Length != coefficients.Length && m_Selection.Length != s_MaxVertices)
949970
// Recreate selection if underlying mesh has changed.

0 commit comments

Comments
 (0)