Merge branch 'hdrp' of https://git.bit5.ru/r.nikolin/rabidus-test into hdrp
This commit is contained in:
commit
9153f9d9f5
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 4feeb981ea509cd42967c3637667453d
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,72 @@
|
|||
#if UNITY_EDITOR
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using UnityEditor;
|
||||
using UnityEditor.Build;
|
||||
using UnityEditor.Build.Reporting;
|
||||
using UnityEditor.SceneManagement;
|
||||
using UnityEngine;
|
||||
|
||||
public static class BuilderTool
|
||||
{
|
||||
public static NamedBuildTarget GetBuildTarget() => NamedBuildTarget.Standalone;
|
||||
|
||||
[MenuItem("Builds/Build")]
|
||||
public static void Build()
|
||||
{
|
||||
var productName = $"VR Project 3";
|
||||
var rootPath = Application.dataPath + "/../";
|
||||
var bundleNumber = PlayerSettings.Android.bundleVersionCode;
|
||||
bundleNumber++;
|
||||
var buildRootPath = Path.Combine(rootPath, "Builds");
|
||||
var buildName = $"{productName}.exe";
|
||||
var buildPlayerOptions = new BuildPlayerOptions();
|
||||
|
||||
var defines = GetActualDefines();
|
||||
ApplyDefines(defines);
|
||||
|
||||
|
||||
PlayerSettings.applicationIdentifier = $"com.BoggArt.OscSender.{productName}";
|
||||
PlayerSettings.productName = productName;
|
||||
buildPlayerOptions.scenes = GetScenes();
|
||||
buildPlayerOptions.locationPathName = Path.Combine(buildRootPath, buildName);
|
||||
buildPlayerOptions.target = BuildTarget.StandaloneWindows64;
|
||||
buildPlayerOptions.options = BuildOptions.None;
|
||||
buildPlayerOptions.extraScriptingDefines = defines;
|
||||
|
||||
if (!Directory.Exists(buildRootPath))
|
||||
Directory.CreateDirectory(buildRootPath);
|
||||
|
||||
BuildReport report = BuildPipeline.BuildPlayer(buildPlayerOptions);
|
||||
BuildSummary summary = report.summary;
|
||||
|
||||
if (summary.result == BuildResult.Succeeded)
|
||||
{
|
||||
Debug.Log("Build succeeded: " + summary.totalSize + " bytes");
|
||||
}
|
||||
|
||||
if (summary.result == BuildResult.Failed)
|
||||
{
|
||||
Debug.Log("Build failed");
|
||||
}
|
||||
}
|
||||
|
||||
public static string[] GetActualDefines()
|
||||
{
|
||||
return PlayerSettings.GetScriptingDefineSymbols(GetBuildTarget()).Split(";").ToArray();
|
||||
}
|
||||
|
||||
public static string[] GetScenes()
|
||||
{
|
||||
return EditorBuildSettings.scenes.Select(s => s.path).ToArray();
|
||||
}
|
||||
|
||||
private static void ApplyDefines(string[] defines)
|
||||
{
|
||||
PlayerSettings.SetScriptingDefineSymbols(GetBuildTarget(), defines);
|
||||
}
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ae6a85ec006b4154d8d3734b2378dd80
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Reference in New Issue