Skip to content
This repository was archived by the owner on Apr 19, 2020. It is now read-only.

Commit d342883

Browse files
committed
初コミット
1 parent d865698 commit d342883

23 files changed

+1648
-0
lines changed

Assets/UnityCompileInBackground.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/UnityCompileInBackground/Editor.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
using UnityEditor;
2+
using UnityEngine;
3+
4+
namespace KoganeUnityLib
5+
{
6+
[InitializeOnLoad]
7+
public static class UnityCompileInBackground
8+
{
9+
private const string NAME = "UnityCompileInBackground";
10+
private const string KEY_IS_ENABLE = NAME + "-IsEnable";
11+
private const string KEY_WAIT_TIME = NAME + "-WaitTime";
12+
private const string KEY_IS_ENABLE_DEBUG_LOG = NAME + "-IsEnableDebugLog";
13+
14+
private static bool m_isEnable ;
15+
private static bool m_isEnableDebugLog ;
16+
private static float m_waitTime ;
17+
private static double m_time ;
18+
private static bool m_isLoaded ;
19+
20+
static UnityCompileInBackground()
21+
{
22+
m_time = EditorApplication.timeSinceStartup;
23+
EditorApplication.update += OnUpdate;
24+
}
25+
26+
private static void Load()
27+
{
28+
if ( m_isLoaded ) return;
29+
30+
m_isLoaded = true;
31+
32+
m_isEnable = EditorPrefs.GetBool( KEY_IS_ENABLE, true );
33+
m_waitTime = EditorPrefs.GetFloat( KEY_WAIT_TIME, 1 );
34+
m_isEnableDebugLog = EditorPrefs.GetBool( KEY_IS_ENABLE_DEBUG_LOG, false );
35+
}
36+
37+
private static void OnUpdate()
38+
{
39+
Load();
40+
41+
if ( !m_isEnable ) return;
42+
if ( EditorApplication.isCompiling ) return;
43+
if ( EditorApplication.isUpdating ) return;
44+
if ( EditorApplication.timeSinceStartup - m_time < m_waitTime ) return;
45+
46+
m_time = EditorApplication.timeSinceStartup;
47+
AssetDatabase.Refresh();
48+
49+
if ( !m_isEnableDebugLog ) return;
50+
51+
Debug.LogFormat( "[ {0} ] Refresh", NAME );
52+
}
53+
54+
#if !UNITY_2018_3_OR_NEWER
55+
[PreferenceItem( "Compile in BG" )]
56+
#endif
57+
private static void OnGUI()
58+
{
59+
Load();
60+
61+
EditorGUI.BeginChangeCheck();
62+
63+
m_isEnable = EditorGUILayout.Toggle( "Enabled", m_isEnable );
64+
m_waitTime = MultipleFloor( EditorGUILayout.Slider( "Wait Time ( sec )", m_waitTime, 0, 10 ), 0.1f );
65+
m_isEnableDebugLog = EditorGUILayout.Toggle( "Enabled Debug Log", m_isEnableDebugLog );
66+
67+
if ( EditorGUI.EndChangeCheck() )
68+
{
69+
EditorPrefs.SetBool( KEY_IS_ENABLE, m_isEnable );
70+
EditorPrefs.SetFloat( KEY_WAIT_TIME, m_waitTime );
71+
EditorPrefs.SetBool( KEY_IS_ENABLE_DEBUG_LOG, m_isEnableDebugLog );
72+
}
73+
}
74+
75+
#if UNITY_2018_3_OR_NEWER
76+
[SettingsProvider]
77+
public static SettingsProvider CreateSettingsProvider()
78+
{
79+
var path = "Preferences/" + NAME;
80+
var provider = new SettingsProvider( path, SettingsScope.User )
81+
{
82+
label = NAME,
83+
guiHandler = _ => OnGUI(),
84+
keywords = new []{ NAME, "Enabled", "Wait Time ( sec )" },
85+
};
86+
87+
return provider;
88+
}
89+
#endif
90+
91+
private static float MultipleFloor( float value, float multiple )
92+
{
93+
return Mathf.Floor( value / multiple ) * multiple;
94+
}
95+
}
96+
}

