Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System;
- using System.Linq;
- using System.Collections;
- using System.Collections.Generic;
- [Serializable]
- public class SerializableNestedList<T> : ScriptableObject
- {
- [SerializeField]
- private List<T> m_values = new List<T>();
- public List<T> List
- {
- get { return m_values; }
- private set { m_values = value; }
- }
- public void OnEnable()
- {
- if (m_values == null)
- {
- m_values = new List<T>();
- }
- }
- public void Add(T value)
- {
- m_values.Add(value);
- }
- public void Remove(T value)
- {
- m_values.Remove(value);
- }
- public T this[int i]
- {
- get
- {
- return m_values[i];
- }
- set
- {
- m_values[i] = value;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement