forked from Unity-Technologies/EntityComponentSystemSamples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSetupProject.cs
More file actions
47 lines (43 loc) · 1.43 KB
/
Copy pathSetupProject.cs
File metadata and controls
47 lines (43 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#if UNITY_EDITOR
using UnityEditor;
using UnityEditor.PackageManager.UI;
using UnityEngine;
#if UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX
using UnityEditor.OSXStandalone;
#endif
class Initialization
{
[InitializeOnLoadMethod]
static void SetupProject()
{
#if UNITY_2020_2_OR_NEWER && UNITY_EDITOR_OSX
if (EditorUserBuildSettings.activeBuildTarget == BuildTarget.StandaloneOSX)
UserBuildSettings.architecture = UnityEditor.Build.OSArchitecture.x64;
#endif
}
[InitializeOnLoadMethod]
static void AutoImportUnityPhysicsSamples()
{
if (Application.isPlaying)
{
// don't modify the project when entering playmode
return;
}
// else:
// Find Unity Physics package samples and auto-import them if not yet imported.
// Note: we are setting packageVersion to null here to ignore the version of the package.
foreach (var sample in Sample.FindByPackage("com.unity.physics", null))
{
if (!sample.isImported)
{
//sample.importPath = Application.dataPath + "/Authoring";
var success = sample.Import(Sample.ImportOptions.HideImportWindow | Sample.ImportOptions.OverridePreviousImports);
if (!success)
{
Debug.LogWarning("Failed to import Unity Physics package samples");
}
}
}
}
}
#endif