private void CreateBehaviourProxies(IEnumerable <BehaviourComponent> behaviourComponents) { foreach (BehaviourComponent component in behaviourComponents) { BehaviourViewModel vm = BehaviourViewModelFactory.GetViewModelProxy(component); if (vm != null) { componentProxies.Add(vm); } } }
public void AddComponent(ComponentDescriptor componentDescriptor) { Type vmType = componentDescriptor.ComponentType; Type componentType = BehaviourViewModelFactory.GetBehaviourFromViewModelProxy(vmType); BehaviourComponent component = BehaviourFactory.CreateFromType(componentType, entityData); entityData.AddComponent(component); //Create a viewmodel proxy for our new component BehaviourViewModel vm = BehaviourViewModelFactory.GetViewModelProxy(component); ComponentAdded?.Invoke(vm); }