mirror of
https://github.com/FriendshipIsEpic/FiE-Game.git
synced 2024-11-29 08:37:58 +01:00
46 lines
No EOL
856 B
C#
46 lines
No EOL
856 B
C#
using UnityEngine;
|
|
using UnityEngine.Rendering;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
|
|
namespace HighlightingSystem
|
|
{
|
|
static public class HighlighterManager
|
|
{
|
|
static private int dirtyFrame = -1;
|
|
static public bool isDirty
|
|
{
|
|
get
|
|
{
|
|
return dirtyFrame == Time.frameCount;
|
|
}
|
|
private set
|
|
{
|
|
dirtyFrame = value ? Time.frameCount : -1;
|
|
}
|
|
}
|
|
|
|
static private HashSet<Highlighter> highlighters = new HashSet<Highlighter>();
|
|
|
|
//
|
|
static public void Add(Highlighter highlighter)
|
|
{
|
|
highlighters.Add(highlighter);
|
|
}
|
|
|
|
//
|
|
static public void Remove(Highlighter instance)
|
|
{
|
|
if (highlighters.Remove(instance) && instance.highlighted)
|
|
{
|
|
isDirty = true;
|
|
}
|
|
}
|
|
|
|
//
|
|
static public HashSet<Highlighter>.Enumerator GetEnumerator()
|
|
{
|
|
return highlighters.GetEnumerator();
|
|
}
|
|
}
|
|
} |