Assets/UnityCompileInBackground/Editor/UnityCompileInBackground.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Packages/manifest.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"dependencies": {
3+
"com.unity.ads": "2.3.1",
4+
"com.unity.analytics": "3.2.2",
5+
"com.unity.collab-proxy": "1.2.15",
6+
"com.unity.package-manager-ui": "2.0.3",
7+
"com.unity.purchasing": "2.0.3",
8+
"com.unity.textmeshpro": "1.3.0",
9+
"com.unity.modules.ai": "1.0.0",
10+
"com.unity.modules.animation": "1.0.0",
11+
"com.unity.modules.assetbundle": "1.0.0",
12+
"com.unity.modules.audio": "1.0.0",
13+
"com.unity.modules.cloth": "1.0.0",
14+
"com.unity.modules.director": "1.0.0",
15+
"com.unity.modules.imageconversion": "1.0.0",
16+
"com.unity.modules.imgui": "1.0.0",
17+
"com.unity.modules.jsonserialize": "1.0.0",
18+
"com.unity.modules.particlesystem": "1.0.0",
19+
"com.unity.modules.physics": "1.0.0",
20+
"com.unity.modules.physics2d": "1.0.0",
21+
"com.unity.modules.screencapture": "1.0.0",
22+
"com.unity.modules.terrain": "1.0.0",
23+
"com.unity.modules.terrainphysics": "1.0.0",
24+
"com.unity.modules.tilemap": "1.0.0",
25+
"com.unity.modules.ui": "1.0.0",
26+
"com.unity.modules.uielements": "1.0.0",
27+
"com.unity.modules.umbra": "1.0.0",
28+
"com.unity.modules.unityanalytics": "1.0.0",
29+
"com.unity.modules.unitywebrequest": "1.0.0",
30+
"com.unity.modules.unitywebrequestassetbundle": "1.0.0",
31+
"com.unity.modules.unitywebrequestaudio": "1.0.0",
32+
"com.unity.modules.unitywebrequesttexture": "1.0.0",
33+
"com.unity.modules.unitywebrequestwww": "1.0.0",
34+
"com.unity.modules.vehicles": "1.0.0",
35+
"com.unity.modules.video": "1.0.0",
36+
"com.unity.modules.vr": "1.0.0",
37+
"com.unity.modules.wind": "1.0.0",
38+
"com.unity.modules.xr": "1.0.0"
39+
}
40+
}

ProjectSettings/AudioManager.asset

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
%YAML 1.1
2+
%TAG !u! tag:unity3d.com,2011:
3+
--- !u!11 &1
4+
AudioManager:
5+
m_ObjectHideFlags: 0
6+
m_Volume: 1
7+
Rolloff Scale: 1
8+
Doppler Factor: 1
9+
Default Speaker Mode: 2
10+
m_SampleRate: 0
11+
m_DSPBufferSize: 1024
12+
m_VirtualVoiceCount: 512
13+
m_RealVoiceCount: 32
14+
m_SpatializerPlugin:
15+
m_AmbisonicDecoderPlugin:
16+
m_DisableAudio: 0
17+
m_VirtualizeEffects: 1
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
%YAML 1.1
2+
%TAG !u! tag:unity3d.com,2011:
3+
--- !u!236 &1
4+
ClusterInputManager:
5+
m_ObjectHideFlags: 0
6+
m_Inputs: []

