示例#1
0
 private void CreateBehaviourProxies(IEnumerable <BehaviourComponent> behaviourComponents)
 {
     foreach (BehaviourComponent component in behaviourComponents)
     {
         BehaviourViewModel vm = BehaviourViewModelFactory.GetViewModelProxy(component);
         if (vm != null)
         {
             componentProxies.Add(vm);
         }
     }
 }
示例#2
0
        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);
        }