Nez.InspectorList.initialize C# (CSharp) Method

initialize() public method

public initialize ( Table table, Skin skin ) : void
table Nez.UI.Table
skin Skin
return void
		public void initialize( Table table, Skin skin )
		{
			table.getRowDefaults().setPadTop( 10 );
			table.add( name.Replace( "PostProcessor", string.Empty ) ).getElement<Label>().setFontScale( 1f ).setFontColor( new Color( 241, 156, 0 ) );

			// if we have a component, stick a bool for enabled here
			if( target != null )
			{
				_enabledCheckbox = new CheckBox( string.Empty, skin );
				_enabledCheckbox.programmaticChangeEvents = false;

				if( target is Component )
					_enabledCheckbox.isChecked = ( (Component)target ).enabled;
				else if( target is PostProcessor )
					_enabledCheckbox.isChecked = ((PostProcessor)target ).enabled;
				
				_enabledCheckbox.onChanged += newValue =>
				{
					if( target is Component )
						((Component)target).enabled = newValue;
					else if( target is PostProcessor )
						( (PostProcessor)target ).enabled = newValue;
				};

				table.add( _enabledCheckbox ).right();
			}
			table.row();

			foreach( var i in _inspectors )
			{
				i.initialize( table, skin );
				table.row();
			}
		}

Usage Example

Esempio n. 1
0
        void cacheTransformInspector()
        {
            // add Transform separately
            var transformInspector = new InspectorList(_entity.transform);

            transformInspector.initialize();
            _inspectors.Add(transformInspector);
        }
All Usage Examples Of Nez.InspectorList::initialize