Skip to content

Commit

Permalink
Unity 2017.2.0b1 C# reference source code
Browse files Browse the repository at this point in the history
  • Loading branch information
Unity Technologies committed Jun 29, 2017
1 parent 6811906 commit 69bc09e
Show file tree
Hide file tree
Showing 225 changed files with 9,662 additions and 2,400 deletions.
3 changes: 2 additions & 1 deletion Editor/Mono/2D/SpriteAtlas/SpriteAtlasInspector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ private enum AtlasType { Undefined = -1, Master = 0, Variant = 1 }

static bool IsPackable(Object o)
{
return o != null && (o.GetType() == typeof(Sprite) || o.GetType() == typeof(DefaultAsset) || o.GetType() == typeof(Texture2D));
return o != null && (o.GetType() == typeof(Sprite) || o.GetType() == typeof(Texture2D) || (o.GetType() == typeof(DefaultAsset) && ProjectWindowUtil.IsFolder(o.GetInstanceID())));
}

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

Expand Down
46 changes: 46 additions & 0 deletions Editor/Mono/Accessibility/UserAccessibilitySettings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// Unity C# reference source
// Copyright (c) Unity Technologies. For terms of use, see
// https://unity3d.com/legal/licenses/Unity_Reference_Only_License

using System;

namespace UnityEditor.Accessibility
{
internal enum ColorBlindCondition
{
Default,
Deuteranopia,
Protanopia,
Tritanopia,
}

// NOTE: The preferences in this class are currently only exposed via a context menu in the ProfilerWindow
// these toggles need to instead be moved to e.g., the Preferences menu before they are used elsewhere
internal static class UserAccessiblitySettings
{
static UserAccessiblitySettings()
{
s_ColorBlindCondition = (ColorBlindCondition)EditorPrefs.GetInt(k_ColorBlindConditionPrefKey, (int)ColorBlindCondition.Default);
}

private const string k_ColorBlindConditionPrefKey = "AccessibilityColorBlindCondition";

public static ColorBlindCondition colorBlindCondition
{
get { return s_ColorBlindCondition; }
set
{
if (s_ColorBlindCondition != value)
{
s_ColorBlindCondition = value;
EditorPrefs.SetInt(k_ColorBlindConditionPrefKey, (int)value);
if (colorBlindConditionChanged != null)
colorBlindConditionChanged();
}
}
}
private static ColorBlindCondition s_ColorBlindCondition;

public static Action colorBlindConditionChanged;
}
}
3 changes: 2 additions & 1 deletion Editor/Mono/Animation/AnimationWindow/AnimationRecording.cs
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,8 @@ static public UndoPropertyModification[] ProcessModifications(IAnimationRecordin
{
// TODO@mecanim keyframing of transform driven by an animator is disabled until we can figure out
// how to rebind partially a controller at each sampling.
if (animator != null && animator.isHuman && binding.type == typeof(Transform) && animator.IsBoneTransform(prop.target as Transform))
if (animator != null && animator.isHuman && binding.type == typeof(Transform)
&& animator.gameObject.transform != prop.target && animator.IsBoneTransform(prop.target as Transform))
{
Debug.LogWarning("Keyframing for humanoid rig is not supported!", prop.target as Transform);
continue;
Expand Down
1 change: 0 additions & 1 deletion Editor/Mono/Annotation/SceneRenderModeWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ public enum DrawCameraMode
BakedTexelValidity = 28,
BakedIndices = 29,
BakedCharting = 30,

SpriteMask = 31,
}

Expand Down
11 changes: 11 additions & 0 deletions Editor/Mono/AssetPipeline/ModelImporter.bindings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -800,5 +800,16 @@ public void CreateDefaultMaskForClip(ModelImporterClipAnimation clip)
else
Debug.LogError("Cannot create default mask because the current importer doesn't have any animation information");
}

[NativeName("ExtractTextures")]
private extern bool ExtractTexturesInternal(string folderPath);

public bool ExtractTextures(string folderPath)
{
if (string.IsNullOrEmpty(folderPath))
throw new ArgumentException("The path cannot be empty", folderPath);

return ExtractTexturesInternal(folderPath);
}
}
}
Loading

0 comments on commit 69bc09e

Please sign in to comment.