Skip to content

Commit 3a7bd40

Browse files
author
Unity Technologies
committed
Unity 2018.3.0a8 C# reference source code
1 parent 13acc09 commit 3a7bd40

213 files changed

Lines changed: 5381 additions & 3584 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/Mono/2D/SpriteEditorModule/SpriteFrameModule/SpriteFrameModuleBase.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ public override void OnModuleDeactivate()
7474
m_RectsCache = null;
7575
}
7676
undoSystem.UnregisterUndoCallback(UndoCallback);
77+
RemoveMainUI(spriteEditor.GetMainVisualContainer());
7778
}
7879

7980
public override bool ApplyRevert(bool apply)
@@ -221,6 +222,8 @@ public string selectedSpriteName
221222
get { return selected.name; }
222223
set
223224
{
225+
if (selected.name == value)
226+
return;
224227
undoSystem.RegisterCompleteObjectUndo(m_RectsCache, "Change Sprite Name");
225228
spriteEditor.SetDataModified();
226229

Editor/Mono/2D/SpriteEditorModule/SpriteFrameModule/SpriteFrameModuleBaseView.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,13 @@ private static Rect inspectorRect
101101
}
102102
}
103103

104+
private void RemoveMainUI(VisualElement mainView)
105+
{
106+
if (mainView.Contains(m_SelectedFrameInspector))
107+
mainView.Remove(m_SelectedFrameInspector);
108+
mainView.UnregisterCallback<SpriteSelectionChangeEvent>(SelectionChange);
109+
}
110+
104111
private void AddMainUI(VisualElement mainView)
105112
{
106113
var visualTree = EditorGUIUtility.Load("UXML/SpriteEditor/SpriteFrameModuleInspector.uxml") as VisualTreeAsset;
@@ -116,6 +123,15 @@ private void AddMainUI(VisualElement mainView)
116123
}
117124
});
118125

126+
m_NameField.RegisterCallback<FocusOutEvent>((focus) =>
127+
{
128+
if (hasSelected)
129+
{
130+
m_NameField.SetValueWithoutNotify(selectedSpriteName);
131+
}
132+
});
133+
134+
119135
m_PositionElement = m_SelectedFrameInspector.Q("position");
120136
m_PositionFieldX = m_PositionElement.Q<PropertyControl<long>>("positionX");
121137
m_PositionFieldX.OnValueChanged((evt) =>
@@ -187,6 +203,7 @@ private void AddMainUI(VisualElement mainView)
187203
border.y = evt.newValue;
188204
selectedSpriteBorder = border;
189205
m_BorderFieldT.SetValueWithoutNotify((long)selectedSpriteBorder.y);
206+
evt.StopPropagation();
190207
}
191208
});
192209

Editor/Mono/Animation/GameObjectRecorder.bindings.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,15 @@ public void SaveToClip(AnimationClip clip, float fps)
7575
extern public void ResetRecording();
7676

7777
// Obsolete
78+
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
7879
[Obsolete("The GameObjectRecorder constructor now takes a root GameObject", true)]
7980
public GameObjectRecorder() {}
8081

82+
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
8183
[Obsolete("BindComponent() using a System::Type is obsolete, use BindComponentsOfType() instead (UnityUpgradable) -> BindComponentsOfType(*)", true)]
8284
public void BindComponent(GameObject target, Type componentType, bool recursive) {}
8385

86+
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
8487
[Obsolete("\"BindComponent<T>() where T : Component\" is obsolete, use BindComponentsOfType<T>() instead (UnityUpgradable) -> BindComponentsOfType<T>(*)", true)]
8588
public void BindComponent<T>(GameObject target, bool recursive) where T : Component {}
8689
}

Editor/Mono/Annotation/SceneFXWindow.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ private void Draw(Rect rect)
8282
DrawListElement(drawPos, "Animated Materials", state.showMaterialUpdate, value => state.showMaterialUpdate = value);
8383
drawPos.y += EditorGUI.kSingleLineHeight;
8484

85-
DrawListElement(drawPos, "Image Effects", state.showImageEffects, value => state.showImageEffects = value);
85+
DrawListElement(drawPos, "Post Processings", state.showImageEffects, value => state.showImageEffects = value);
8686
drawPos.y += EditorGUI.kSingleLineHeight;
8787

8888
DrawListElement(drawPos, "Particle Systems", state.showParticleSystems, value => state.showParticleSystems = value);

Editor/Mono/Annotation/SceneRenderModeWindow.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,28 +28,34 @@ public enum DrawCameraMode
2828
DeferredSmoothness = 10,
2929
DeferredNormal = 11,
3030

31+
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
3132
[Obsolete("Renamed to better distinguish this mode from new Progressive baked modes. Please use RealtimeCharting instead. (UnityUpgradable) -> RealtimeCharting", true)]
3233
Charting = -12,
3334
RealtimeCharting = 12,
3435

