Skip to content

Commit 7985d75

Browse files
author
Unity Technologies
committed
Unity 2018.1.0a7 C# reference source code
1 parent 3a75391 commit 7985d75

File tree

89 files changed

+2308
-1011
lines changed

Some content is hidden

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

89 files changed

+2308
-1011
lines changed

Editor/Mono/AssetPipeline/AssetImportContext.bindings.cs

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@
33
// https://unity3d.com/legal/licenses/Unity_Reference_Only_License
44

55
using System;
6+
using System.Diagnostics;
67
using UnityEngine;
78
using UnityEngine.Bindings;
89
using UnityEngine.Scripting;
10+
using Debug = UnityEngine.Debug;
911
using Object = UnityEngine.Object;
1012

13+
1114
namespace UnityEditor.Experimental.AssetImporters
1215
{
1316
/// Universal structure that holds all the data relevant to importing an asset, including temporary data that needs to be shared across stages that make on any given importer's pipeline.
@@ -23,11 +26,13 @@ public class AssetImportContext
2326
internal IntPtr m_Self;
2427

2528
// the context can only be instantiated in native code
26-
private AssetImportContext() {}
29+
AssetImportContext() {}
2730

2831
public extern string assetPath { get; internal set; }
2932
public extern BuildTarget selectedBuildTarget { get; }
3033

34+
extern void LogMessage(string msg, string file, int line, UnityEngine.Object obj, bool isAnError);
35+
3136
[NativeThrows]
3237
public extern void SetMainObject(Object obj);
3338

@@ -54,5 +59,24 @@ internal void DependOnHashOfSourceFile(string path)
5459

5560
[NativeName("DependOnHashOfSourceFile")]
5661
private extern void DependOnHashOfSourceFileInternal(string path);
62+
63+
// Internal for now, will be made public once UI/UX for persistent importer logs is implemented.
64+
public void LogImportError(string msg, UnityEngine.Object obj = null)
65+
{
66+
AddToLog(msg, true, obj);
67+
}
68+
69+
// Internal for now, will be made public once UI/UX for persistent importer logs is implemented.
70+
public void LogImportWarning(string msg, UnityEngine.Object obj = null)
71+
{
72+
AddToLog(msg, false, obj);
73+
}
74+
75+
void AddToLog(string msg, bool isAnError, UnityEngine.Object obj)
76+
{
77+
var st = new StackTrace(2, true);
78+
var sf = st.GetFrame(0);
79+
LogMessage(msg, sf.GetFileName(), sf.GetFileLineNumber(), obj, isAnError);
80+
}
5781
}
5882
}

Editor/Mono/AssetPipeline/TextureGenerator.bindings.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
using System.Runtime.InteropServices;
1010
using UnityEngine.Scripting;
1111
using System.Collections.Generic;
12-
using UnityEngine.Collections;
12+
using Unity.Collections;
1313

1414
namespace UnityEditor.Experimental.AssetImporters
1515
{

Editor/Mono/Audio/Mixer/GUI/AudioMixerWindow.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ internal class AudioMixerWindow : EditorWindow, IHasCustomMenu
1919
static AudioMixerWindow s_Instance;
2020

2121
static string kAudioMixerUseRMSMetering = "AudioMixerUseRMSMetering";
22+
static string kAudioMixerUseHorzLayout = "AudioMixerUseHorzLayout";
2223

2324
enum SectionType
2425
{
@@ -66,8 +67,8 @@ class Layout
6667
Layout m_LayoutStripsOnRight;
6768
[SerializeField]
6869
SectionType[] m_SectionOrder = { SectionType.MixerTree, SectionType.SnapshotList, SectionType.GroupTree, SectionType.ViewList }; // default order
69-
[SerializeField]
70-
LayoutMode m_LayoutMode = LayoutMode.Vertical; // We use vertical layout as default as it is the most compact layout
70+
71+
LayoutMode m_LayoutMode;
7172
[SerializeField]
7273
bool m_SortGroupsAlphabetically = false;
7374
[SerializeField]
@@ -99,6 +100,7 @@ LayoutMode layoutMode
99100
{
100101
m_LayoutMode = value;
101102
m_RepaintCounter = 2;
103+
EditorPrefs.SetBool(kAudioMixerUseHorzLayout, m_LayoutMode == LayoutMode.Horizontal);
102104
}
103105
}
104106

@@ -276,6 +278,8 @@ public void Awake()
276278

277279
public void OnEnable()
278280
{
281+
// We use vertical layout as default as it is the most compact layout
282+
m_LayoutMode = EditorPrefs.GetBool(kAudioMixerUseHorzLayout) ? LayoutMode.Horizontal : LayoutMode.Vertical;
279283
titleContent = GetLocalizedTitleContent();
280284

281285
s_Instance = this;

Editor/Mono/BuildPipeline/DesktopStandaloneBuildWindow.cs renamed to Editor/Mono/BuildPipeline/DesktopStandaloneBuildWindowExtension.cs

File renamed without changes.

0 commit comments

Comments
 (0)