Skip to content

Commit 69bc09e

Browse files
author
Unity Technologies
committed
Unity 2017.2.0b1 C# reference source code
1 parent 6811906 commit 69bc09e

File tree

225 files changed

+9662
-2400
lines changed

Some content is hidden

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

225 files changed

+9662
-2400
lines changed

Editor/Mono/2D/SpriteAtlas/SpriteAtlasInspector.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ private enum AtlasType { Undefined = -1, Master = 0, Variant = 1 }
130130

131131
static bool IsPackable(Object o)
132132
{
133-
return o != null && (o.GetType() == typeof(Sprite) || o.GetType() == typeof(DefaultAsset) || o.GetType() == typeof(Texture2D));
133+
return o != null && (o.GetType() == typeof(Sprite) || o.GetType() == typeof(Texture2D) || (o.GetType() == typeof(DefaultAsset) && ProjectWindowUtil.IsFolder(o.GetInstanceID())));
134134
}
135135

136136
static Object ValidateObjectForPackableFieldAssignment(Object[] references, System.Type objType, SerializedProperty property, EditorGUI.ObjectFieldValidatorOptions options)
@@ -239,6 +239,7 @@ void SyncPlatformSettings()
239239
void AddPackable(ReorderableList list)
240240
{
241241
ObjectSelector.get.Show(null, typeof(Object), null, false);
242+
ObjectSelector.get.searchFilter = "t:sprite t:texture2d t:folder";
242243
ObjectSelector.get.objectSelectorID = s_Styles.packableSelectorHash;
243244
}
244245

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// Unity C# reference source
2+
// Copyright (c) Unity Technologies. For terms of use, see
3+
// https://unity3d.com/legal/licenses/Unity_Reference_Only_License
4+
5+
using System;
6+
7+
namespace UnityEditor.Accessibility
8+
{
9+
internal enum ColorBlindCondition
10+
{
11+
Default,
12+
Deuteranopia,
13+
Protanopia,
14+
Tritanopia,
15+
}
16+
17+
// NOTE: The preferences in this class are currently only exposed via a context menu in the ProfilerWindow
18+
// these toggles need to instead be moved to e.g., the Preferences menu before they are used elsewhere
19+
internal static class UserAccessiblitySettings
20+
{
21+
static UserAccessiblitySettings()
22+
{
23+
s_ColorBlindCondition = (ColorBlindCondition)EditorPrefs.GetInt(k_ColorBlindConditionPrefKey, (int)ColorBlindCondition.Default);
24+
}
25+
26+
private const string k_ColorBlindConditionPrefKey = "AccessibilityColorBlindCondition";
27+
28+
public static ColorBlindCondition colorBlindCondition
29+
{
30+
get { return s_ColorBlindCondition; }
31+
set
32+
{
33+
if (s_ColorBlindCondition != value)
34+
{
35+
s_ColorBlindCondition = value;
36+
EditorPrefs.SetInt(k_ColorBlindConditionPrefKey, (int)value);
37+
if (colorBlindConditionChanged != null)
38+
colorBlindConditionChanged();
39+
}
40+
}
41+
}
42+
private static ColorBlindCondition s_ColorBlindCondition;
43+
44+
public static Action colorBlindConditionChanged;
45+
}
46+
}

Editor/Mono/Animation/AnimationWindow/AnimationRecording.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,8 @@ static public UndoPropertyModification[] ProcessModifications(IAnimationRecordin
346346
{
347347
// TODO@mecanim keyframing of transform driven by an animator is disabled until we can figure out
348348
// how to rebind partially a controller at each sampling.
349-
if (animator != null && animator.isHuman && binding.type == typeof(Transform) && animator.IsBoneTransform(prop.target as Transform))
349+
if (animator != null && animator.isHuman && binding.type == typeof(Transform)
350+
&& animator.gameObject.transform != prop.target && animator.IsBoneTransform(prop.target as Transform))
350351
{
351352
Debug.LogWarning("Keyframing for humanoid rig is not supported!", prop.target as Transform);
352353
continue;

Editor/Mono/Annotation/SceneRenderModeWindow.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ public enum DrawCameraMode
6363
BakedTexelValidity = 28,
6464
BakedIndices = 29,
6565
BakedCharting = 30,
66-
6766
SpriteMask = 31,
6867
}
6968

Editor/Mono/AssetPipeline/ModelImporter.bindings.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -800,5 +800,16 @@ public void CreateDefaultMaskForClip(ModelImporterClipAnimation clip)
800800
else
801801
Debug.LogError("Cannot create default mask because the current importer doesn't have any animation information");
802802
}
803+
804+
[NativeName("ExtractTextures")]
805+
private extern bool ExtractTexturesInternal(string folderPath);
806+
807+
public bool ExtractTextures(string folderPath)
808+
{
809+
if (string.IsNullOrEmpty(folderPath))
810+
throw new ArgumentException("The path cannot be empty", folderPath);
811+
812+
return ExtractTexturesInternal(folderPath);
813+
}
803814
}
804815
}

0 commit comments

Comments
 (0)