3536
Systems = 13,
3637

38+
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
3739
[Obsolete("Renamed to better distinguish this mode from new Progressive baked modes. Please use RealtimeAlbedo instead. (UnityUpgradable) -> RealtimeAlbedo", true)]
3840
Albedo = -14,
3941
RealtimeAlbedo = 14,
4042

43+
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
4144
[Obsolete("Renamed to better distinguish this mode from new Progressive baked modes. Please use RealtimeEmissive instead. (UnityUpgradable) -> RealtimeEmissive", true)]
4245
Emissive = -15,
4346
RealtimeEmissive = 15,
4447

48+
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
4549
[Obsolete("Renamed to better distinguish this mode from new Progressive baked modes. Please use RealtimeIndirect instead. (UnityUpgradable) -> RealtimeIndirect", true)]
4650
Irradiance = -16,
4751
RealtimeIndirect = 16,
4852

53+
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
4954
[Obsolete("Renamed to better distinguish this mode from new Progressive baked modes. Please use RealtimeDirectionality instead. (UnityUpgradable) -> RealtimeDirectionality", true)]
5055
Directionality = -17,
5156
RealtimeDirectionality = 17,
5257

58+
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
5359
[Obsolete("Renamed to better distinguish this mode from new Progressive baked modes. Please use BakedLightmap instead. (UnityUpgradable) -> BakedLightmap", true)]
5460
Baked = -18,
5561
BakedLightmap = 18,

Editor/Mono/AssemblyInfo/AssemblyInfo.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
[assembly: InternalsVisibleTo("UnityEditor.AppleTV.Extensions")]
3131
[assembly: InternalsVisibleTo("UnityEditor.Android.Extensions")]
3232
[assembly: InternalsVisibleTo("UnityEditor.XboxOne.Extensions")]
33-
[assembly: InternalsVisibleTo("UnityEditor.PSP2.Extensions")]
3433
[assembly: InternalsVisibleTo("UnityEditor.PS4.Extensions")]
3534
[assembly: InternalsVisibleTo("UnityEditor.Switch.Extensions")]
3635
[assembly: InternalsVisibleTo("UnityEditor.WebGL.Extensions")]

Editor/Mono/AssetDatabase/AssetDatabase.bindings.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,14 @@ public static void ForceReserializeAssets(IEnumerable<string> assetPaths, ForceR
7272
[FreeFunction("AssetDatabase::GetGUIDAndLocalIdentifierInFile")]
7373
extern private static bool GetGUIDAndLocalIdentifierInFile(int instanceID, out GUID outGuid, out long outLocalId);
7474

75+
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
7576
[Obsolete("Please use the overload of this function that uses a long data type for the localId parameter, because this version can return a localID that has overflowed. This can happen when called on objects that are part of a Prefab.", true)]
7677
public static bool TryGetGUIDAndLocalFileIdentifier(UnityEngine.Object obj, out string guid, out int localId)
7778
{
7879
return TryGetGUIDAndLocalFileIdentifier(obj.GetInstanceID(), out guid, out localId);
7980
}
8081

82+
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
8183
[Obsolete("Please use the overload of this function that uses a long data type for the localId parameter, because this version can return a localID that has overflowed. This can happen when called on objects that are part of a Prefab.", true)]
8284
public static bool TryGetGUIDAndLocalFileIdentifier(int instanceID, out string guid, out int localId)
8385
{

Editor/Mono/AssetPipeline/IHVImageFormatImporter.bindings.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
namespace UnityEditor
1010
{
11+
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
1112
[Obsolete("DDSImporter is obsolete. Use IHVImageFormatImporter instead (UnityUpgradable) -> IHVImageFormatImporter", true)]
1213
[NativeClass(null)]
1314
public sealed class DDSImporter : AssetImporter

Editor/Mono/AssetPipeline/SpeedTreeImporter.bindings.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,11 @@ public extern bool isV8
5757

5858
// The below properties (specColor and shininess) were first made obsolete in 5.4, they didn't work anyway, AND SpeedTreeImporter should rarely be scripted by anyone
5959
// because of that I would say they can be safely removed for 5.6
60+
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
6061
[Obsolete("specColor is no longer used and has been deprecated.", true)]
6162
public Color specColor { get; set; }
6263

64+
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
6365
[Obsolete("shininess is no longer used and has been deprecated.", true)]
6466
public float shininess { get; set; }
6567

Editor/Mono/AssetPipeline/TextureImporterEnums.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ public enum TextureImporterFormat
6262
// Alpha 8 bit texture format.
6363
// RGBA 32 bit texture format.
6464
Alpha8 = 1,
65+
// Red 16 bit texture format.
66+
R16 = 9,
6567
// Red 8 bit texture format.
6668
R8 = 63,
6769
// RG 16 bit texture format.

0 commit comments

Comments
 (0)