コード例 #1
0
        private void HandleEntityRemoved(object sender, EntityEventArgs args)
        {
            var removed = Entities.Remove(args.Entity);

            if (removed)
            {
                OnEntityRemoved(args);
            }
        }
コード例 #2
0
        private void HandleEntityAdded(object sender, EntityEventArgs args)
        {
            foreach (var binding in Bindings)
            {
                if (!args.Entity.Components.TryGetValue(binding, out var value))
                {
                    return;
                }
            }

            Entities.Add(args.Entity);
            OnEntityAdded(args);
        }
コード例 #3
0
ファイル: Scene.cs プロジェクト: polytronicgr/Axiverse
 protected internal void OnEntityRemoved(EntityEventArgs args)
 {
     args.Entity.ComponentAdded   -= HandleComponentAdded;
     args.Entity.ComponentRemoved -= HandleComponentRemoved;
     EntityRemoved?.Invoke(this, args);
 }
コード例 #4
0
 protected void OnEntityRemoved(EntityEventArgs args)
 {
     EntityRemoved?.Invoke(this, args);
 }