예제 #1
0
        public SerializedScriptableObjectCollection(ScriptableObject main, IEnumerable <UnityEngine.Object> list)
        {
            Main = new SerializedScriptableObject(main);
            var enumerable = list as Object[] ?? list.ToArray();

            Children = new SerializedScriptableObject[enumerable.Count()];
            int index = 0;

            foreach (var child in enumerable)
            {
                if (child == null)
                {
                    continue;
                }
                Children[index] = new SerializedScriptableObject(child as ScriptableObject);
                index++;
            }
        }
예제 #2
0
 public SerializedScriptableObjectCollection(SerializationInfo info, StreamingContext context)
 {
     Children = info.GetValue(nameof(Children), Children);
     Main     = info.GetValue(nameof(Main), Main);
 }