浏览代码

Merge pull request #1433 from Unity-Technologies/corerp/AssignRPAssetOnDoubleClick

Allow to assign any RenderPipelineAsset easily.
/main
GitHub 7 年前
当前提交
8abde9b6
共有 2 个文件被更改,包括 34 次插入0 次删除
  1. 23
      com.unity.render-pipelines.core/CoreRP/Editor/RenderPipelineAssetHandler.cs
  2. 11
      com.unity.render-pipelines.core/CoreRP/Editor/RenderPipelineAssetHandler.cs.meta

23
com.unity.render-pipelines.core/CoreRP/Editor/RenderPipelineAssetHandler.cs


using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Experimental.Rendering;
using UnityEditor;
using UnityEditor.Callbacks;
public class RenderPipelineAssetHandler
{
// Assign RenderPipeline Asset on double click
[OnOpenAssetAttribute()]
public static bool OpenAsset(int instanceID, int line)
{
Object obj = EditorUtility.InstanceIDToObject(instanceID);
RenderPipelineAsset rpAsset = obj as RenderPipelineAsset;
if (rpAsset != null)
{
GraphicsSettings.renderPipelineAsset = rpAsset;
return true;
}
return false; // we did not handle the open
}
}

11
com.unity.render-pipelines.core/CoreRP/Editor/RenderPipelineAssetHandler.cs.meta


fileFormatVersion: 2
guid: 1433650c3d1bb2043a21d46e674e783a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存