Advertisement
Nicklaj

Untitled

Mar 20th, 2025
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.65 KB | None | 0 0
  1. using System.Collections.Generic;
  2. using UnityEngine;
  3.  
  4. namespace Nicklaj.SimpleSOAP
  5. {
  6.  
  7.     /// <summary>
  8.     /// Base Runtime Set class. Extend this to create your scriptable list that will act
  9.     /// </summary>
  10.     /// <typeparam name="T"></typeparam>
  11.     public abstract class RuntimeSetBase<T> : RuntimeScriptableObject
  12.     {
  13.         public List<T> Items = new List<T>();
  14.  
  15.         public void Add(T item)
  16.         {
  17.             if (!Items.Contains(item))
  18.                 Items.Add(item);
  19.         }
  20.  
  21.         public void Remove(T item)
  22.         {
  23.             if (Items.Contains(item))
  24.                 Items.Remove(item);
  25.         }
  26.  
  27.  
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement