58 lines
1.3 KiB
C#
58 lines
1.3 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class OutLineSingle
|
|
{
|
|
private static OutLineSingle _instance;
|
|
|
|
private List<OutLineDrawPam> _outLineDrawPams = new List<OutLineDrawPam>();
|
|
private OutLineSingle(){}
|
|
|
|
public static OutLineSingle Instance()
|
|
{
|
|
if(_instance==null)
|
|
{
|
|
_instance = new OutLineSingle();
|
|
}
|
|
return _instance;
|
|
}
|
|
|
|
public OutLineDrawPam GetOutLineDrawPam(Renderer[] renders,OutLineDraw draw)
|
|
{
|
|
OutLineDrawPam pam = new OutLineDrawPam();
|
|
pam.renders = renders;
|
|
pam.draw = draw;
|
|
return pam;
|
|
}
|
|
public void AddOutLineRender(OutLineDrawPam outLineDrawPam)
|
|
{
|
|
_outLineDrawPams.Add(outLineDrawPam);
|
|
}
|
|
|
|
public void RemoveOutLineRender(OutLineDrawPam outLineDrawPam)
|
|
{
|
|
if (_outLineDrawPams.Contains(outLineDrawPam))
|
|
{
|
|
_outLineDrawPams.Remove(outLineDrawPam);
|
|
}
|
|
|
|
}
|
|
|
|
public void RemoveAllOutLineRenders()
|
|
{
|
|
_outLineDrawPams.Clear();
|
|
}
|
|
public List<OutLineDrawPam> GetOutLineRenders()
|
|
{
|
|
return _outLineDrawPams;
|
|
}
|
|
|
|
}
|
|
|
|
public struct OutLineDrawPam
|
|
{
|
|
public Renderer[] renders;
|
|
public OutLineDraw draw;
|
|
}
|