コード例 #1
0
		public static void DrawRTP (MatrixGenerators.RTPOutput200 gen) 
		{ 
			#if RTP
			UpdateMaterial();
			rtp = MapMagic.instance.GetComponent<ReliefTerrain>();

			/*#if CTS_PRESENT
			ctsProfile = (CTS.CTSProfile)Draw.Field(ctsProfile, "CTS Profile", type:typeof(CTS.CTSProfile),
				onChange:np=>CTS_UpdateShader((CTS.CTSProfile)np, MapMagic.instance.terrainSettings.material) );

			if (Draw.Button(false, "Update Shader"))
				CTS_UpdateShader(ctsProfile, MapMagic.instance.terrainSettings.material);

			//populating texture names
			*/

			if (rtp != null)
			{
				if (textureNames==null || textureNames.Length!=rtp.globalSettingsHolder.numLayers) textureNames = new string[rtp.globalSettingsHolder.numLayers];
				textureNames.Process(i=>rtp.globalSettingsHolder.splats[i]!=null ? rtp.globalSettingsHolder.splats[i].name : null); //nb linq?
			}

			using (Cell.Line)
			{
				Cell.current.margins = new Padding(4);
				DrawCustomMaterialWarning(MapMagic.instance.terrainSettings);
				DrawRTPComponentWarning(MapMagic.instance.terrainSettings);
			}
				
			#else
			using (Cell.LinePx(36)) Draw.Label("RTP is not installed or RTP \ncompatibility is disabled");
			#endif

		}
コード例 #2
0
		public static void DrawRTPLayer (MatrixGenerators.RTPOutput200.RTPLayer layer, object[] arguments)
		{
			int num = (int)arguments[0];
			MatrixGenerators.RTPOutput200 gen = (MatrixGenerators.RTPOutput200)arguments[1];
			if (layer == null) return;

			using (Cell.LinePx(32))
			{
				//Cell.current.margins = new Padding(0,0,0,1); //1-pixel more padding from the bottom since layers are 1 pixel overlayed

				if (num!=0) 
					using (Cell.RowPx(0)) GeneratorDraw.DrawInlet(layer, gen);
				else 
					//disconnecting last layer inlet
					if (GraphWindow.current.graph.IsLinked(layer))
						GraphWindow.current.graph.UnlinkInlet(layer);

				Cell.EmptyRowPx(10);

				//icon
				#if RTP
				Texture2D icon = null;
				if (rtp != null)
				{
					if (layer.channelNum < rtp.globalSettingsHolder.splats.Length)
						icon = rtp.globalSettingsHolder.splats[layer.channelNum];
				}
				Draw.TextureIcon(icon, cell:UI.Empty(Size.RowPixels(32))); 

				//channel selector
				UI.Empty(Size.RowPixels(3));
				UI.PopupSelector(ref layer.channelNum, textureNames, null);
				#else
				using (Cell.LineStd) Draw.Field(ref layer.channelNum, "Channel");
				#endif

				Cell.EmptyRowPx(10);
				using (Cell.RowPx(0)) GeneratorDraw.DrawOutlet(layer);
			}
		}