public void RemoveRenderer(ICmpRenderer renderer)
		{
			Type type = renderer.GetType();
			RawList<ICmpRenderer> list;
			if (!this.renderersByType.TryGetValue(type, out list))
			{
				list = new RawList<ICmpRenderer>();
				this.renderersByType.Add(type, list);
			}
			list.Remove(renderer);
			this.totalRendererCount--;
		}
Exemplo n.º 2
0
        private void AddToManagers(Component cmp)
        {
            // Per-Type lists
            TypeInfo         cmpType = cmp.GetType().GetTypeInfo();
            List <Component> cmpList;

            if (!this.componentsByType.TryGetValue(cmpType, out cmpList))
            {
                cmpList = new List <Component>();
                this.componentsByType[cmpType] = cmpList;
            }
            cmpList.Add(cmp);

            // Specialized lists
            ICmpRenderer renderer = cmp as ICmpRenderer;

            if (renderer != null)
            {
                this.visibilityStrategy.AddRenderer(renderer);
            }
        }
Exemplo n.º 3
0
        public ICmpRenderer PickRendererAt(int x, int y)
        {
            this.RenderableSite.MakeCurrent();
            this.RenderPickingMap();

            ICmpRenderer picked          = this.CameraComponent.PickRendererAt(x / 2, y / 2);
            Component    pickedComponent = picked as Component;

            if (pickedComponent == null)
            {
                return(null);
            }
            if (pickedComponent.Disposed)
            {
                return(null);
            }
            if (pickedComponent.GameObj == null)
            {
                return(null);
            }

            return(picked);
        }
Exemplo n.º 4
0
 private bool RendererFilter(ICmpRenderer r)
 {
     GameObject obj = (r as Component).GameObj;
     DesignTimeObjectData data = CorePluginRegistry.GetDesignTimeData(obj);
     return !data.IsHidden;
 }
		protected bool RendererFilter(ICmpRenderer r)
		{
			GameObject obj = (r as Component).GameObj;
			if (obj.RigidBody == null || !(r as Component).Active) return false;

			DesignTimeObjectData data = CorePluginRegistry.GetDesignTimeData(obj);
			return !data.IsHidden;
		}
Exemplo n.º 6
0
		private bool RendererFilter(ICmpRenderer r)
		{
			GameObject obj = (r as Component).GameObj;

			if (this.objectVisibility != null && this.objectVisibility.Count > 0)
			{
				bool match = false;
				foreach (Type type in this.objectVisibility)
				{
					if (obj.GetComponent(type) != null)
					{
						match = true;
						break;
					}
				}
				if (!match) return false;
			}

			DesignTimeObjectData data = DesignTimeObjectData.Get(obj);
			return !data.IsHidden;
		}
Exemplo n.º 7
0
 private bool RendererFilter(ICmpRenderer r)
 {
     GameObject obj = (r as Component).GameObj;
     DesignTimeObjectData data = DesignTimeObjectData.Get(obj);
     return !data.IsHidden;
 }
        protected bool RendererFilter(ICmpRenderer r)
        {
            GameObject obj = (r as Component).GameObj;
            if (this.renderAll == false || !(r as Component).Active) return false;

            DesignTimeObjectData data = DesignTimeObjectData.Get(obj);
            return !data.IsHidden;
        }