using System; using System.Collections.Generic; using UnityEngine; using UnityEngine.Rendering; namespace UnityEditor.Recorder.Input { internal static class CameraCapture { private static Dictionary > > actionDict = new Dictionary > >(); public static IEnumerator > GetActions(Camera camera) { HashSet > actions; if (!actionDict.TryGetValue(camera, out actions)) return null; return actions.GetEnumerator(); } public static void AddCaptureAction(Camera camera, Action action) { HashSet > actions = null; actionDict.TryGetValue(camera, out actions); if (actions == null) { actions = new HashSet >(); actionDict.Add(camera, actions); } actions.Add(action); } public static void RemoveCaptureAction(Camera camera, Action action) { if (camera == null) return; HashSet > actions; if (actionDict.TryGetValue(camera, out actions)) actions.Remove(action); } } }