wip update unity example

This commit is contained in:
Chris Marsh 2017-11-30 12:26:11 -08:00 committed by Chris Marsh
parent 0d24fabdf4
commit 82439911c6
11 changed files with 107 additions and 47 deletions

View File

@ -1,6 +1,8 @@
/Library/
/Temp/
/obj/
/Assets/Plugins/
/Assets/Plugins.meta
*.sln
*.csproj
*.userprefs

View File

@ -0,0 +1,56 @@
using UnityEditor;
using System.Diagnostics;
using System.IO;
[InitializeOnLoad]
public class ScriptBatch
{
static ScriptBatch()
{
EnsureDLL();
}
public static bool FileExists(string filename)
{
return new FileInfo(filename).Exists;
}
public static void EnsureDLL()
{
UnityEngine.Debug.Log("Make sure Discord dll exists");
string dstDll32 = "Assets/Plugins/x86/discord-rpc.dll";
string dstDll64 = "Assets/Plugins/x86_64/discord-rpc.dll";
if (!FileExists(dstDll32) || !FileExists(dstDll64))
{
string srcDll32 = "../../builds/install/win64-dynamic/bin/discord-rpc.dll";
string srcDll64 = "../../builds/install/win64-dynamic/bin/discord-rpc.dll";
if (!FileExists(srcDll32) || !FileExists(srcDll64))
{
UnityEngine.Debug.Log("Try to run build script");
Process proc = new Process();
proc.StartInfo.FileName = "python";
proc.StartInfo.Arguments = "build.py";
proc.StartInfo.WorkingDirectory = "../..";
proc.Start();
proc.WaitForExit();
if (proc.ExitCode != 0)
{
UnityEngine.Debug.LogError("Build failed");
return;
}
}
// make sure the dirs exist
Directory.CreateDirectory("Assets/Plugins");
Directory.CreateDirectory("Assets/Plugins/x86");
Directory.CreateDirectory("Assets/Plugins/x86_64");
// Copy dlls
FileUtil.CopyFileOrDirectory("../../builds/install/win64-dynamic/bin/discord-rpc.dll", dstDll64);
FileUtil.CopyFileOrDirectory("../../builds/install/win32-dynamic/bin/discord-rpc.dll", dstDll32);
}
}
}

View File

@ -0,0 +1,13 @@
fileFormatVersion: 2
guid: e5aecc4633e5f594b85eaa39f49bb402
timeCreated: 1512071254
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: 4ddcc1759a3a2394fa1fa376963639e0
folderAsset: yes
timeCreated: 1501697278
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,27 +0,0 @@
fileFormatVersion: 2
guid: 2aadd6305b09fa94dab94261a8bb8caf
timeCreated: 1501697340
licenseType: Free
PluginImporter:
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
data:
first:
Any:
second:
enabled: 1
settings: {}
data:
first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
userData:
assetBundleName:
assetBundleVariant:

View File

@ -17,3 +17,4 @@ PhysicsManager:
m_EnablePCM: 1
m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
m_AutoSimulation: 1
m_AutoSyncTransforms: 1

View File

@ -4,4 +4,7 @@
EditorBuildSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Scenes: []
m_Scenes:
- enabled: 1
path: Assets/main.unity
guid: 3b03d21bb25fa494e8694cd6e4b6d769

View File

@ -24,6 +24,7 @@ Physics2DSettings:
m_QueriesStartInColliders: 1
m_ChangeStopsCallbacks: 0
m_CallbacksOnDisable: 1
m_AutoSyncTransforms: 1
m_AlwaysShowColliders: 0
m_ShowColliderSleep: 1
m_ShowColliderContacts: 0

View File