ProjectSettings/DynamicsManager.asset

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
%YAML 1.1
2+
%TAG !u! tag:unity3d.com,2011:
3+
--- !u!55 &1
4+
PhysicsManager:
5+
m_ObjectHideFlags: 0
6+
serializedVersion: 8
7+
m_Gravity: {x: 0, y: -9.81, z: 0}
8+
m_DefaultMaterial: {fileID: 0}
9+
m_BounceThreshold: 2
10+
m_SleepThreshold: 0.005
11+
m_DefaultContactOffset: 0.01
12+
m_DefaultSolverIterations: 6
13+
m_DefaultSolverVelocityIterations: 1
14+
m_QueriesHitBackfaces: 0
15+
m_QueriesHitTriggers: 1
16+
m_EnableAdaptiveForce: 0
17+
m_ClothInterCollisionDistance: 0
18+
m_ClothInterCollisionStiffness: 0
19+
m_ContactsGeneration: 1
20+
m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
21+
m_AutoSimulation: 1
22+
m_AutoSyncTransforms: 0
23+
m_ReuseCollisionCallbacks: 1
24+
m_ClothInterCollisionSettingsToggle: 0
25+
m_ContactPairsMode: 0
26+
m_BroadphaseType: 0
27+
m_WorldBounds:
28+
m_Center: {x: 0, y: 0, z: 0}
29+
m_Extent: {x: 250, y: 250, z: 250}
30+
m_WorldSubdivisions: 8
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
%YAML 1.1
2+
%TAG !u! tag:unity3d.com,2011:
3+
--- !u!1045 &1
4+
EditorBuildSettings:
5+
m_ObjectHideFlags: 0
6+
serializedVersion: 2
7+
m_Scenes:
8+
- enabled: 1
9+
path: Assets/Scenes/SampleScene.unity
10+
guid: 2cda990e2423bbf4892e6590ba056729
11+
m_configObjects: {}

ProjectSettings/EditorSettings.asset

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
%YAML 1.1
2+
%TAG !u! tag:unity3d.com,2011:
3+
--- !u!159 &1
4+
EditorSettings:
5+
m_ObjectHideFlags: 0
6+
serializedVersion: 7
7+
m_ExternalVersionControlSupport: Visible Meta Files
8+
m_SerializationMode: 2
9+
m_LineEndingsForNewScripts: 2
10+
m_DefaultBehaviorMode: 1
11+
m_SpritePackerMode: 4
12+
m_SpritePackerPaddingPower: 1
13+
m_EtcTextureCompressorBehavior: 1
14+
m_EtcTextureFastCompressor: 1
15+
m_EtcTextureNormalCompressor: 2
16+
m_EtcTextureBestCompressor: 4
17+
m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd
18+
m_ProjectGenerationRootNamespace:
19+
m_UserGeneratedProjectSuffix:
20+
m_CollabEditorSettings:
21+
inProgressEnabled: 1
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
%YAML 1.1
2+
%TAG !u! tag:unity3d.com,2011:
3+
--- !u!30 &1
4+
GraphicsSettings:
5+
m_ObjectHideFlags: 0
6+
serializedVersion: 12
7+
m_Deferred:
8+
m_Mode: 1
9+
m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0}
10+
m_DeferredReflections:
11+
m_Mode: 1
12+
m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0}
13+
m_ScreenSpaceShadows:
14+
m_Mode: 1
15+
m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0}
16+
m_LegacyDeferred:
17+
m_Mode: 1
18+
m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0}
19+
m_DepthNormals:
20+
m_Mode: 1
21+
m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0}
22+
m_MotionVectors:
23+
m_Mode: 1
24+
m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0}
25+
m_LightHalo:
26+
m_Mode: 1
27+
m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0}
28+
m_LensFlare:
29+
m_Mode: 1
30+
m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0}
31+
m_AlwaysIncludedShaders:
32+
- {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0}
33+
- {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0}
34+
- {fileID: 10783, guid: 0000000000000000f000000000000000, type: 0}
35+
m_PreloadedShaders: []
36+
m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000,
37+
type: 0}
38+
m_CustomRenderPipeline: {fileID: 0}
39+
m_TransparencySortMode: 0
40+
m_TransparencySortAxis: {x: 0, y: 0, z: 1}
41+
m_DefaultRenderingPath: 1
42+
m_DefaultMobileRenderingPath: 1
43+
m_TierSettings: []
44+
m_LightmapStripping: 0
45+
m_FogStripping: 0
46+
m_InstancingStripping: 0
47+
m_LightmapKeepPlain: 1
48+
m_LightmapKeepDirCombined: 1
49+
m_LightmapKeepDynamicPlain: 1
50+
m_LightmapKeepDynamicDirCombined: 1
51+
m_LightmapKeepShadowMask: 1
52+
m_LightmapKeepSubtractive: 1
53+
m_FogKeepLinear: 1
54+
m_FogKeepExp: 1
55+
m_FogKeepExp2: 1
56+
m_AlbedoSwatchInfos: []
57+
m_LightsUseLinearIntensity: 0
58+
m_LightsUseColorTemperature: 0

0 commit comments

Comments
 (0)