Exemplo n.º 1
0
	private static void UpdateNGUIs(GameObject owner, 
		string psdFileName, List<PsdLayerExtractor.Layer> layers)
	{
		var pa = new PsdLayerCommandParser();
		pa.Parse(psdFileName, layers);

		foreach (var c in pa.root.children)
		{
			if (!PsdLayerToNGUI.UpdateNGUI(owner, c))
				PsdLayerToNGUI.CreateNGUI(owner, c);
		}
	}
Exemplo n.º 2
0
	private static void CreateNGUIs(GameObject rootGo, GameObject owner,
		string psdFileName, List<PsdLayerExtractor.Layer> layers)
	{
		if (!PsdLayerToNGUI.data.createControls)
			return;
		
		var root = Util.FindComponent<UIRoot>(rootGo);
		{
			root.manualHeight = 
			root.maximumHeight = 
			root.minimumHeight = PsdLayerToNGUI.data.targetHeight;
		}
		var anchor = Util.FindComponent<UIAnchor>(root);
		if (anchor != null)
		{
			anchor.side = UIAnchor.Side.Center;
		}
		
		var pa = new PsdLayerCommandParser();
		pa.Parse(psdFileName, layers);

		foreach (var c in pa.root.children)
		{
			PsdLayerToNGUI.CreateNGUI(owner, c);
		}
	}