public static void RemoveDecalsTarget(DecalsTarget target) { if (target == null) { throw new ArgumentNullException("Decals Target cannot be null"); } for (int i = 0; i < target.Renderers.Length; i++) { targets.Remove(target.Renderers[i]); allRegisteredRenderers.Remove(target.Renderers[i]); } }
public static void AddDecalsTarget(DecalsTarget target) { if (target == null) { throw new ArgumentNullException("Decals Target cannot be null"); } if (targets.ContainsValue(target)) { RemoveDecalsTarget(target); } //targets.Add(target); for (int i = 0; i < target.Renderers.Length; i++) { targets.Add(target.Renderers[i], target); allRegisteredRenderers.Remove(target.Renderers[i]); } allRegisteredRenderers.AddRange(target.Renderers); }