Ejemplo n.º 1
0
		public PropertyEditor CreateEditor(Type baseType, ProviderContext context)
		{
			PropertyEditor e = null;
			bool compRef = !(context.ParentEditor is GameObjectOverviewPropertyEditor);

			// -------- Specialized area --------
			if (baseType == typeof(GameObject))
			{
				if (context.ParentEditor == null)
					e = new GameObjectOverviewPropertyEditor();
				else
					e = new GameObjectRefPropertyEditor();
			}
			else if (baseType == typeof(Transform) && !compRef)		e = new TransformPropertyEditor();
			else if (baseType == typeof(SoundEmitter) && !compRef)	e = new SoundEmitterPropertyEditor();
			else if (baseType == typeof(BatchInfo))					e = new BatchInfoPropertyEditor();
			else if (baseType == typeof(Material))					e = new MaterialPropertyEditor();
			else if (baseType == typeof(Texture))					e = new TexturePropertyEditor();
			else if (baseType == typeof(AudioData))					e = new AudioDataPropertyEditor();
			else if (baseType == typeof(Pixmap))					e = new PixmapPropertyEditor();
			else if (baseType == typeof(Font))						e = new FontPropertyEditor();

			//// -------- Semi-Specialized area --------
			else if (typeof(RigidBody).IsAssignableFrom(baseType) && !compRef)	e = new RigidBodyPropertyEditor();
			else if (typeof(DrawTechnique).IsAssignableFrom(baseType))			e = new DrawTechniquePropertyEditor();

			// -------- General area --------
			else if (typeof(ShapeInfo).IsAssignableFrom(baseType))				e = new RigidBodyShapePropertyEditor();
			else if (typeof(Component).IsAssignableFrom(baseType) && compRef)	e = new ComponentRefPropertyEditor();
			else if (typeof(Component).IsAssignableFrom(baseType) && !compRef)	e = new ComponentPropertyEditor();
			else if (typeof(Resource).IsAssignableFrom(baseType))				e = new ResourcePropertyEditor();
			else if (typeof(IContentRef).IsAssignableFrom(baseType))			e = new IContentRefPropertyEditor();

			return e;
		}
Ejemplo n.º 2
0
        public PropertyEditor CreateEditor(Type baseType, ProviderContext context)
        {
            PropertyEditor e       = null;
            bool           compRef = !(context.ParentEditor is GameObjectOverviewPropertyEditor);

            // -------- Specialized area --------
            if (baseType == typeof(GameObject))
            {
                if (context.ParentEditor == null)
                {
                    e = new GameObjectOverviewPropertyEditor();
                }
                else
                {
                    e = new GameObjectRefPropertyEditor();
                }
            }
            else if (baseType == typeof(Transform) && !compRef)
            {
                e = new TransformPropertyEditor();
            }
            else if (baseType == typeof(SoundEmitter) && !compRef)
            {
                e = new SoundEmitterPropertyEditor();
            }
            else if (baseType == typeof(BatchInfo))
            {
                e = new BatchInfoPropertyEditor();
            }
            else if (baseType == typeof(Material))
            {
                e = new MaterialPropertyEditor();
            }
            else if (baseType == typeof(Texture))
            {
                e = new TexturePropertyEditor();
            }
            else if (baseType == typeof(AudioData))
            {
                e = new AudioDataPropertyEditor();
            }
            else if (baseType == typeof(Pixmap))
            {
                e = new PixmapPropertyEditor();
            }
            else if (baseType == typeof(Font))
            {
                e = new FontPropertyEditor();
            }

            //// -------- Semi-Specialized area --------
            else if (typeof(RigidBody).IsAssignableFrom(baseType) && !compRef)
            {
                e = new RigidBodyPropertyEditor();
            }
            else if (typeof(DrawTechnique).IsAssignableFrom(baseType))
            {
                e = new DrawTechniquePropertyEditor();
            }

            // -------- General area --------
            else if (typeof(ShapeInfo).IsAssignableFrom(baseType))
            {
                e = new RigidBodyShapePropertyEditor();
            }
            else if (typeof(Component).IsAssignableFrom(baseType) && compRef)
            {
                e = new ComponentRefPropertyEditor();
            }
            else if (typeof(Component).IsAssignableFrom(baseType) && !compRef)
            {
                e = new ComponentPropertyEditor();
            }
            else if (typeof(Resource).IsAssignableFrom(baseType))
            {
                e = new ResourcePropertyEditor();
            }
            else if (typeof(IContentRef).IsAssignableFrom(baseType))
            {
                e = new IContentRefPropertyEditor();
            }

            return(e);
        }