@ -3,14 +3,15 @@
--- !u!129 &1
PlayerSettings:
m_ObjectHideFlags: 0
serializedVersion: 12
serializedVersion: 13
productGUID: 5eccc60d3e382a346a65f512d6b81b84
AndroidProfiler: 0
AndroidFilterTouchesWhenObscured: 0
defaultScreenOrientation: 4
targetDevice: 2
useOnDemandResources: 0
accelerometerFrequency: 60
companyName: DefaultCompany
companyName: Discord Inc.
productName: button-clicker
defaultCursor: {fileID: 0}
cursorHotspot: {x: 0, y: 0}
@ -38,8 +39,6 @@ PlayerSettings:
width: 1
height: 1
m_SplashScreenLogos: []
m_SplashScreenBackgroundLandscape: {fileID: 0}
m_SplashScreenBackgroundPortrait: {fileID: 0}
m_VirtualRealitySplashScreen: {fileID: 0}
m_HolographicTrackingLossScreen: {fileID: 0}
defaultScreenWidth: 1024
@ -49,7 +48,6 @@ PlayerSettings:
m_StereoRenderingPath: 0
m_ActiveColorSpace: 0
m_MTRendering: 1
m_MobileMTRendering: 0
m_StackTraceTypes: 010000000100000001000000010000000100000001000000
iosShowActivityIndicatorOnLoading: -1
androidShowActivityIndicatorOnLoading: -1
@ -64,8 +62,10 @@ PlayerSettings:
useOSAutorotation: 1
use32BitDisplayBuffer: 1
disableDepthAndStencilBuffers: 0
androidBlitType: 0
defaultIsFullScreen: 1
defaultIsNativeResolution: 1
macRetinaSupport: 1
runInBackground: 0
captureSingleScreen: 0
muteOtherAudioSources: 0
@ -95,6 +95,7 @@ PlayerSettings:
xboxEnableHeadOrientation: 0
xboxEnableGuest: 0
xboxEnablePIXSampling: 0
metalFramebufferOnly: 0
n3dsDisableStereoscopicView: 0
n3dsEnableSharedListOpt: 1
n3dsEnableVSync: 0
@ -103,6 +104,7 @@ PlayerSettings:
xboxOneMonoLoggingLevel: 0
xboxOneLoggingLevel: 1
xboxOneDisableEsram: 0
xboxOnePresentImmediateThreshold: 0
videoMemoryForVertexBuffers: 0
psp2PowerMode: 0
psp2AcquireBGM: 1
@ -134,12 +136,17 @@ PlayerSettings:
daydream:
depthFormat: 0
useSustainedPerformanceMode: 0
enableVideoLayer: 0
useProtectedVideoMemory: 0
hololens:
depthFormat: 1
protectGraphicsMemory: 0
useHDRDisplay: 0
m_ColorGamuts: 00000000
targetPixelDensity: 0
resolutionScalingMode: 0
androidSupportedAspectRatio: 1
androidMaxAspectRatio: 2.1
applicationIdentifier: {}
buildNumber: {}
AndroidBundleVersionCode: 1
@ -160,10 +167,10 @@ PlayerSettings:
serializedVersion: 2
m_Bits: 238
iPhoneSdkVersion: 988
iOSTargetOSVersionString:
iOSTargetOSVersionString: 7.0
tvOSSdkVersion: 0
tvOSRequireExtendedGameController: 0
tvOSTargetOSVersionString:
tvOSTargetOSVersionString: 9.0
uIPrerenderedIcon: 0
uIRequiresPersistentWiFi: 0
uIRequiresFullScreen: 1
@ -220,7 +227,9 @@ PlayerSettings:
AndroidKeyaliasName:
AndroidTVCompatibility: 1
AndroidIsGame: 1
AndroidEnableTango: 0
androidEnableBanner: 1
androidUseLowAccuracyLocation: 0
m_AndroidBanners:
- width: 320
height: 180
@ -231,10 +240,14 @@ PlayerSettings:
m_BuildTargetBatching: []
m_BuildTargetGraphicsAPIs: []
m_BuildTargetVRSettings: []
m_BuildTargetEnableVuforiaSettings: []
openGLRequireES31: 0
openGLRequireES31AEP: 0
webPlayerTemplate: APPLICATION:Default
m_TemplateCustomTags: {}
mobileMTRendering:
Android: 1
iPhone: 1
tvOS: 1
wiiUTitleID: 0005000011000000
wiiUGroupID: 00010000
wiiUCommonSaveSize: 4096
@ -368,6 +381,9 @@ PlayerSettings:
switchUdpSendBufferSize: 9
switchUdpReceiveBufferSize: 42
switchSocketBufferEfficiency: 4
switchSocketInitializeEnabled: 1
switchNetworkInterfaceManagerInitializeEnabled: 1
switchPlayerConnectionEnabled: 1
ps4NPAgeRating: 12
ps4NPTitleSecret:
ps4NPTrophyPackPath:

View File

@ -1 +1 @@
m_EditorVersion: 2017.1.1f1
m_EditorVersion: 2017.2.0f3

View File

@ -0,0 +1,4 @@
{
"dependencies": {
}
}