浏览代码

LightweightPipeline asset is initialized from resource file. Moved pipeline asset to outside lightweight package.

/main
Felipe Lira 7 年前
当前提交
6c725111
共有 11 个文件被更改,包括 66 次插入21 次删除
  1. 36
      ScriptableRenderPipeline/LightweightPipeline/Resources/LightweightPipelineAsset.cs
  2. 8
      ScriptableRenderPipeline/LightweightPipeline/Resources.meta
  3. 16
      ScriptableRenderPipeline/LightweightPipeline/Resources/LightweightPipelineResource.asset
  4. 8
      ScriptableRenderPipeline/LightweightPipeline/Resources/LightweightPipelineResource.asset.meta
  5. 8
      ScriptableRenderPipeline/LightweightPipeline/Resources/LightweightPipelineResource.cs
  6. 11
      ScriptableRenderPipeline/LightweightPipeline/Resources/LightweightPipelineResource.cs.meta
  7. 0
      /LightweightPipelineAsset.asset.meta
  8. 0
      /ScriptableRenderPipeline/LightweightPipeline/Resources/LightweightPipelineAsset.cs.meta
  9. 0
      /LightweightPipelineAsset.asset
  10. 0
      /ScriptableRenderPipeline/LightweightPipeline/Resources/LightweightPipelineAsset.cs

36
ScriptableRenderPipeline/LightweightPipeline/Resources/LightweightPipelineAsset.cs


[SerializeField] private float m_Cascade2Split = 0.25f;
[SerializeField] private Vector3 m_Cascade4Split = new Vector3(0.067f, 0.2f, 0.467f);
[SerializeField] private Material m_DefaultMaterial;
[SerializeField] private Material m_DefaultParticleMaterial;
[SerializeField] private Material m_DefaultTerrainMaterial;
[SerializeField] private Material m_DefaultMaterial;
[SerializeField] private Material m_DefaultParticleMaterial;
[SerializeField] private Material m_DefaultTerrainMaterial;
#if UNITY_EDITOR
[UnityEditor.MenuItem("Assets/Create/Render Pipeline/Lightweight/Render Pipeline", priority = CoreUtils.assetCreateMenuPriority1)]
static void CreateLightweightPipeline()

string[] guids = AssetDatabase.FindAssets("Lightweight-Default t:material");
string[] paths = new string[guids.Length];
for (int i = 0; i < guids.Length; ++i)
string[] guids = UnityEditor.AssetDatabase.FindAssets("LightweightPipelineResource t:scriptableobject");
LightweightPipelineResource resourceAsset = null;
foreach (string guid in guids)
string guid = guids[i];
paths[i] = AssetDatabase.GUIDToAssetPath(guid);
string path = UnityEditor.AssetDatabase.GUIDToAssetPath(guid);
resourceAsset = UnityEditor.AssetDatabase.LoadAssetAtPath<LightweightPipelineResource>(path);
if (resourceAsset != null)
break;
foreach (string path in paths)
if (resourceAsset != null)
Material material = AssetDatabase.LoadAssetAtPath<Material>(path);
if (path.Length == 0)
continue;
if (path.Contains("Terrain"))
instance.m_DefaultTerrainMaterial = material;
else if (path.Contains("Particle"))
instance.m_DefaultParticleMaterial = material;
else
instance.m_DefaultMaterial = material;
instance.m_DefaultMaterial = resourceAsset.DefaultMaterial;
instance.m_DefaultParticleMaterial = resourceAsset.DefaultParticleMaterial;
instance.m_DefaultTerrainMaterial = resourceAsset.DefaultTerrainMaterial;
}
instance.m_DefaultShader = Shader.Find(m_StandardShaderPath);

8
ScriptableRenderPipeline/LightweightPipeline/Resources.meta


fileFormatVersion: 2
guid: 96a897191a3b552429d819147e6a36a4
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

16
ScriptableRenderPipeline/LightweightPipeline/Resources/LightweightPipelineResource.asset


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: eb91b173ce266e040aa972ca9a561308, type: 3}
m_Name: LightweightPipelineResource
m_EditorClassIdentifier:
DefaultMaterial: {fileID: 0}
DefaultParticleMaterial: {fileID: 0}
DefaultTerrainMaterial: {fileID: 0}

8
ScriptableRenderPipeline/LightweightPipeline/Resources/LightweightPipelineResource.asset.meta


fileFormatVersion: 2
guid: c8afc0a27fb8c0b4da18151c689a1082
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

8
ScriptableRenderPipeline/LightweightPipeline/Resources/LightweightPipelineResource.cs


using UnityEngine;
public class LightweightPipelineResource : ScriptableObject
{
public Material DefaultMaterial;
public Material DefaultParticleMaterial;
public Material DefaultTerrainMaterial;
}

11
ScriptableRenderPipeline/LightweightPipeline/Resources/LightweightPipelineResource.cs.meta


fileFormatVersion: 2
guid: eb91b173ce266e040aa972ca9a561308
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

/ScriptableRenderPipeline/LightweightPipeline/LightweightPipelineAsset.asset.meta → /LightweightPipelineAsset.asset.meta

/ScriptableRenderPipeline/LightweightPipeline/LightweightPipelineAsset.cs.meta → /ScriptableRenderPipeline/LightweightPipeline/Resources/LightweightPipelineAsset.cs.meta

/ScriptableRenderPipeline/LightweightPipeline/LightweightPipelineAsset.asset → /LightweightPipelineAsset.asset

/ScriptableRenderPipeline/LightweightPipeline/LightweightPipelineAsset.cs → /ScriptableRenderPipeline/LightweightPipeline/Resources/LightweightPipelineAsset.cs

正在加载...
取消
保存