【m】插件上传
This commit is contained in:
40
Packages/com.unity.renderstreaming@3.1.0-exp.9/Samples~/Example/Editor/PostProcess.cs
vendored
Normal file
40
Packages/com.unity.renderstreaming@3.1.0-exp.9/Samples~/Example/Editor/PostProcess.cs
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
using UnityEditor;
|
||||
using UnityEditor.Build;
|
||||
using UnityEditor.Build.Reporting;
|
||||
#if UNITY_IOS
|
||||
using UnityEditor.iOS.Xcode;
|
||||
#endif
|
||||
|
||||
class PostProcess : IPostprocessBuildWithReport
|
||||
{
|
||||
public int callbackOrder { get { return 0; } }
|
||||
|
||||
public void OnPostprocessBuild(BuildReport report)
|
||||
{
|
||||
#if UNITY_IOS
|
||||
if (report.summary.platform == BuildTarget.iOS)
|
||||
{
|
||||
string projectPath = report.summary.outputPath + "/Unity-iPhone.xcodeproj/project.pbxproj";
|
||||
|
||||
PBXProject pbxProject = new PBXProject();
|
||||
pbxProject.ReadFromFile(projectPath);
|
||||
|
||||
//Disabling Bitcode on all targets
|
||||
|
||||
//Main
|
||||
string target = pbxProject.GetUnityMainTargetGuid();
|
||||
pbxProject.SetBuildProperty(target, "ENABLE_BITCODE", "NO");
|
||||
|
||||
//Unity Tests
|
||||
target = pbxProject.TargetGuidByName(PBXProject.GetUnityTestTargetName());
|
||||
pbxProject.SetBuildProperty(target, "ENABLE_BITCODE", "NO");
|
||||
|
||||
//Unity Framework
|
||||
target = pbxProject.GetUnityFrameworkTargetGuid();
|
||||
pbxProject.SetBuildProperty(target, "ENABLE_BITCODE", "NO");
|
||||
|
||||
pbxProject.WriteToFile(projectPath);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
11
Packages/com.unity.renderstreaming@3.1.0-exp.9/Samples~/Example/Editor/PostProcess.cs.meta
vendored
Normal file
11
Packages/com.unity.renderstreaming@3.1.0-exp.9/Samples~/Example/Editor/PostProcess.cs.meta
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9a6fe6dcd54394a62ba7efc4d7352432
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
94
Packages/com.unity.renderstreaming@3.1.0-exp.9/Samples~/Example/Editor/SampleSetup.cs
vendored
Normal file
94
Packages/com.unity.renderstreaming@3.1.0-exp.9/Samples~/Example/Editor/SampleSetup.cs
vendored
Normal file
@@ -0,0 +1,94 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Unity.RenderStreaming.Editor;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace Unity.RenderStreaming.Samples
|
||||
{
|
||||
[InitializeOnLoad]
|
||||
class SampleSetup
|
||||
{
|
||||
private const string kSavePath = "Library/RenderStreamingSampleSettings.json";
|
||||
private static string cacheGuid = "";
|
||||
|
||||
class DeleteSampleSettings : UnityEditor.AssetModificationProcessor
|
||||
{
|
||||
// When SampleSetup script is deleted, also delete RenderStreamingSampleSettings.json.
|
||||
private static AssetDeleteResult OnWillDeleteAsset(string assetPath, RemoveAssetOptions options)
|
||||
{
|
||||
var existPath = AssetDatabase.GUIDToAssetPath(cacheGuid);
|
||||
if (existPath.StartsWith(assetPath))
|
||||
{
|
||||
File.Delete(kSavePath);
|
||||
}
|
||||
|
||||
return AssetDeleteResult.DidNotDelete;
|
||||
}
|
||||
}
|
||||
|
||||
static SampleSetup()
|
||||
{
|
||||
cacheGuid = AssetDatabase.FindAssets($"t:Script {nameof(SampleSetup)}")[0];
|
||||
|
||||
Load();
|
||||
if (s_Settings.dialogAlreadyShowOnStartup || !RenderStreaming.AutomaticStreaming)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const string dialogText =
|
||||
"It is recommended to turn off AutomaticStreaming in the scenes included in the sample. Do you want to change the config assets for Sample?";
|
||||
if (EditorUtility.DisplayDialog("Warning", dialogText, "Change Settings", "Ignore"))
|
||||
{
|
||||
var guids = AssetDatabase.FindAssets("t:RenderStreamingSettings");
|
||||
var path = guids.Select(AssetDatabase.GUIDToAssetPath).First(x => x.EndsWith("RenderStreamingSample.asset"));
|
||||
var asset = AssetDatabase.LoadAssetAtPath<RenderStreamingSettings>(path);
|
||||
if (asset != null)
|
||||
{
|
||||
RenderStreamingEditor.SetRenderStreamingSettings(asset);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError("RenderStreamingSample.asset not found.");
|
||||
}
|
||||
}
|
||||
|
||||
s_Settings.dialogAlreadyShowOnStartup = true;
|
||||
Save();
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
private struct SerializedState
|
||||
{
|
||||
public bool dialogAlreadyShowOnStartup;
|
||||
}
|
||||
|
||||
private static SerializedState s_Settings;
|
||||
|
||||
private static void Load()
|
||||
{
|
||||
s_Settings = new SerializedState();
|
||||
if (!File.Exists(kSavePath))
|
||||
return;
|
||||
|
||||
try
|
||||
{
|
||||
var json = File.ReadAllText(kSavePath);
|
||||
s_Settings = JsonUtility.FromJson<SerializedState>(json);
|
||||
}
|
||||
catch
|
||||
{
|
||||
s_Settings = new SerializedState();
|
||||
}
|
||||
}
|
||||
|
||||
private static void Save()
|
||||
{
|
||||
var json = JsonUtility.ToJson(s_Settings, prettyPrint: true);
|
||||
File.WriteAllText(kSavePath, json);
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Packages/com.unity.renderstreaming@3.1.0-exp.9/Samples~/Example/Editor/SampleSetup.cs.meta
vendored
Normal file
3
Packages/com.unity.renderstreaming@3.1.0-exp.9/Samples~/Example/Editor/SampleSetup.cs.meta
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4f56783b5ff347029a1b5e685020003d
|
||||
timeCreated: 1675922966
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"name": "Unity.RenderStreaming.Sample.Editor",
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"GUID:40a5acf76f04c4c8ebb69605e4b0d5c7",
|
||||
"GUID:7e479a0c97f111c48b6a279fad867f28"
|
||||
],
|
||||
"includePlatforms": [
|
||||
"Editor"
|
||||
],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9a72d92d453fffa418a5baa1727f851e
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user