50 lines
1.2 KiB
C#
50 lines
1.2 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.Rendering.Universal;
|
|
using System.Linq;
|
|
|
|
public class OutLineVariable :MonoBehaviour
|
|
{
|
|
|
|
public Color OutLineColor=Color.white;
|
|
[Range(0.01f,10)]public float OutLineStrength=2;
|
|
[ReadOnly]
|
|
public UniversalRendererData rendererData;
|
|
|
|
private OutLine outLine;
|
|
|
|
public OutLine OutLine
|
|
{
|
|
get
|
|
{
|
|
if (outLine == null)
|
|
{
|
|
rendererData = Resources.Load<UniversalRendererData>("UniversalRenderPipelineAsset_Renderer");
|
|
outLine = rendererData.rendererFeatures.OfType<OutLine>().FirstOrDefault();
|
|
}
|
|
|
|
return outLine;
|
|
}
|
|
}
|
|
|
|
private void Start()
|
|
{
|
|
//OutLineColor = OutLine.OutLineColor;
|
|
//OutLineStrength = OutLine.OutLineStrength;
|
|
}
|
|
void Update()
|
|
{
|
|
//if(OutLineColor!=OutLine.OutLineColor)
|
|
}
|
|
//public void OnValidate()
|
|
//{
|
|
// OutLine.OutLineColor = OutLineColor;
|
|
// OutLine.OutLineStrength = OutLineStrength;
|
|
|
|
//rendererData.SetDirty();
|
|
// Debug.Log(OutLineStrength);
|
|
//}
|
|
}
|