//Can't do this in constructor for some reason private void Init() { if (target == null) throw new ArgumentException(nameof(target), "Target is null for some reason."); reflectionStrat = new FasterflectReflectionStrategy(); collectionRepo = new BehaviourCollectionModelRepository(target as GladMonoBehaviour, reflectionStrat); controller = new GladMonoBehaviourDataController(); IEnumerable<IDataStoreModel> models = collectionRepo.BuildModels(); List<IEditorDrawable> tempViewList = new List<IEditorDrawable>(models.Count() * 2); foreach (var dm in models) tempViewList.Add(controller.RegisterModel(dm)); views = tempViewList; }
//Can't do this in constructor for some reason private void Init() { if (target == null) { throw new ArgumentException(nameof(target), "Target is null for some reason."); } reflectionStrat = new FasterflectReflectionStrategy(); collectionRepo = new BehaviourCollectionModelRepository(target as GladMonoBehaviour, reflectionStrat); controller = new GladMonoBehaviourDataController(); IEnumerable <IDataStoreModel> models = collectionRepo.BuildModels(); List <IEditorDrawable> tempViewList = new List <IEditorDrawable>(models.Count() * 2); foreach (var dm in models) { tempViewList.Add(controller.RegisterModel(dm)); } views = tempViewList; }